draft-ietf-httpbis-digest-headers-03.txt   draft-ietf-httpbis-digest-headers-04.txt 
HTTP R. Polli HTTP R. Polli
Internet-Draft Team Digitale, Italian Government Internet-Draft Team Digitale, Italian Government
Intended status: Standards Track L. Pardue Intended status: Standards Track L. Pardue
Expires: March 11, 2021 Cloudflare Expires: 20 April 2021 Cloudflare
September 07, 2020 17 October 2020
Digest Headers Digest Headers
draft-ietf-httpbis-digest-headers-03 draft-ietf-httpbis-digest-headers-04
Abstract Abstract
This document defines the HTTP Digest and Want-Digest fields, thus This document defines the HTTP Digest and Want-Digest fields, thus
allowing client and server to negotiate an integrity checksum of the allowing client and server to negotiate an integrity checksum of the
exchanged resource representation data. exchanged resource representation data.
This document obsoletes RFC 3230. It replaces the term "instance" This document obsoletes RFC 3230. It replaces the term "instance"
with "representation", which makes it consistent with the HTTP with "representation", which makes it consistent with the HTTP
Semantic and Context defined in draft-ietf-httpbis-semantics. Semantic and Context defined in draft-ietf-httpbis-semantics.
Note to Readers Note to Readers
_RFC EDITOR: please remove this section before publication_ _RFC EDITOR: please remove this section before publication_
Discussion of this draft takes place on the HTTP working group Discussion of this draft takes place on the HTTP working group
mailing list (ietf-http-wg@w3.org), which is archived at mailing list (ietf-http-wg@w3.org), which is archived at
https://lists.w3.org/Archives/Public/ietf-http-wg/ [1]. https://lists.w3.org/Archives/Public/ietf-http-wg/
(https://lists.w3.org/Archives/Public/ietf-http-wg/).
The source code and issues list for this draft can be found at The source code and issues list for this draft can be found at
https://github.com/httpwg/http-extensions [2]. https://github.com/httpwg/http-extensions (https://github.com/httpwg/
http-extensions).
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 20 April 2021.
This Internet-Draft will expire on March 11, 2021.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents (https://trustee.ietf.org/
(https://trustee.ietf.org/license-info) in effect on the date of license-info) in effect on the date of publication of this document.
publication of this document. Please review these documents Please review these documents carefully, as they describe your rights
carefully, as they describe your rights and restrictions with respect and restrictions with respect to this document. Code Components
to this document. Code Components extracted from this document must extracted from this document must include Simplified BSD License text
include Simplified BSD License text as described in Section 4.e of as described in Section 4.e of the Trust Legal Provisions and are
the Trust Legal Provisions and are provided without warranty as provided without warranty as described in the Simplified BSD License.
described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1. A Brief History of HTTP Integrity Fields . . . . . . . . 4 1.1. A Brief History of HTTP Integrity Fields . . . . . . . . 4
1.2. This Proposal . . . . . . . . . . . . . . . . . . . . . . 4 1.2. This Proposal . . . . . . . . . . . . . . . . . . . . . . 4
1.3. Goals . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3. Goals . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4. Notational Conventions . . . . . . . . . . . . . . . . . 5 1.4. Notational Conventions . . . . . . . . . . . . . . . . . 5
2. Representation Digest . . . . . . . . . . . . . . . . . . . . 6 2. Representation Digest . . . . . . . . . . . . . . . . . . . . 6
3. The Digest Field . . . . . . . . . . . . . . . . . . . . . . 6 3. The Digest Field . . . . . . . . . . . . . . . . . . . . . . 7
4. The Want-Digest Field . . . . . . . . . . . . . . . . . . . . 7 4. The Want-Digest Field . . . . . . . . . . . . . . . . . . . . 7
5. Digest Algorithm Values . . . . . . . . . . . . . . . . . . . 8 5. Digest Algorithm Values . . . . . . . . . . . . . . . . . . . 8
6. Use of Digest when acting on resources . . . . . . . . . . . 10 6. Use of Digest when acting on resources . . . . . . . . . . . 10
6.1. Digest and PATCH . . . . . . . . . . . . . . . . . . . . 11 6.1. Digest and PATCH . . . . . . . . . . . . . . . . . . . . 11
7. Deprecate Negotiation of Content-MD5 . . . . . . . . . . . . 11 7. Deprecate Negotiation of Content-MD5 . . . . . . . . . . . . 11
8. Relationship to Subresource Integrity (SRI) . . . . . . . . . 11 8. Obsolete Digest Header Field Parameters . . . . . . . . . . . 11
8.1. Supporting Both SRI and Representation Digest . . . . . . 12 9. Relationship to Subresource Integrity (SRI) . . . . . . . . . 11
9. Examples of Unsolicited Digest . . . . . . . . . . . . . . . 13 9.1. Supporting Both SRI and Representation Digest . . . . . . 12
9.1. Server Returns Full Representation Data . . . . . . . . . 13 10. Examples of Unsolicited Digest . . . . . . . . . . . . . . . 13
9.2. Server Returns No Representation Data . . . . . . . . . . 13 10.1. Server Returns Full Representation Data . . . . . . . . 13
9.3. Server Returns Partial Representation Data . . . . . . . 13 10.2. Server Returns No Representation Data . . . . . . . . . 13
9.4. Client and Server Provide Full Representation Data . . . 14 10.3. Server Returns Partial Representation Data . . . . . . . 14
9.5. Client Provides Full Representation Data, Server Provides 10.4. Client and Server Provide Full Representation Data . . . 14
No Representation Data . . . . . . . . . . . . . . . . . 15 10.5. Client Provides Full Representation Data, Server Provides
9.6. Client and Server Provide Full Representation Data, No Representation Data . . . . . . . . . . . . . . . . 15
Client Uses id-sha-256. . . . . . . . . . . . . . . . . . 15 10.6. Client and Server Provide Full Representation Data, Client
9.7. POST Response does not Reference the Request URI . . . . 16 Uses id-sha-256. . . . . . . . . . . . . . . . . . . . 15
9.8. POST Response Describes the Request Status . . . . . . . 16 10.7. POST Response does not Reference the Request URI . . . . 16
9.9. Digest with PATCH . . . . . . . . . . . . . . . . . . . . 17 10.8. POST Response Describes the Request Status . . . . . . . 17
9.10. Error responses . . . . . . . . . . . . . . . . . . . . . 18 10.9. Digest with PATCH . . . . . . . . . . . . . . . . . . . 17
9.11. Use with trailers and transfer coding . . . . . . . . . . 19 10.10. Error responses . . . . . . . . . . . . . . . . . . . . 18
10. Examples of Want-Digest Solicited Digest . . . . . . . . . . 19 10.11. Use with trailers and transfer coding . . . . . . . . . 19
10.1. Server Selects Client's Least Preferred Algorithm . . . 20 11. Examples of Want-Digest Solicited Digest . . . . . . . . . . 19
10.2. Server Selects Algorithm Unsupported by Client . . . . . 20 11.1. Server Selects Client's Least Preferred Algorithm . . . 20
10.3. Server Does Not Support Client Algorithm and Returns an 11.2. Server Selects Algorithm Unsupported by Client . . . . . 20
11.3. Server Does Not Support Client Algorithm and Returns an
Error . . . . . . . . . . . . . . . . . . . . . . . . . 20 Error . . . . . . . . . . . . . . . . . . . . . . . . . 20
11. Security Considerations . . . . . . . . . . . . . . . . . . . 21 12. Security Considerations . . . . . . . . . . . . . . . . . . . 21
11.1. Digest Does Not Protect the Full HTTP Message . . . . . 21 12.1. Digest Does Not Protect the Full HTTP Message . . . . . 21
11.2. Broken Cryptographic Algorithms . . . . . . . . . . . . 21 12.2. Broken Cryptographic Algorithms . . . . . . . . . . . . 21
11.3. Other Deprecated Algorithms . . . . . . . . . . . . . . 21 12.3. Other Deprecated Algorithms . . . . . . . . . . . . . . 21
11.4. Digest for End-to-End Integrity . . . . . . . . . . . . 21 12.4. Digest for End-to-End Integrity . . . . . . . . . . . . 21
11.5. Digest and Content-Location in responses . . . . . . . . 22 12.5. Digest and Content-Location in responses . . . . . . . . 22
11.6. Usage in signatures . . . . . . . . . . . . . . . . . . 22 12.6. Usage in signatures . . . . . . . . . . . . . . . . . . 22
11.7. Usage in trailers . . . . . . . . . . . . . . . . . . . 22 12.7. Usage in trailers . . . . . . . . . . . . . . . . . . . 22
11.8. Usage with encryption . . . . . . . . . . . . . . . . . 23 12.8. Usage with encryption . . . . . . . . . . . . . . . . . 23
11.9. Algorithm Agility . . . . . . . . . . . . . . . . . . . 23 12.9. Algorithm Agility . . . . . . . . . . . . . . . . . . . 23
12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23
12.1. Establish the HTTP Digest Algorithm Values . . . . . . . 23 13.1. Establish the HTTP Digest Algorithm Values . . . . . . . 23
12.2. The "status" Field in the HTTP Digest Algorithm Values . 23 13.2. The "status" Field in the HTTP Digest Algorithm
12.3. Deprecate "MD5" Digest Algorithm . . . . . . . . . . . . 23 Values . . . . . . . . . . . . . . . . . . . . . . . . 23
12.4. Update "UNIXsum" Digest Algorithm . . . . . . . . . . . 24 13.3. Deprecate "MD5" Digest Algorithm . . . . . . . . . . . . 24
12.5. Update "UNIXcksum" Digest Algorithm . . . . . . . . . . 24 13.4. Update "UNIXsum" Digest Algorithm . . . . . . . . . . . 24
12.6. Update "CRC32c" Digest Algorithm . . . . . . . . . . . . 24 13.5. Update "UNIXcksum" Digest Algorithm . . . . . . . . . . 24
12.7. Obsolete "SHA" Digest Algorithm . . . . . . . . . . . . 24 13.6. Update "CRC32c" Digest Algorithm . . . . . . . . . . . . 25
12.8. Obsolete "ADLER32" Digest Algorithm . . . . . . . . . . 25 13.7. Deprecate "SHA" Digest Algorithm . . . . . . . . . . . . 25
12.9. Obsolete "contentMD5" token in Digest Algorithm . . . . 25 13.8. Obsolete "ADLER32" Digest Algorithm . . . . . . . . . . 25
12.10. The "id-sha-256" Digest Algorithm . . . . . . . . . . . 25 13.9. Obsolete "contentMD5" token in Digest Algorithm . . . . 26
12.11. The "id-sha-512" Digest Algorithm . . . . . . . . . . . 26 13.10. The "id-sha-256" Digest Algorithm . . . . . . . . . . . 26
12.12. Changes compared to RFC5843 . . . . . . . . . . . . . . 26 13.11. The "id-sha-512" Digest Algorithm . . . . . . . . . . . 26
12.13. Want-Digest Field Registration . . . . . . . . . . . . . 26 13.12. Changes compared to RFC5843 . . . . . . . . . . . . . . 26
12.14. Digest Header Field Registration . . . . . . . . . . . . 26 13.13. Want-Digest Field Registration . . . . . . . . . . . . . 27
13. References . . . . . . . . . . . . . . . . . . . . . . . . . 27 13.14. Digest Header Field Registration . . . . . . . . . . . . 27
13.1. Normative References . . . . . . . . . . . . . . . . . . 27 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 27
13.2. Informative References . . . . . . . . . . . . . . . . . 28 14.1. Normative References . . . . . . . . . . . . . . . . . . 27
13.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 29 14.2. Informative References . . . . . . . . . . . . . . . . . 29
Appendix A. Resource Representation and Representation-Data . . 30 Appendix A. Resource Representation and Representation-Data . . 30
Appendix B. FAQ . . . . . . . . . . . . . . . . . . . . . . . . 32 Appendix B. FAQ . . . . . . . . . . . . . . . . . . . . . . . . 32
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 33 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 34
Code Samples . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Code Samples . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
E.1. Since draft-ietf-httpbis-digest-headers-00 . . . . . . . 34 Since draft-ietf-httpbis-digest-headers-03 . . . . . . . . . . 35
E.2. Since draft-ietf-httpbis-digest-headers-01 . . . . . . . 35 Since draft-ietf-httpbis-digest-headers-02 . . . . . . . . . . 35
E.3. Since draft-ietf-httpbis-digest-headers-02 . . . . . . . 35 Since draft-ietf-httpbis-digest-headers-01 . . . . . . . . . . 36
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 35 Since draft-ietf-httpbis-digest-headers-00 . . . . . . . . . . 36
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 36
1. Introduction 1. Introduction
The core specification of HTTP does not define a means to protect the The core specification of HTTP does not define a means to protect the
integrity of resources. When HTTP messages are transferred between integrity of resources. When HTTP messages are transferred between
endpoints, the protocol might choose to make use of features of the endpoints, the protocol might choose to make use of features of the
lower layer in order to provide some integrity protection; for lower layer in order to provide some integrity protection; for
instance TCP checksums or TLS records [RFC2818]. instance TCP checksums or TLS records [RFC2818].
However, there are cases where relying on this alone is insufficient. However, there are cases where relying on this alone is insufficient.
skipping to change at page 4, line 40 skipping to change at page 4, line 48
The concept of "selected representation" defined in Section 7 of The concept of "selected representation" defined in Section 7 of
[SEMANTICS] makes [RFC3230] definitions inconsistent with current [SEMANTICS] makes [RFC3230] definitions inconsistent with current
HTTP semantics. This document updates the "Digest" and "Want-Digest" HTTP semantics. This document updates the "Digest" and "Want-Digest"
field definitions to align with [SEMANTICS] concepts. field definitions to align with [SEMANTICS] concepts.
Basing "Digest" on the selected representation makes it Basing "Digest" on the selected representation makes it
straightforward to apply it to use-cases where the transferred data straightforward to apply it to use-cases where the transferred data
does require some sort of manipulation to be considered a does require some sort of manipulation to be considered a
representation, or conveys a partial representation of a resource eg. representation, or conveys a partial representation of a resource eg.
Range Requests (see Section 9.3 of [SEMANTICS]). Range Requests (see Section 13.2 of [SEMANTICS]).
Changes are semantically compatible with existing implementations and Changes are semantically compatible with existing implementations and
better cover both the request and response cases. better cover both the request and response cases.
The value of "Digest" is calculated on selected representation, which The value of "Digest" is calculated on selected representation, which
is tied to the value contained in any "Content-Encoding" or "Content- is tied to the value contained in any "Content-Encoding" or "Content-
Type" header fields. Therefore, a given resource may have multiple Type" header fields. Therefore, a given resource may have multiple
different digest values. different digest values.
To allow both parties to exchange a Digest of a representation with To allow both parties to exchange a Digest of a representation with
no content codings (see Section 7.1.2 of [SEMANTICS]) two more no content codings (see Section 7.5.1 of [SEMANTICS]) two more
digest-algorithms are added ("id-sha-256" and "id-sha-512"). digest-algorithms are added ("id-sha-256" and "id-sha-512").
1.3. Goals 1.3. Goals
The goals of this proposal are: The goals of this proposal are:
1. Digest coverage for either the resource's "representation data" 1. Digest coverage for either the resource's "representation data"
or "selected representation data" communicated via HTTP. or "selected representation data" communicated via HTTP.
2. Support for multiple digest-algorithms. 2. Support for multiple digest-algorithms.
skipping to change at page 5, line 46 skipping to change at page 6, line 6
1.4. Notational Conventions 1.4. Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 ([RFC2119] and [RFC8174]) when, and only when, they appear in all 14 ([RFC2119] and [RFC8174]) when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
This document uses the Augmented BNF defined in [RFC5234] and updated This document uses the Augmented BNF defined in [RFC5234] and updated
by [RFC7405] along with the "#rule" extension defined in Section 5 of by [RFC7405] along with the "#rule" extension defined in
[SEMANTICS]. Section 5.7.1 of [SEMANTICS].
The definitions "representation", "selected representation", The definitions "representation", "selected representation",
"representation data", "representation metadata", and "payload body" "representation data", "representation metadata", and "payload body"
in this document are to be interpreted as described in [SEMANTICS]. in this document are to be interpreted as described in [SEMANTICS].
Algorithm names respect the casing used in their definition document Algorithm names respect the casing used in their definition document
(eg. SHA-1, CRC32c) whereas digest-algorithm tokens are quoted (eg. (eg. SHA-1, CRC32c) whereas digest-algorithm tokens are quoted (eg.
"sha", "crc32c"). "sha", "crc32c").
2. Representation Digest 2. Representation Digest
The representation digest is an integrity mechanism for HTTP The representation digest is an integrity mechanism for HTTP
resources which uses a checksum that is calculated independently of resources which uses a checksum that is calculated independently of
the payload body (see Section 7.3.3 of [SEMANTICS]). It uses the the payload body (see Section 5.5.4 of [SEMANTICS]). It uses the
representation data (see Section 7.1 of [SEMANTICS]), that can be representation data (see Section 7.2 of [SEMANTICS]), that can be
fully or partially contained in the payload body, or not contained at fully or partially contained in the payload body, or not contained at
all: all:
representation-data := Content-Encoding( Content-Type( bits ) ) representation-data := Content-Encoding( Content-Type( bits ) )
This takes into account the effect of the HTTP semantics on the This takes into account the effect of the HTTP semantics on the
messages; for example the payload body can be affected by Range messages; for example the payload body can be affected by Range
Requests or methods such as HEAD, while the way the payload body is Requests or methods such as HEAD, while the way the payload body is
transferred "on the wire" is dependent on other transformations (eg. transferred "on the wire" is dependent on other transformations (eg.
transfer codings for HTTP/1.1 see 6.1 of [HTTP11]): Appendix A transfer codings for HTTP/1.1 see 6.1 of [HTTP11]): Appendix A
contains several examples to help illustrate those effects. contains several examples to help illustrate those effects.
A representation digest consists of the value of a checksum computed A representation digest consists of the value of a checksum computed
on the entire selected "representation data" (see Section 7 of on the entire selected "representation data" (see Section 7 of
[SEMANTICS]) of a resource identified according to Section 7.3.2 of [SEMANTICS]) of a resource identified according to Section 5.5.2 of
[SEMANTICS] together with an indication of the algorithm used (and [SEMANTICS] together with an indication of the algorithm used
any parameters)
representation-data-digest = digest-algorithm "=" representation-data-digest = digest-algorithm "="
<encoded digest output> <encoded digest output>
The checksum is computed using one of the digest-algorithms listed in The checksum is computed using one of the digest-algorithms listed in
Section 5 and then encoded in the associated format. Section 5 and then encoded in the associated format.
The example below shows the "sha-256" digest-algorithm which uses The example below shows the "sha-256" digest-algorithm which uses
base64 encoding. base64 encoding.
sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
3. The Digest Field 3. The Digest Field
The "Digest" field contains a list of one or more representation The "Digest" field contains a list of one or more representation
digest values as defined in Section 2. It can be used in both digest values as defined in Section 2. It can be used in both
request and response. request and response.
Digest = "Digest" ":" OWS 1#representation-data-digest Digest = "Digest" ":" OWS 1#representation-data-digest
The relationship between "Content-Location" (see Section 7.2.5 of The relationship between "Content-Location" (see Section 7.8 of
[SEMANTICS]) and "Digest" is demonstrated in Section 9.7. A [SEMANTICS]) and "Digest" is demonstrated in Section 10.7. A
comprehensive set of examples showing the impacts of representation comprehensive set of examples showing the impacts of representation
metadata, payload transformations and HTTP methods on Digest is metadata, payload transformations and HTTP methods on Digest is
provided in Section 9 and Section 10. provided in Section 10 and Section 11.
A "Digest" field MAY contain multiple representation-data-digest A "Digest" field MAY contain multiple representation-data-digest
values. This could be useful for responses expected to reside in values. For example, a server may provide representation-data-digest
caches shared by users with different browsers, for example. values using different algorithms, allowing it to support a
population of clients with different evolving capabilities; this is
particularly useful in support of transitioning away from weaker
algorithms should the need arise (see Section 12.9).
A recipient MAY ignore any or all of the representation-data-digests A recipient MAY ignore any or all of the representation-data-digests
in a Digest field. This allows the recipient to choose which digest- in a Digest field. This allows the recipient to choose which digest-
algorithm(s) to use for validation instead of verifying every algorithm(s) to use for validation instead of verifying every
received representation-data-digest. received representation-data-digest.
A sender MAY send a representation-data-digest using a digest- A sender MAY send a representation-data-digest using a digest-
algorithm without knowing whether the recipient supports the digest- algorithm without knowing whether the recipient supports the digest-
algorithm, or even knowing that the recipient will ignore it. algorithm, or even knowing that the recipient will ignore it.
skipping to change at page 7, line 44 skipping to change at page 8, line 7
id-sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= id-sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
4. The Want-Digest Field 4. The Want-Digest Field
The "Want-Digest" field indicates the sender's desire to receive a The "Want-Digest" field indicates the sender's desire to receive a
representation digest on messages associated with the request URI and representation digest on messages associated with the request URI and
representation metadata. representation metadata.
Want-Digest = "Want-Digest" ":" OWS 1#want-digest-value Want-Digest = "Want-Digest" ":" OWS 1#want-digest-value
want-digest-value = digest-algorithm [ ";" "q" "=" qvalue] want-digest-value = digest-algorithm [ ";" "q" "=" qvalue]
qvalue = ( "0" [ "." 0*1DIGIT ] ) / qvalue = ( "0"  [ "."  0*1DIGIT ] ) /
( "1" [ "." 0*1( "0" ) ] ) ( "1"  [ "."  0*1( "0" ) ] )
If a digest-algorithm is not accompanied by a "qvalue", it is treated If a digest-algorithm is not accompanied by a "qvalue", it is treated
as if its associated "qvalue" were 1.0. as if its associated "qvalue" were 1.0.
The sender is willing to accept a digest-algorithm if and only if it The sender is willing to accept a digest-algorithm if and only if it
is listed in a "Want-Digest" field of a message, and its "qvalue" is is listed in a "Want-Digest" field of a message, and its "qvalue" is
non-zero. non-zero.
If multiple acceptable digest-algorithm values are given, the If multiple acceptable digest-algorithm values are given, the
sender's preferred digest-algorithm is the one (or ones) with the sender's preferred digest-algorithm is the one (or ones) with the
highest "qvalue". highest "qvalue".
Two examples of its use are Two examples of its use are
Want-Digest: sha-256 Want-Digest: sha-256
Want-Digest: sha-512;q=0.3, sha-256;q=1, unixsum;q=0 Want-Digest: sha-512;q=0.3, sha-256;q=1, unixsum;q=0
5. Digest Algorithm Values 5. Digest Algorithm Values
Digest-algorithm values are used to indicate a specific digest Digest-algorithm values are used to indicate a specific digest
computation. For some digest-algorithms, one or more parameters can computation.
be supplied.
digest-algorithm = token digest-algorithm = token
The BNF for "parameter" is defined in Section 5.4.1.4 of [SEMANTICS].
All digest-algorithm values are case-insensitive but the lower case All digest-algorithm values are case-insensitive but the lower case
is preferred. is preferred.
The Internet Assigned Numbers Authority (IANA) acts as a registry for The Internet Assigned Numbers Authority (IANA) acts as a registry for
digest-algorithm values. The registry contains the tokens listed digest-algorithm values. The registry contains the tokens listed
below. below.
Some digest-algorithms, although registered, rely on vulnerable Some digest-algorithms, although registered, rely on vulnerable
algorithms: the "md5" digest-algorithm MUST NOT be used due to algorithms: the "md5" digest-algorithm MUST NOT be used due to
collision attacks [CMU-836068] and the "sha" digest-algorithm MUST collision attacks [CMU-836068] and the "sha" digest-algorithm MUST
skipping to change at page 10, line 48 skipping to change at page 10, line 44
but are semantically acting on resources. The enclosed but are semantically acting on resources. The enclosed
representation, including its metadata refers to that action. representation, including its metadata refers to that action.
In these requests the representation digest MUST be computed on the In these requests the representation digest MUST be computed on the
representation-data of that action. This is the only possible choice representation-data of that action. This is the only possible choice
because representation digest requires complete representation because representation digest requires complete representation
metadata (see Section 2). metadata (see Section 2).
In responses, In responses,
o if the representation describes the status of the request, * if the representation describes the status of the request,
"Digest" MUST be computed on the enclosed representation (see "Digest" MUST be computed on the enclosed representation (see
Section 9.8 ); Section 10.8 );
o if there is a referenced resource "Digest" MUST be computed on the * if there is a referenced resource "Digest" MUST be computed on the
selected representation of the referenced resource even if that is selected representation of the referenced resource even if that is
different from the target resource. That might or might not different from the target resource. That might or might not
result in computing "Digest" on the enclosed representation. result in computing "Digest" on the enclosed representation.
The latter case might be done according to the HTTP semantics of the The latter case might be done according to the HTTP semantics of the
given method, for example using the "Content-Location" header field. given method, for example using the "Content-Location" header field.
In contrast, the "Location" header field does not affect "Digest" In contrast, the "Location" header field does not affect "Digest"
because it is not representation metadata. because it is not representation metadata.
6.1. Digest and PATCH 6.1. Digest and PATCH
skipping to change at page 11, line 35 skipping to change at page 11, line 30
"Digest" usage with PATCH is thus very similar to the POST one, but "Digest" usage with PATCH is thus very similar to the POST one, but
with the resource's own semantic partly implied by the method and by with the resource's own semantic partly implied by the method and by
the patch document. the patch document.
7. Deprecate Negotiation of Content-MD5 7. Deprecate Negotiation of Content-MD5
This RFC deprecates the negotiation of Content-MD5 as it has been This RFC deprecates the negotiation of Content-MD5 as it has been
obsoleted by [RFC7231]. The "contentMD5" token defined in Section 5 obsoleted by [RFC7231]. The "contentMD5" token defined in Section 5
of [RFC3230] MUST NOT be used as a digest-algorithm. of [RFC3230] MUST NOT be used as a digest-algorithm.
8. Relationship to Subresource Integrity (SRI) 8. Obsolete Digest Header Field Parameters
This document obsoletes the usage of parameters with "Digest"
introduced in Section 4.1.1 and 4.2 of [RFC3230] because this feature
has not been widely deployed and complicates field-value processing.
Field parameters provided a common way to attach additional
information to a representation-data-digest, but if they are used as
an input to validate the checksum, an attacker could alter them to
steer the validation behavior.
A digest-algorithm can still be parameterized defining its own way to
encode parameters into the representation-data-digest in such a way
as to mitigate security risks related to its computation.
9. Relationship to Subresource Integrity (SRI)
Subresource Integrity [SRI] is an integrity mechanism that shares Subresource Integrity [SRI] is an integrity mechanism that shares
some similarities to the present document's mechanism. However, some similarities to the present document's mechanism. However,
there are differences in motivating factors, threat model and there are differences in motivating factors, threat model and
specification of integrity digest generation, signalling and specification of integrity digest generation, signalling and
validation. validation.
SRI allows a first-party authority to declare an integrity assertion SRI allows a first-party authority to declare an integrity assertion
on a resource served by a first or third party authority. This is on a resource served by a first or third party authority. This is
done via the "integrity" attribute that can be added to "script" or done via the "integrity" attribute that can be added to "script" or
"link" HTML elements. Therefore, the integrity assertion is always "link" HTML elements. Therefore, the integrity assertion is always
made out-of-band to the resource fetch. In contrast, the "Digest" made out-of-band to the resource fetch. In contrast, the "Digest"
field is supplied in-band alongside the selected representation, field is supplied in-band alongside the selected representation,
meaning that an authority can only declare an integrity assertion for meaning that an authority can only declare an integrity assertion for
itself. Methods to improve the security properties of representation itself. Methods to improve the security properties of representation
digests are presented in Section 11. This contrast is interesting digests are presented in Section 12. This contrast is interesting
because on one hand self-assertion is less likely to be affected by because on one hand self-assertion is less likely to be affected by
coordination problems such as the first-party holding stale coordination problems such as the first-party holding stale
information about the third party, but on the other hand the self- information about the third party, but on the other hand the self-
assertion is only as trustworthy as the authority that provided it. assertion is only as trustworthy as the authority that provided it.
The SRI "integrity" attribute contains a cryptographic hash algorithm The SRI "integrity" attribute contains a cryptographic hash algorithm
and digest value which is similar to "representation-data-digest" and digest value which is similar to "representation-data-digest"
(see Section 2). The major differences are in serialization format. (see Section 2). The major differences are in serialization format.
The SRI digest value is calculated over the identity encoding of the The SRI digest value is calculated over the identity encoding of the
skipping to change at page 12, line 25 skipping to change at page 12, line 36
[SRI] describes the benefit of the identity approach - the SRI [SRI] describes the benefit of the identity approach - the SRI
"integrity" attribute can contain multiple algorithm-value pairs "integrity" attribute can contain multiple algorithm-value pairs
where each applies to a different identity encoded payload. This where each applies to a different identity encoded payload. This
allows for protection of distinct resources sharing a URL. However, allows for protection of distinct resources sharing a URL. However,
this is a contrast to the design of representation digests, where this is a contrast to the design of representation digests, where
multiple "Digest" field-values all protect the same representation. multiple "Digest" field-values all protect the same representation.
SRI does not specify handling of partial representation data (e.g. SRI does not specify handling of partial representation data (e.g.
Range requests). In contrast, this document specifies handling in Range requests). In contrast, this document specifies handling in
terms that are fully compatible with core HTTP concepts (an example terms that are fully compatible with core HTTP concepts (an example
is provided in Section 9.3). is provided in Section 10.3).
SRI specifies strong requirements on the selection of algorithm for SRI specifies strong requirements on the selection of algorithm for
generation and validation of digests. In contrast, the requirements generation and validation of digests. In contrast, the requirements
in this document are weaker. in this document are weaker.
SRI defines no method for a client to declare an integrity assertion SRI defines no method for a client to declare an integrity assertion
on resources it transfers to a server. In contrast, the "Digest" on resources it transfers to a server. In contrast, the "Digest"
field can appear on requests. field can appear on requests.
8.1. Supporting Both SRI and Representation Digest 9.1. Supporting Both SRI and Representation Digest
The SRI and Representation Digest mechanisms are different and The SRI and Representation Digest mechanisms are different and
complementary but one is not capable of replacing the other because complementary but one is not capable of replacing the other because
they have different threat, security and implementation properties. they have different threat, security and implementation properties.
A user agent that supports both mechanisms is expected to apply the A user agent that supports both mechanisms is expected to apply the
rules specified for each but since the two mechanisms are rules specified for each but since the two mechanisms are
independent, the ordering is not important. However, a user agent independent, the ordering is not important. However, a user agent
supporting both could benefit from performing representation digest supporting both could benefit from performing representation digest
validation first because it does not always require a conversion into validation first because it does not always require a conversion into
identity encoding. identity encoding.
There is a chance that a user agent supporting both mechanisms may There is a chance that a user agent supporting both mechanisms may
find one validates successfully while the other fails. This document find one validates successfully while the other fails. This document
specifies no requirements or guidance for user agents that experience specifies no requirements or guidance for user agents that experience
such cases. such cases.
9. Examples of Unsolicited Digest 10. Examples of Unsolicited Digest
The following examples demonstrate interactions where a server The following examples demonstrate interactions where a server
responds with a "Digest" field even though the client did not solicit responds with a "Digest" field even though the client did not solicit
one using "Want-Digest". one using "Want-Digest".
9.1. Server Returns Full Representation Data 10.1. Server Returns Full Representation Data
Request: Request:
GET /items/123 GET /items/123
Response: Response:
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
{"hello": "world"} {"hello": "world"}
9.2. Server Returns No Representation Data 10.2. Server Returns No Representation Data
Requests without a payload body can still send a "Digest" field Requests without a payload body can still send a "Digest" field
applying the digest-algorithm to an empty representation. applying the digest-algorithm to an empty representation.
As there is no content coding applied, the "sha-256" and the "id-sha- As there is no content coding applied, the "sha-256" and the "id-sha-
256" digest-values in the response are the same. 256" digest-values in the response are the same.
Request: Request:
HEAD /items/123 HTTP/1.1 HEAD /items/123 HTTP/1.1
Digest: sha-256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= Digest: sha-256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
Response: Response:
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
Digest: id-sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= Digest: id-sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
9.3. Server Returns Partial Representation Data 10.3. Server Returns Partial Representation Data
Request: Request:
GET /items/123 GET /items/123
Range: bytes=1-7 Range: bytes=1-7
Response: Response:
HTTP/1.1 206 Partial Content HTTP/1.1 206 Partial Content
Content-Type: application/json Content-Type: application/json
Content-Range: bytes 1-7/18 Content-Range: bytes 1-7/18
Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
"hello" "hello"
9.4. Client and Server Provide Full Representation Data 10.4. Client and Server Provide Full Representation Data
The request contains a "Digest" field calculated on the enclosed The request contains a "Digest" field calculated on the enclosed
representation. representation.
It also includes an "Accept-Encoding: br" header field that It also includes an "Accept-Encoding: br" header field that
advertises the client supports brotli encoding. advertises the client supports brotli encoding.
The response includes a "Content-Encoding: br" that indicates the The response includes a "Content-Encoding: br" that indicates the
selected representation is brotli encoded. The "Digest" field-value selected representation is brotli encoded. The "Digest" field-value
is therefore different compared to the request. is therefore different compared to the request.
skipping to change at page 15, line 5 skipping to change at page 15, line 11
{"hello": "world"} {"hello": "world"}
Response: Response:
Content-Type: application/json Content-Type: application/json
Content-Encoding: br Content-Encoding: br
Digest: sha-256=4REjxQ4yrqUVicfSKYNO/cF9zNj5ANbzgDZt3/h3Qxo= Digest: sha-256=4REjxQ4yrqUVicfSKYNO/cF9zNj5ANbzgDZt3/h3Qxo=
iwiAeyJoZWxsbyI6ICJ3b3JsZCJ9Aw== iwiAeyJoZWxsbyI6ICJ3b3JsZCJ9Aw==
9.5. Client Provides Full Representation Data, Server Provides No 10.5. Client Provides Full Representation Data, Server Provides No
Representation Data Representation Data
Request "Digest" value is calculated on the enclosed payload. Request "Digest" value is calculated on the enclosed payload.
Response "Digest" value depends on the representation metadata header Response "Digest" value depends on the representation metadata header
fields, including "Content-Encoding: br" even when the response does fields, including "Content-Encoding: br" even when the response does
not contain a payload body. not contain a payload body.
Request: Request:
PUT /items/123 PUT /items/123
Content-Type: application/json Content-Type: application/json
skipping to change at page 15, line 30 skipping to change at page 15, line 36
{"hello": "world"} {"hello": "world"}
Response: Response:
HTTP/1.1 204 No Content HTTP/1.1 204 No Content
Content-Type: application/json Content-Type: application/json
Content-Encoding: br Content-Encoding: br
Digest: sha-256=4REjxQ4yrqUVicfSKYNO/cF9zNj5ANbzgDZt3/h3Qxo= Digest: sha-256=4REjxQ4yrqUVicfSKYNO/cF9zNj5ANbzgDZt3/h3Qxo=
9.6. Client and Server Provide Full Representation Data, Client Uses 10.6. Client and Server Provide Full Representation Data, Client Uses
id-sha-256. id-sha-256.
The response contains two digest values: The response contains two digest values:
o one with no content coding applied, which in this case * one with no content coding applied, which in this case
accidentally matches the unencoded digest-value sent in the accidentally matches the unencoded digest-value sent in the
request; request;
o one taking into account the "Content-Encoding". * one taking into account the "Content-Encoding".
As the response body contains non-printable characters, it is As the response body contains non-printable characters, it is
displayed as a base64-encoded string. displayed as a base64-encoded string.
Request: Request:
PUT /items/123 HTTP/1.1 PUT /items/123 HTTP/1.1
Content-Type: application/json Content-Type: application/json
Accept-Encoding: br Accept-Encoding: br
Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
skipping to change at page 16, line 14 skipping to change at page 16, line 22
Response: Response:
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
Content-Encoding: br Content-Encoding: br
Digest: sha-256=4REjxQ4yrqUVicfSKYNO/cF9zNj5ANbzgDZt3/h3Qxo=, Digest: sha-256=4REjxQ4yrqUVicfSKYNO/cF9zNj5ANbzgDZt3/h3Qxo=,
id-sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= id-sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
iwiAeyJoZWxsbyI6ICJ3b3JsZCJ9Aw== iwiAeyJoZWxsbyI6ICJ3b3JsZCJ9Aw==
9.7. POST Response does not Reference the Request URI 10.7. POST Response does not Reference the Request URI
Request "Digest" value is computed on the enclosed representation Request "Digest" value is computed on the enclosed representation
(see Section 6). (see Section 6).
The representation enclosed in the response refers to the resource The representation enclosed in the response refers to the resource
identified by "Content-Location" (see [SEMANTICS], Section 7.3.2). identified by "Content-Location" (see [SEMANTICS], Section 5.5.2).
"Digest" is thus computed on the enclosed representation. "Digest" is thus computed on the enclosed representation.
Request: Request:
POST /books HTTP/1.1 POST /books HTTP/1.1
Content-Type: application/json Content-Type: application/json
Accept: application/json Accept: application/json
Accept-Encoding: identity Accept-Encoding: identity
Digest: sha-256=bWopGGNiZtbVgHsG+I4knzfEJpmmmQHf7RHDXA3o1hQ= Digest: sha-256=bWopGGNiZtbVgHsG+I4knzfEJpmmmQHf7RHDXA3o1hQ=
skipping to change at page 16, line 46 skipping to change at page 17, line 5
HTTP/1.1 201 Created HTTP/1.1 201 Created
Content-Type: application/json Content-Type: application/json
Digest: id-sha-256=BZlF2v0IzjuxN01RQ97EUXriaNNLhtI8Chx8Eq+XYSc= Digest: id-sha-256=BZlF2v0IzjuxN01RQ97EUXriaNNLhtI8Chx8Eq+XYSc=
Content-Location: /books/123 Content-Location: /books/123
{"id": "123", "title": "New Title"} {"id": "123", "title": "New Title"}
Note that a "204 No Content" response without a payload body but with Note that a "204 No Content" response without a payload body but with
the same "Digest" field-value would have been legitimate too. the same "Digest" field-value would have been legitimate too.
9.8. POST Response Describes the Request Status 10.8. POST Response Describes the Request Status
Request "Digest" value is computed on the enclosed representation Request "Digest" value is computed on the enclosed representation
(see Section 6). (see Section 6).
The representation enclosed in the response describes the status of The representation enclosed in the response describes the status of
the request, so "Digest" is computed on that enclosed representation. the request, so "Digest" is computed on that enclosed representation.
Response "Digest" has no explicit relation with the resource Response "Digest" has no explicit relation with the resource
referenced by "Location". referenced by "Location".
skipping to change at page 17, line 36 skipping to change at page 17, line 41
Digest: id-sha-256=0o/WKwSfnmIoSlop2LV/ISaBDth05IeW27zzNMUh5l8= Digest: id-sha-256=0o/WKwSfnmIoSlop2LV/ISaBDth05IeW27zzNMUh5l8=
Location: /books/123 Location: /books/123
{ {
"status": "created", "status": "created",
"id": "123", "id": "123",
"ts": 1569327729, "ts": 1569327729,
"instance": "/books/123" "instance": "/books/123"
} }
9.9. Digest with PATCH 10.9. Digest with PATCH
This case is analogous to a POST request where the target resource This case is analogous to a POST request where the target resource
reflects the effective request URI. reflects the effective request URI.
The PATCH request uses the "application/merge-patch+json" media type The PATCH request uses the "application/merge-patch+json" media type
defined in [RFC7396]. defined in [RFC7396].
"Digest" is calculated on the enclosed payload, which corresponds to "Digest" is calculated on the enclosed payload, which corresponds to
the patch document. the patch document.
skipping to change at page 18, line 24 skipping to change at page 18, line 29
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
Digest: id-sha-256=BZlF2v0IzjuxN01RQ97EUXriaNNLhtI8Chx8Eq+XYSc= Digest: id-sha-256=BZlF2v0IzjuxN01RQ97EUXriaNNLhtI8Chx8Eq+XYSc=
{"id": "123", "title": "New Title"} {"id": "123", "title": "New Title"}
Note that a "204 No Content" response without a payload body but with Note that a "204 No Content" response without a payload body but with
the same "Digest" field-value would have been legitimate too. the same "Digest" field-value would have been legitimate too.
9.10. Error responses 10.10. Error responses
In error responses, the representation-data does not necessarily In error responses, the representation-data does not necessarily
refer to the target resource. Instead it refers to the refer to the target resource. Instead it refers to the
representation of the error. representation of the error.
In the following example a client attempts to patch the resource In the following example a client attempts to patch the resource
located at /books/123. However, the resource does not exist and the located at /books/123. However, the resource does not exist and the
server generates a 404 response with a body that describes the error server generates a 404 response with a body that describes the error
in accordance with [RFC7807]. in accordance with [RFC7807].
skipping to change at page 19, line 15 skipping to change at page 19, line 16
HTTP/1.1 404 Not Found HTTP/1.1 404 Not Found
Content-Type: application/problem+json Content-Type: application/problem+json
Digest: sha-256=UJSojgEzqUe4UoHzmNl5d2xkmrW3BOdmvsvWu1uFeu0= Digest: sha-256=UJSojgEzqUe4UoHzmNl5d2xkmrW3BOdmvsvWu1uFeu0=
{ {
"title": "Not Found", "title": "Not Found",
"detail": "Cannot PATCH a non-existent resource", "detail": "Cannot PATCH a non-existent resource",
"status": 404 "status": 404
} }
9.11. Use with trailers and transfer coding 10.11. Use with trailers and transfer coding
An origin server sends "Digest" in the HTTP trailer, so it can An origin server sends "Digest" in the HTTP trailer, so it can
calculate digest-value while streaming content and thus mitigate calculate digest-value while streaming content and thus mitigate
resource consumption. The field value is the same as in Section 9.1 resource consumption. The field value is the same as in Section 10.1
because "Digest" is designed to be independent from the use of one or because "Digest" is designed to be independent from the use of one or
more transfer codings (see Section 2). more transfer codings (see Section 2).
Request: Request:
GET /items/123 GET /items/123
Response: Response:
HTTP/1.1 200 OK HTTP/1.1 200 OK
skipping to change at page 19, line 43 skipping to change at page 19, line 44
8\r\n 8\r\n
{"hello"\r\n {"hello"\r\n
8 8
: "world\r\n : "world\r\n
2\r\n 2\r\n
"}\r\n "}\r\n
0\r\n 0\r\n
Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
10. Examples of Want-Digest Solicited Digest 11. Examples of Want-Digest Solicited Digest
The following examples demonstrate interactions where a client The following examples demonstrate interactions where a client
solicits a "Digest" using "Want-Digest". solicits a "Digest" using "Want-Digest".
10.1. Server Selects Client's Least Preferred Algorithm 11.1. Server Selects Client's Least Preferred Algorithm
The client requests a digest, preferring "sha". The server is free The client requests a digest, preferring "sha". The server is free
to reply with "sha-256" anyway. to reply with "sha-256" anyway.
Request: Request:
GET /items/123 HTTP/1.1 GET /items/123 HTTP/1.1
Want-Digest: sha-256;q=0.3, sha;q=1 Want-Digest: sha-256;q=0.3, sha;q=1
Response: Response:
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
{"hello": "world"} {"hello": "world"}
10.2. Server Selects Algorithm Unsupported by Client 11.2. Server Selects Algorithm Unsupported by Client
The client requests a sha digest only. The server is currently free The client requests a sha digest only. The server is currently free
to reply with a Digest containing an unsupported algorithm. to reply with a Digest containing an unsupported algorithm.
Request: Request:
GET /items/123 GET /items/123
Want-Digest: sha;q=1 Want-Digest: sha;q=1
Response: Response:
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/json Content-Type: application/json
Digest: id-sha-512=WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+TaPm Digest: id-sha-512=WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+TaPm
+AbwAgBWnrIiYllu7BNNyealdVLvRwE\nmTHWXvJwew== +AbwAgBWnrIiYllu7BNNyealdVLvRwE\nmTHWXvJwew==
{"hello": "world"} {"hello": "world"}
10.3. Server Does Not Support Client Algorithm and Returns an Error 11.3. Server Does Not Support Client Algorithm and Returns an Error
The client requests a sha Digest, the server advises for sha-256 and The client requests a sha Digest, the server advises for sha-256 and
sha-512 sha-512
Request: Request:
GET /items/123 GET /items/123
Want-Digest: sha;q=1 Want-Digest: sha;q=1
Response: Response:
HTTP/1.1 400 Bad Request HTTP/1.1 400 Bad Request
Want-Digest: sha-256, sha-512 Want-Digest: sha-256, sha-512
11. Security Considerations 12. Security Considerations
11.1. Digest Does Not Protect the Full HTTP Message 12.1. Digest Does Not Protect the Full HTTP Message
This document specifies a data integrity mechanism that protects HTTP This document specifies a data integrity mechanism that protects HTTP
"representation data", but not HTTP "representation metadata" fields, "representation data", but not HTTP "representation metadata" fields,
from certain kinds of accidental corruption. from certain kinds of accidental corruption.
"Digest" is not intended as general protection against malicious "Digest" is not intended as general protection against malicious
tampering with HTTP messages, this can be achieved by combining it tampering with HTTP messages, this can be achieved by combining it
with other approaches such as transport-layer security or digital with other approaches such as transport-layer security or digital
signatures. signatures.
11.2. Broken Cryptographic Algorithms 12.2. Broken Cryptographic Algorithms
Cryptographic algorithms are intended to provide a proof of integrity Cryptographic algorithms are intended to provide a proof of integrity
suited towards cryptographic constructions such as signatures. suited towards cryptographic constructions such as signatures.
However, these rely on collision-resistance for their security proofs However, these rely on collision-resistance for their security proofs
[CMU-836068]. The "MD5" and "SHA-1" digest algorithms are vulnerable [CMU-836068]. The "md5" and "sha" digest-algorithms are vulnerable
to collisions attacks, so they MUST NOT be used with "Digest". to collisions attacks, so they MUST NOT be used with "Digest".
11.3. Other Deprecated Algorithms 12.3. Other Deprecated Algorithms
The ADLER32 algorithm defined in [RFC1950] has been deprecated by The ADLER32 algorithm defined in [RFC1950] has been deprecated by
[RFC3309] because under certain conditions it provides weak detection [RFC3309] because under certain conditions it provides weak detection
of errors and is now NOT RECOMMENDED for use with "Digest". of errors and is now NOT RECOMMENDED for use with "Digest".
11.4. Digest for End-to-End Integrity 12.4. Digest for End-to-End Integrity
"Digest" alone does not provide end-to-end integrity of HTTP messages "Digest" alone does not provide end-to-end integrity of HTTP messages
over multiple hops, as it just covers the "representation data" and over multiple hops, as it just covers the "representation data" and
not the "representation metadata". not the "representation metadata".
Besides, it allows to protect "representation data" from buggy Besides, it allows to protect "representation data" from buggy
manipulation, buggy compression, etc. manipulation, buggy compression, etc.
Moreover identity digest algorithms (eg. "id-sha-256" and "id-sha- Moreover identity digest-algorithms (eg. "id-sha-256" and "id-sha-
512") allow piecing together a resource from different sources (e.g. 512") allow piecing together a resource from different sources (e.g.
different servers that perhaps apply different content codings) different servers that perhaps apply different content codings)
enabling the user-agent to detect that the application-layer tasks enabling the user-agent to detect that the application-layer tasks
completed properly, before handing off to say the HTML parser, video completed properly, before handing off to say the HTML parser, video
player etc. player etc.
Even a simple mechanism for end-to-end validation is thus valuable. Even a simple mechanism for end-to-end validation is thus valuable.
11.5. Digest and Content-Location in responses 12.5. Digest and Content-Location in responses
When a state-changing method returns the "Content-Location" header When a state-changing method returns the "Content-Location" header
field, the enclosed representation refers to the resource identified field, the enclosed representation refers to the resource identified
by its value and "Digest" is computed accordingly. by its value and "Digest" is computed accordingly.
11.6. Usage in signatures 12.6. Usage in signatures
Digital signatures are widely used together with checksums to provide Digital signatures are widely used together with checksums to provide
the certain identification of the origin of a message [NIST800-32]. the certain identification of the origin of a message [NIST800-32].
Such signatures can protect one or more HTTP fields and there are Such signatures can protect one or more HTTP fields and there are
additional considerations when "Digest" is included in this set. additional considerations when "Digest" is included in this set.
Since the "Digest" field is a hash of a resource representation, it Since the "Digest" field is a hash of a resource representation, it
explicitly depends on the "representation metadata" (eg. the values explicitly depends on the "representation metadata" (eg. the values
of "Content-Type", "Content-Encoding" etc). A signature that of "Content-Type", "Content-Encoding" etc). A signature that
protects "Digest" but not other "representation metadata" can expose protects "Digest" but not other "representation metadata" can expose
the communication to tampering. For example, an actor could the communication to tampering. For example, an actor could
manipulate the "Content-Type" field-value and cause a digest manipulate the "Content-Type" field-value and cause a digest
validation failure at the recipient, preventing the application from validation failure at the recipient, preventing the application from
accessing the representation. Such an attack consumes the resources accessing the representation. Such an attack consumes the resources
of both endpoints. See also Section 11.5. of both endpoints. See also Section 12.5.
"Digest" SHOULD always be used over a connection which provides "Digest" SHOULD always be used over a connection which provides
integrity at the transport layer that protects HTTP fields. integrity at the transport layer that protects HTTP fields.
A "Digest" field using NOT RECOMMENDED digest-algorithms SHOULD NOT A "Digest" field using NOT RECOMMENDED digest-algorithms SHOULD NOT
be used in signatures. be used in signatures.
Using signatures to protect the "Digest" of an empty representation Using signatures to protect the "Digest" of an empty representation
allows receiving endpoints to detect if an eventual payload has been allows receiving endpoints to detect if an eventual payload has been
stripped or added. stripped or added.
11.7. Usage in trailers 12.7. Usage in trailers
When used in trailers, the receiver gets the digest value after the When used in trailers, the receiver gets the digest value after the
payload body and may thus be tempted to process the data before payload body and may thus be tempted to process the data before
validating the digest value. Instead, data should only be processed validating the digest value. Instead, data should only be processed
after validating the Digest. after validating the Digest.
If received in trailers, "Digest" MUST NOT be discarded; instead it If received in trailers, "Digest" MUST NOT be discarded; instead it
MAY be merged in the header section (See Section 5.6.2 of MAY be merged in the header section (See Section 5.6.2 of
[SEMANTICS]). [SEMANTICS]).
Not every digest-algorithm is suitable for trailers, as they may Not every digest-algorithm is suitable for trailers, as they may
require to pre-process the whole payload before sending a message require to pre-process the whole payload before sending a message
(eg. see [I-D.thomson-http-mice]). (eg. see [I-D.thomson-http-mice]).
11.8. Usage with encryption 12.8. Usage with encryption
"Digest" may expose information details of encrypted payload when the "Digest" may expose information details of encrypted payload when the
checksum is computed on the unencrypted data. An example of that is checksum is computed on the unencrypted data. An example of that is
the use of the "id-sha-256" digest algorithm in conjuction with the the use of the "id-sha-256" digest-algorithm in conjunction with the
encrypted content-coding [RFC8188]. encrypted content-coding [RFC8188].
11.9. Algorithm Agility The representation-data-digest of an encrypted payload can change
between different messages depending on the encryption algorithm
used; in those cases its value could not be used to provide a proof
of integrity "at rest" unless the whole (e.g. encoded) payload body
is persisted.
... 12.9. Algorithm Agility
12. IANA Considerations The security properties of digest-algorithms are not fixed.
Algorithm Agility (see [RFC7696]) is achieved by providing
implementations flexibility in their choice of digest-algorithm from
the IANA Digest Algorithm Values registry in Section 13.1.
12.1. Establish the HTTP Digest Algorithm Values To help endpoints understand weaker algorithms from stronger ones,
this document adds to the IANA Digest Algorithm Values registry a new
"Status" field containing the most-recent appraisal of the digest-
algorithm; the allowed values are specified in Section 13.2.
An endpoint might have a preference for algorithms, such as
preferring "standard" algorithms over "deprecated" ones. Transition
from weak algorithms is supported by negotiation of digest-algorithm
using "Want-Digest" (see Section 4) or by sending multiple
representation-data-digest values from which the receiver chooses.
Endpoints are advised that sending multiple values consumes
resources, which may be wasted if the receiver ignores them (see
Section 3).
13. IANA Considerations
13.1. Establish the HTTP Digest Algorithm Values
This memo sets this spec to be the establishing document for the HTTP This memo sets this spec to be the establishing document for the HTTP
Digest Algorithm Values [3] Digest Algorithm Values (https://www.iana.org/assignments/http-dig-
alg/http-dig-alg.xhtml)
12.2. The "status" Field in the HTTP Digest Algorithm Values 13.2. The "status" Field in the HTTP Digest Algorithm Values
This memo adds the field "Status" to the HTTP Digest Algorithm Values This memo adds the field "Status" to the HTTP Digest Algorithm Values
[4] registry. The allowed values for the "Status" fields are (https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml)
described below. registry. The allowed values for the "Status" fields are described
below.
Status Specify "standard", "experimental", "historic", "obsoleted", Status
or "deprecated" according to the type and status of the primary * "standard" for standardized algorithms without known problems;
document in which the algorithm is defined.
12.3. Deprecate "MD5" Digest Algorithm * "experimental", "obsoleted" or some other appropriate value -
e.g. according to the type and status of the primary document
in which the algorithm is defined;
* "deprecated" when the algorithm is insecure or otherwise
undesirable.
13.3. Deprecate "MD5" Digest Algorithm
This memo updates the "MD5" digest-algorithm in the HTTP Digest This memo updates the "MD5" digest-algorithm in the HTTP Digest
Algorithm Values [5] registry: Algorithm Values (https://www.iana.org/assignments/http-dig-alg/http-
dig-alg.xhtml) registry:
o Digest Algorithm: md5 * Digest Algorithm: md5
o Description: As specified in Section 5. * Description: As specified in Section 5.
o Status: As specified in Section 5. * Status: As specified in Section 5.
12.4. Update "UNIXsum" Digest Algorithm 13.4. Update "UNIXsum" Digest Algorithm
This memo updates the "UNIXsum" digest algorithm in the HTTP Digest This memo updates the "UNIXsum" digest-algorithm in the HTTP Digest
Algorithm Values [6] registry: Algorithm Values (https://www.iana.org/assignments/http-dig-alg/http-
dig-alg.xhtml) registry:
o Digest Algorithm: As specified in Section 5. * Digest Algorithm: As specified in Section 5.
o Description: As specified in Section 5. * Description: As specified in Section 5.
o Status: As specified in Section 5. * Status: As specified in Section 5.
12.5. Update "UNIXcksum" Digest Algorithm 13.5. Update "UNIXcksum" Digest Algorithm
This memo updates the "UNIXcksum" digest algorithm in the HTTP Digest This memo updates the "UNIXcksum" digest-algorithm in the HTTP Digest
Algorithm Values [7] registry: Algorithm Values (https://www.iana.org/assignments/http-dig-alg/http-
dig-alg.xhtml) registry:
o Digest Algorithm: As specified in Section 5. * Digest Algorithm: As specified in Section 5.
o Description: As specified in Section 5. * Description: As specified in Section 5.
o Status: As specified in Section 5. * Status: As specified in Section 5.
12.6. Update "CRC32c" Digest Algorithm 13.6. Update "CRC32c" Digest Algorithm
This memo updates the "CRC32c" digest-algorithm in the HTTP Digest This memo updates the "CRC32c" digest-algorithm in the HTTP Digest
Algorithm Values [8] registry: Algorithm Values (https://www.iana.org/assignments/http-dig-alg/http-
dig-alg.xhtml) registry:
o Digest Algorithm: crc32c * Digest Algorithm: crc32c
o Description: The CRC32c algorithm is a 32-bit cyclic redundancy * Description: The CRC32c algorithm is a 32-bit cyclic redundancy
check. It achieves a better hamming distance (for better error- check. It achieves a better hamming distance (for better error-
detection performance) than many other 32-bit CRC functions. detection performance) than many other 32-bit CRC functions.
Other places it is used include iSCSI and SCTP. The 32-bit output Other places it is used include iSCSI and SCTP. The 32-bit output
is encoded in hexadecimal (using between 1 and 8 ASCII characters is encoded in hexadecimal (using between 1 and 8 ASCII characters
from 0-9, A-F, and a-f; leading 0's are allowed). For example, from 0-9, A-F, and a-f; leading 0's are allowed). For example,
crc32c=0a72a4df and crc32c=A72A4DF are both valid checksums for crc32c=0a72a4df and crc32c=A72A4DF are both valid checksums for
the 3-byte message "dog". the 3-byte message "dog".
o Reference: [RFC4960] appendix B, this document. * Reference: [RFC4960] appendix B, this document.
o Status: standard. * Status: standard.
12.7. Obsolete "SHA" Digest Algorithm 13.7. Deprecate "SHA" Digest Algorithm
This memo updates the "SHA" digest-algorithm in the HTTP Digest This memo updates the "SHA" digest-algorithm in the HTTP Digest
Algorithm Values [9] registry: Algorithm Values (https://www.iana.org/assignments/http-dig-alg/http-
dig-alg.xhtml) registry:
o Digest Algorithm: sha * Digest Algorithm: sha
o Description: As specified in Section 5.
o Status: As specified in Section 5. * Description: As specified in Section 5.
12.8. Obsolete "ADLER32" Digest Algorithm * Status: As specified in Section 5.
13.8. Obsolete "ADLER32" Digest Algorithm
This memo updates the "ADLER32" digest-algorithm in the HTTP Digest This memo updates the "ADLER32" digest-algorithm in the HTTP Digest
Algorithm Values [10] registry: Algorithm Values (https://www.iana.org/assignments/http-dig-alg/http-
dig-alg.xhtml) registry:
o Digest Algorithm: adler32 * Digest Algorithm: adler32
o Description: The ADLER32 algorithm is a checksum specified in * Description: The ADLER32 algorithm is a checksum specified in
[RFC1950] "ZLIB Compressed Data Format". The 32-bit output is [RFC1950] "ZLIB Compressed Data Format". The 32-bit output is
encoded in hexadecimal (using between 1 and 8 ASCII characters encoded in hexadecimal (using between 1 and 8 ASCII characters
from 0-9, A-F, and a-f; leading 0's are allowed). For example, from 0-9, A-F, and a-f; leading 0's are allowed). For example,
adler32=03da0195 and adler32=3DA0195 are both valid checksums for adler32=03da0195 and adler32=3DA0195 are both valid checksums for
the 4-byte message "Wiki". This algorithm is obsoleted and SHOULD the 4-byte message "Wiki". This algorithm is obsoleted and SHOULD
NOT be used. NOT be used.
o Status: obsoleted * Status: obsoleted
12.9. Obsolete "contentMD5" token in Digest Algorithm 13.9. Obsolete "contentMD5" token in Digest Algorithm
This memo adds the "contentMD5" token in the HTTP Digest Algorithm This memo adds the "contentMD5" token in the HTTP Digest Algorithm
Values [11] registry: Values (https://www.iana.org/assignments/http-dig-alg/http-dig-
alg.xhtml) registry:
o Digest Algorithm: contentMD5 * Digest Algorithm: contentMD5
o Description: Section 5 of [RFC3230] defined the "contentMD5" token * Description: Section 5 of [RFC3230] defined the "contentMD5" token
to be used only in Want-Digest. This token is obsoleted and MUST to be used only in Want-Digest. This token is obsoleted and MUST
NOT be used. NOT be used.
o Reference: Section 12.9 of this document, Section 5 of [RFC3230]. * Reference: Section 13.9 of this document, Section 5 of [RFC3230].
o Status: obsoleted * Status: obsoleted
12.10. The "id-sha-256" Digest Algorithm 13.10. The "id-sha-256" Digest Algorithm
This memo registers the "id-sha-256" digest algorithm in the HTTP This memo registers the "id-sha-256" digest-algorithm in the HTTP
Digest Algorithm Values [12] registry: Digest Algorithm Values (https://www.iana.org/assignments/http-dig-
alg/http-dig-alg.xhtml) registry:
o Digest Algorithm: id-sha-256 * Digest Algorithm: id-sha-256
o Description: As specified in Section 5. * Description: As specified in Section 5.
o Status: As specified in Section 5. * Status: As specified in Section 5.
12.11. The "id-sha-512" Digest Algorithm 13.11. The "id-sha-512" Digest Algorithm
This memo registers the "id-sha-512" digest algorithm in the HTTP This memo registers the "id-sha-512" digest-algorithm in the HTTP
Digest Algorithm Values [13] registry: Digest Algorithm Values (https://www.iana.org/assignments/http-dig-
alg/http-dig-alg.xhtml) registry:
o Digest Algorithm: id-sha-512 * Digest Algorithm: id-sha-512
o Description: As specified in Section 5. * Description: As specified in Section 5.
o Status: As specified in Section 5. * Status: As specified in Section 5.
12.12. Changes compared to RFC5843 13.12. Changes compared to RFC5843
The digest-algorithm values for "MD5", "SHA", "SHA-256", "SHA-512", The digest-algorithm values for "MD5", "SHA", "SHA-256", "SHA-512",
"UNIXcksum", "UNIXsum", "ADLER32" and "CRC32c" have been updated to "UNIXcksum", "UNIXsum", "ADLER32" and "CRC32c" have been updated to
lowercase. lowercase.
The status of "MD5" has been updated to "deprecated", and its The status of "MD5" has been updated to "deprecated", and its
description states that this algorithm MUST NOT be used. description states that this algorithm MUST NOT be used.
The status of "SHA" has been updated to "deprecated", and its The status of "SHA" has been updated to "deprecated", and its
description states that this algorithm MUST NOT be used. description states that this algorithm MUST NOT be used.
The status for "CRC2c", "UNIXsum" and "UNIXcksum" has been updated to The status for "CRC2c", "UNIXsum" and "UNIXcksum" has been updated to
"standard". "standard".
The "id-sha-256" and "id-sha-512" algorithms have been added to the The "id-sha-256" and "id-sha-512" algorithms have been added to the
registry. registry.
12.13. Want-Digest Field Registration 13.13. Want-Digest Field Registration
This section registers the "Want-Digest" field in the "Hypertext This section registers the "Want-Digest" field in the "Hypertext
Transfer Protocol (HTTP) Field Name Registry" [SEMANTICS]. Transfer Protocol (HTTP) Field Name Registry" [SEMANTICS].
Field name: "Want-Digest" Field name: "Want-Digest"
Status: permanent Status: permanent
Specification document(s): Section 4 of this document Specification document(s): Section 4 of this document
12.14. Digest Header Field Registration 13.14. Digest Header Field Registration
This section registers the "Digest" field in the "Hypertext Transfer This section registers the "Digest" field in the "Hypertext Transfer
Protocol (HTTP) Field Name Registry" [SEMANTICS]. Protocol (HTTP) Field Name Registry" [SEMANTICS].
Field name: "Digest" Field name: "Digest"
Status: permanent Status: permanent
Specification document(s): Section 3 of this document Specification document(s): Section 3 of this document
13. References 14. References
13.1. Normative References 14.1. Normative References
[CMU-836068] [CMU-836068]
Carnagie Mellon University, Software Engineering Carnagie Mellon University, Software Engineering
Institute, "MD5 Vulnerable to collision attacks", December Institute, "MD5 Vulnerable to collision attacks", 31
2008, <https://www.kb.cert.org/vuls/id/836068/>. December 2008, <https://www.kb.cert.org/vuls/id/836068/>.
[IACR-2020-014] [IACR-2020-014]
Leurent, G. and T. Peyrin, "SHA-1 is a Shambles", January Leurent, G. and T. Peyrin, "SHA-1 is a Shambles", 5
2020, <https://eprint.iacr.org/2020/014.pdf>. January 2020, <https://eprint.iacr.org/2020/014.pdf>.
[NIST800-32] [NIST800-32]
National Institute of Standards and Technology, U.S. National Institute of Standards and Technology, U.S.
Department of Commerce, "Introduction to Public Key Department of Commerce, "Introduction to Public Key
Technology and the Federal PKI Infrastructure", February Technology and the Federal PKI Infrastructure", February
2001, <https://nvlpubs.nist.gov/nistpubs/Legacy/SP/ 2001, <https://nvlpubs.nist.gov/nistpubs/Legacy/SP/
nistspecialpublication800-32.pdf>. nistspecialpublication800-32.pdf>.
[RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, [RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321,
DOI 10.17487/RFC1321, April 1992, DOI 10.17487/RFC1321, April 1992,
skipping to change at page 28, line 37 skipping to change at page 29, line 24
[RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", [RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF",
RFC 7405, DOI 10.17487/RFC7405, December 2014, RFC 7405, DOI 10.17487/RFC7405, December 2014,
<https://www.rfc-editor.org/info/rfc7405>. <https://www.rfc-editor.org/info/rfc7405>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[SEMANTICS] [SEMANTICS]
Fielding, R., Nottingham, M., and J. Reschke, "HTTP Fielding, R., Nottingham, M., and J. Reschke, "HTTP
Semantics", draft-ietf-httpbis-semantics-11 (work in Semantics", Work in Progress, Internet-Draft, draft-ietf-
progress), August 2020. httpbis-semantics-12, 2 October 2020,
<http://www.ietf.org/internet-drafts/draft-ietf-httpbis-
semantics-12.txt>.
[UNIX] The Open Group, "The Single UNIX Specification, Version 2 [UNIX] The Open Group, "The Single UNIX Specification, Version 2
- 6 Vol Set for UNIX 98", February 1997. - 6 Vol Set for UNIX 98", February 1997.
13.2. Informative References 14.2. Informative References
[HTTP11] Fielding, R., Nottingham, M., and J. Reschke, "HTTP/1.1 [HTTP11] Fielding, R., Nottingham, M., and J. Reschke, "HTTP/1.1
Messaging", draft-ietf-httpbis-messaging-11 (work in Messaging", Work in Progress, Internet-Draft, draft-ietf-
progress), August 2020. httpbis-messaging-12, 2 October 2020,
<http://www.ietf.org/internet-drafts/draft-ietf-httpbis-
messaging-12.txt>.
[I-D.ietf-httpbis-header-structure] [I-D.ietf-httpbis-header-structure]
Nottingham, M. and P. Kamp, "Structured Field Values for Nottingham, M. and P. Kamp, "Structured Field Values for
HTTP", draft-ietf-httpbis-header-structure-19 (work in HTTP", Work in Progress, Internet-Draft, draft-ietf-
progress), June 2020. httpbis-header-structure-19, 3 June 2020,
<http://www.ietf.org/internet-drafts/draft-ietf-httpbis-
header-structure-19.txt>.
[I-D.thomson-http-mice] [I-D.thomson-http-mice]
Thomson, M. and J. Yasskin, "Merkle Integrity Content Thomson, M. and J. Yasskin, "Merkle Integrity Content
Encoding", draft-thomson-http-mice-03 (work in progress), Encoding", Work in Progress, Internet-Draft, draft-
August 2018. thomson-http-mice-03, 13 August 2018,
<http://www.ietf.org/internet-drafts/draft-thomson-http-
mice-03.txt>.
[RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818,
DOI 10.17487/RFC2818, May 2000, DOI 10.17487/RFC2818, May 2000,
<https://www.rfc-editor.org/info/rfc2818>. <https://www.rfc-editor.org/info/rfc2818>.
[RFC5789] Dusseault, L. and J. Snell, "PATCH Method for HTTP", [RFC5789] Dusseault, L. and J. Snell, "PATCH Method for HTTP",
RFC 5789, DOI 10.17487/RFC5789, March 2010, RFC 5789, DOI 10.17487/RFC5789, March 2010,
<https://www.rfc-editor.org/info/rfc5789>. <https://www.rfc-editor.org/info/rfc5789>.
[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Semantics and Content", RFC 7231, Protocol (HTTP/1.1): Semantics and Content", RFC 7231,
DOI 10.17487/RFC7231, June 2014, DOI 10.17487/RFC7231, June 2014,
<https://www.rfc-editor.org/info/rfc7231>. <https://www.rfc-editor.org/info/rfc7231>.
[RFC7396] Hoffman, P. and J. Snell, "JSON Merge Patch", RFC 7396, [RFC7396] Hoffman, P. and J. Snell, "JSON Merge Patch", RFC 7396,
DOI 10.17487/RFC7396, October 2014, DOI 10.17487/RFC7396, October 2014,
<https://www.rfc-editor.org/info/rfc7396>. <https://www.rfc-editor.org/info/rfc7396>.
[RFC7696] Housley, R., "Guidelines for Cryptographic Algorithm
Agility and Selecting Mandatory-to-Implement Algorithms",
BCP 201, RFC 7696, DOI 10.17487/RFC7696, November 2015,
<https://www.rfc-editor.org/info/rfc7696>.
[RFC7807] Nottingham, M. and E. Wilde, "Problem Details for HTTP [RFC7807] Nottingham, M. and E. Wilde, "Problem Details for HTTP
APIs", RFC 7807, DOI 10.17487/RFC7807, March 2016, APIs", RFC 7807, DOI 10.17487/RFC7807, March 2016,
<https://www.rfc-editor.org/info/rfc7807>. <https://www.rfc-editor.org/info/rfc7807>.
[RFC8188] Thomson, M., "Encrypted Content-Encoding for HTTP", [RFC8188] Thomson, M., "Encrypted Content-Encoding for HTTP",
RFC 8188, DOI 10.17487/RFC8188, June 2017, RFC 8188, DOI 10.17487/RFC8188, June 2017,
<https://www.rfc-editor.org/info/rfc8188>. <https://www.rfc-editor.org/info/rfc8188>.
[SRI] Akhawe, D., Braun, F., Marier, F., and J. Weinberger, [SRI] Akhawe, D., Braun, F., Marier, F., and J. Weinberger,
"Subresource Integrity", W3C Recommendation REC-SRI- "Subresource Integrity", W3C Recommendation REC-SRI-
20160623, June 2016, 20160623, 23 June 2016,
<https://www.w3.org/TR/2016/REC-SRI-20160623/>. <https://www.w3.org/TR/2016/REC-SRI-20160623/>.
13.3. URIs
[1] https://lists.w3.org/Archives/Public/ietf-http-wg/
[2] https://github.com/httpwg/http-extensions
[3] https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml
[4] https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml
[5] https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml
[6] https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml
[7] https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml
[8] https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml
[9] https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml
[10] https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml
[11] https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml
[12] https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml
[13] https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml
[14] https://github.com/httpwg/http-core/
issues/313#issuecomment-584389706
Appendix A. Resource Representation and Representation-Data Appendix A. Resource Representation and Representation-Data
The following examples show how representation metadata, payload The following examples show how representation metadata, payload
transformations and method impacts on the message and payload body. transformations and method impacts on the message and payload body.
When the payload body contains non-printable characters (eg. when it When the payload body contains non-printable characters (eg. when it
is compressed) it is shown as base64-encoded string. is compressed) it is shown as base64-encoded string.
A request with a json object without any content coding. A request with a json object without any content coding.
Request: Request:
skipping to change at page 33, line 24 skipping to change at page 33, line 38
This RFC updates [RFC5843] which is still delegated for all This RFC updates [RFC5843] which is still delegated for all
algorithms updates, and adds two more algorithms: "id-sha-256" algorithms updates, and adds two more algorithms: "id-sha-256"
and "id-sha-512" which allows to send a checksum of a resource and "id-sha-512" which allows to send a checksum of a resource
representation with no content codings applied. To simplify a representation with no content codings applied. To simplify a
future transition to Structured Fields future transition to Structured Fields
[I-D.ietf-httpbis-header-structure] we suggest to use lowercase [I-D.ietf-httpbis-header-structure] we suggest to use lowercase
for digest-algorithms. for digest-algorithms.
8. What about mid-stream trailers? 8. What about mid-stream trailers?
While mid-stream trailers [14] are interesting, since this While mid-stream trailers (https://github.com/httpwg/http-core/
issues/313#issuecomment-584389706) are interesting, since this
specification is a rewrite of [RFC3230] we do not think we should specification is a rewrite of [RFC3230] we do not think we should
face that. As a first thought, nothing in this document face that. As a first thought, nothing in this document
precludes future work that would find a use for mid-stream precludes future work that would find a use for mid-stream
trailers, for example an incremental digest-algorithm. A trailers, for example an incremental digest-algorithm. A
document defining such a digest-algorithm is best positioned to document defining such a digest-algorithm is best positioned to
describe how it is used. describe how it is used.
Acknowledgements Acknowledgements
The vast majority of this document is inherited from [RFC3230], so The vast majority of this document is inherited from [RFC3230], so
skipping to change at page 34, line 35 skipping to change at page 35, line 35
print("Encoding | digest-algorithm | digest-value") print("Encoding | digest-algorithm | digest-value")
print("Identity | sha512 |", digest(item, algorithm=hashlib.sha512)) print("Identity | sha512 |", digest(item, algorithm=hashlib.sha512))
# Encoding | digest-algorithm | digest-value # Encoding | digest-algorithm | digest-value
# Identity | sha512 | b'WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2s # Identity | sha512 | b'WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2s
vX+TaPm+AbwAgBWnrIiYllu7BNNyealdVLvRwE\nmTHWXvJwew==\n' vX+TaPm+AbwAgBWnrIiYllu7BNNyealdVLvRwE\nmTHWXvJwew==\n'
Changes Changes
_RFC Editor: Please remove this section before publication._ _RFC Editor: Please remove this section before publication._
E.1. Since draft-ietf-httpbis-digest-headers-00 Since draft-ietf-httpbis-digest-headers-03
o Align title with document name * Reference semantics-12
o Add id-sha-* algorithm examples #880 * Detail encryption quirks
o Reference [RFC6234] and [RFC3174] instead of FIPS-1 * Details on Algorithm agility #1250
o Deprecate MD5 * Obsolete parameters #850
o Obsolete ADLER-32 but don't forbid it #828 Since draft-ietf-httpbis-digest-headers-02
o Update CRC32C value in IANA table #828 * Deprecate SHA-1 #1154
o Use when acting on resources (POST, PATCH) #853 * Avoid id-* with encrypted content
o Added Relationship with SRI, draft Use Cases #868, #971 * Digest is independent from MESSAGING and HTTP/1.1 is not normative
#1215
o Warn about the implications of "Content-Location" * Identity is not a valid field value for content-encoding #1223
E.2. Since draft-ietf-httpbis-digest-headers-01 * Mention trailers #1157
o Digest of error responses is computed on the error representation- * Reference httpbis-semantics #1156
* Add contentMD5 as an obsoleted digest-algorithm #1249
* Use lowercase digest-algorithms names in the doc and in the
digest-algorithm IANA table.
Since draft-ietf-httpbis-digest-headers-01
* Digest of error responses is computed on the error representation-
data #1004 data #1004
o Effect of HTTP semantics on payload and message body moved to * Effect of HTTP semantics on payload and message body moved to
appendix #1122 appendix #1122
o Editorial refactoring, moving headers sections up. #1109-#1112, * Editorial refactoring, moving headers sections up. #1109-#1112,
#1116, #1117, #1122-#1124 #1116, #1117, #1122-#1124
E.3. Since draft-ietf-httpbis-digest-headers-02 Since draft-ietf-httpbis-digest-headers-00
o Deprecate SHA-1 #1154 * Align title with document name
o Avoid id-* with encrypted content * Add id-sha-* algorithm examples #880
o Digest is independent from MESSAGING and HTTP/1.1 is not normative * Reference [RFC6234] and [RFC3174] instead of FIPS-1
#1215
o Identity is not a valid field value for content-encoding #1223 * Deprecate MD5
o Mention trailers #1157 * Obsolete ADLER-32 but don't forbid it #828
o Reference httpbis-semantics #1156 * Update CRC32C value in IANA table #828
o Add contentMD5 as an obsoleted digest-algorithm #1249 * Use when acting on resources (POST, PATCH) #853
o Use lowercase digest-algorithms names in the doc and in the * Added Relationship with SRI, draft Use Cases #868, #971
digest-algorithm IANA table.
Authors' Addresses * Warn about the implications of "Content-Location"
Authors' Addresses
Roberto Polli Roberto Polli
Team Digitale, Italian Government Team Digitale, Italian Government
Email: robipolli@gmail.com Email: robipolli@gmail.com
Lucas Pardue Lucas Pardue
Cloudflare Cloudflare
Email: lucaspardue.24.7@gmail.com Email: lucaspardue.24.7@gmail.com
 End of changes. 157 change blocks. 
273 lines changed or deleted 324 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/