idnits 2.17.1 draft-polli-id-digest-algorithms-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (18 December 2020) is 1225 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-13) exists of draft-ietf-httpbis-digest-headers-04 ** Obsolete normative reference: RFC 7231 (ref. 'SEMANTICS') (Obsoleted by RFC 9110) Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group R. Polli 3 Internet-Draft Digital Transformation Department, Italian Government 4 Intended status: Standards Track 18 December 2020 5 Expires: 21 June 2021 7 The "id-" prefix for Digest Algorithms 8 draft-polli-id-digest-algorithms-01 10 Abstract 12 This document defines the "id-" prefix for digest-algorithms used in 13 the Digest HTTP field. This prefix explicits that the value of the 14 digest-algorithm is independent from Content-Encoding. 16 Note to Readers 18 _RFC EDITOR: please remove this section before publication_ 20 Discussion of this draft takes place on the HTTP working group 21 mailing list (ietf-http-wg@w3.org), which is archived at 22 https://lists.w3.org/Archives/Public/ietf-http-wg/ 23 (https://lists.w3.org/Archives/Public/ietf-http-wg/). 25 The source code and issues list for this draft can be found at 26 https://github.com/ioggstream/draft-polli-Retry-Scope 27 (https://github.com/ioggstream/draft-polli-Retry-Scope). 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at https://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on 21 June 2021. 46 Copyright Notice 48 Copyright (c) 2020 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 53 license-info) in effect on the date of publication of this document. 54 Please review these documents carefully, as they describe your rights 55 and restrictions with respect to this document. Code Components 56 extracted from this document must include Simplified BSD License text 57 as described in Section 4.e of the Trust Legal Provisions and are 58 provided without warranty as described in the Simplified BSD License. 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 63 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 64 2. The "id-" prefix for digest-algorithms . . . . . . . . . . . 3 65 3. Security Considerations . . . . . . . . . . . . . . . . . . . 4 66 3.1. Disclosure of encrypted content . . . . . . . . . . . . . 4 67 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 68 4.1. TBD how to reserve "id-" prefix? . . . . . . . . . . . . 4 69 5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 4 70 5.1. The id-crc32c digest-algorithm . . . . . . . . . . . . . 4 71 6. Normative References . . . . . . . . . . . . . . . . . . . . 4 72 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 5 73 FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 74 Code Samples . . . . . . . . . . . . . . . . . . . . . . . . . . 5 75 Change Log . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 76 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 6 78 1. Introduction 80 The [DIGEST] defines a way to convey a checksum of a representation- 81 data as specified in [SEMANTICS]. 83 As the representation data depends on the value of "Content- 84 Encoding", it is useful to convey the checksum value of a 85 representation without any content-coding applied. 87 This proposal introduces the "id-" prefix to specify that the 88 provided digest-algorithm value is computed on the representation- 89 data without any content-coding applied. 91 1.1. Notational Conventions 93 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 94 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 95 "OPTIONAL" in this document are to be interpreted as described in 96 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 97 capitals, as shown here. These words may also appear in this 98 document in lower case as plain English words, absent their normative 99 meanings. 101 This document uses the Augmented BNF defined in [RFC5234] and updated 102 by [RFC7405]. 104 The definitions "representation", "selected representation", 105 "representation data", "representation metadata", and "payload body" 106 in this document are to be interpreted as described in [SEMANTICS]. 108 The definitions "digest-algorithm" and "representation-data-digest" 109 in this document are to be interpreted as described in [DIGEST]. 111 2. The "id-" prefix for digest-algorithms 113 A digest-algorithm to be registered within the HTTP Digest Algorithm 114 Values (https://www.iana.org/assignments/http-dig-alg/http-dig- 115 alg.xhtml) MUST NOT start with the string "id-". 117 The following two examples show two digest-algorithm names that 118 cannot be registered 120 id-crc32c 121 id-adler32 123 For every digest-algorithm registered in the HTTP Digest Algorithm 124 Values (https://www.iana.org/assignments/http-dig-alg/http-dig- 125 alg.xhtml) the associate "id-" digest-algorithm has the following 126 properties: 128 * the checksum is computed on the representation-data of the 129 resource when no content coding is applied; 131 * the checksum is computed according to the original digest- 132 algorithm Description field, and uses the same encoding of the 133 original digest-algorithm. 135 This definition is compatible, and thus extends, the definition of 136 the "id-sha-256" and "id-sha-512" digest-algorithms contained in 137 Section X of [DIGEST]. 139 3. Security Considerations 141 3.1. Disclosure of encrypted content 143 Like the "id-sha-256" digest-algoritm defined in [DIGEST] if the 144 content-coding provides encryption features, sending the checksum of 145 unencoded representation can disclose information. 147 4. IANA Considerations 149 4.1. TBD how to reserve "id-" prefix? 151 5. Examples 153 5.1. The id-crc32c digest-algorithm 155 The following request conveys a brotli encoded json object 157 {"hello": "world"} 159 The "Digest" computed using the "crc32c" digest-algorithm present in 160 HTTP Digest Algorithm Values (https://www.iana.org/assignments/http- 161 dig-alg/http-dig-alg.xhtml) is content-coding aware, while its 162 associated "id-" digest-algorithm is not "id-crc32c" 164 POST /data HTTP/1.1 165 Content-Type: application/json 166 Content-Encoding: br 167 Digest: id-crc32c=43794720, crc32c=DB329237 169 CwGAZG9nAw== 171 6. Normative References 173 [DIGEST] Polli, R. and L. Pardue, "Digest Headers", Work in 174 Progress, Internet-Draft, draft-ietf-httpbis-digest- 175 headers-04, 17 October 2020, . 178 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 179 Requirement Levels", BCP 14, RFC 2119, 180 DOI 10.17487/RFC2119, March 1997, 181 . 183 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 184 Specifications: ABNF", STD 68, RFC 5234, 185 DOI 10.17487/RFC5234, January 2008, 186 . 188 [RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", 189 RFC 7405, DOI 10.17487/RFC7405, December 2014, 190 . 192 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 193 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 194 May 2017, . 196 [SEMANTICS] 197 Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 198 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 199 DOI 10.17487/RFC7231, June 2014, 200 . 202 Appendix A. Acknowledgements 204 This specification was born from a thread created by James Manger and 205 the subsequent discussion here https://github.com/httpwg/http- 206 extensions/issues/885. 208 FAQ 210 Q: Question 1 Answer 1 212 Code Samples 214 _RFC Editor: Please remove this section before publication._ 216 How can I generate and validate the "Digest" values shown in the 217 examples throughout this document? 219 The following python3 code can be used to generate digests for json 220 objects using crc32c algorithm. Note that these are formatted as 221 base64. This function could be adapted to other algorithms and 222 should take into account their specific formatting rules. 224 import base64, json, brotli, crc32c 226 identity = lambda x: x 228 def digest(item, content_coding=identity, algorithm=crc32c.crc32c): 229 json_bytes = json.dumps(item).encode() 230 content_encoded = content_coding(json_bytes) 231 checksum = algorithm(content_encoded) 232 # encode result has uppercase hex 233 return hex(checksum)[2:].upper() 235 item = {"hello": "world"} 237 print("crc32c digest value for a br-coded representation: ", 238 digest(item, content_coding=brotli.compress) 239 ) 241 print("id-crc32c digest value for a br-coded representation: ", 242 digest(item, content_coding=identity) 243 ) 245 Change Log 247 RFC EDITOR PLEASE DELETE THIS SECTION. 249 Author's Address 251 Roberto Polli 252 Digital Transformation Department, Italian Government 253 Italy 255 Email: robipolli@gmail.com