Digest Headers
Team Digitale, Italian Government
robipolli@gmail.com
Cloudflare
lucaspardue.24.7@gmail.com
Applications and Real-Time
HTTP
Digest
This document defines the HTTP Digest and Want-Digest fields, thus allowing
client and server to negotiate an integrity checksum of the exchanged resource
representation data.
This document obsoletes RFC 3230. It replaces the term "instance" with
"representation", which makes it consistent with the HTTP Semantic and Context
defined in draft-ietf-httpbis-semantics.
Note to Readers
RFC EDITOR: please remove this section before publication
Discussion of this draft takes place on the HTTP working group mailing list
(ietf-http-wg@w3.org), which is archived at
https://lists.w3.org/Archives/Public/ietf-http-wg/.
The source code and issues list for this draft can be found at
https://github.com/httpwg/http-extensions.
Introduction
The core specification of HTTP does not define a means to protect the integrity
of resources. When HTTP messages are transferred between endpoints, the protocol
might choose to make use of features of the lower layer in order to provide some
integrity protection; for instance TCP checksums or TLS records .
However, there are cases where relying on this alone is insufficient. An
HTTP-level integrity mechanism that operates independent of transfer can be used
to detect programming errors and/or corruption of data at rest, be used across
multiple hops in order to provide end-to-end integrity guarantees, aid fault
diagnosis across hops and system boundaries, and can be used to validate
integrity when reconstructing a resource fetched using different HTTP
connections.
This document defines a mechanism that acts on HTTP representation-data. It can
be combined with other mechanisms that protect representation-metadata, such as
digital signatures, in order to protect the desired parts of an HTTP exchange in
whole or in part.
A Brief History of HTTP Integrity Fields
The Content-MD5 header field was originally introduced to provide integrity, but
HTTP/1.1 (, Appendix B) obsoleted it:
- The Content-MD5 header field has been removed because it was
inconsistently implemented with respect to partial responses.
provided a more flexible solution introducing the concept of
"instance", and the fields Digest and Want-Digest.
This Proposal
The concept of selected representation defined in Section 7 of
makes definitions inconsistent with
current HTTP semantics. This document updates the Digest and Want-Digest
field definitions to align with concepts.
Basing Digest on the selected representation makes it straightforward to
apply it to use-cases where the transferred data does require some sort of
manipulation to be considered a representation, or conveys a partial
representation of a resource eg. Range Requests (see Section 13.2 of
).
Changes are semantically compatible with existing implementations and better
cover both the request and response cases.
The value of Digest is calculated on selected representation, which is tied to
the value contained in any Content-Encoding or Content-Type header fields.
Therefore, a given resource may have multiple different digest values.
To allow both parties to exchange a Digest of a representation with no content
codings (see Section 7.5.1 of ) two more digest-algorithms
are added ("id-sha-256" and "id-sha-512").
Goals
The goals of this proposal are:
- Digest coverage for either the resource's representation data or
selected representation data communicated via HTTP.
- Support for multiple digest-algorithms.
- Negotiation of the use of digests.
The goals do not include:
- HTTP message integrity:
-
The digest mechanism described here does not cover the full HTTP message
nor its semantic, as representation metadata are not included in the
checksum.
- HTTP field integrity:
-
The digest mechanisms described here cover only representation and selected
representation data, and do not protect the integrity of associated
representation metadata or other message fields.
- Authentication:
-
The digest mechanisms described here are not meant to support authentication
of the source of a digest or of a message or anything else. These mechanisms,
therefore, are not a sufficient defense against many kinds of malicious
attacks.
- Privacy:
-
Digest mechanisms do not provide message privacy.
- Authorization:
-
The digest mechanisms described here are not meant to support authorization
or other kinds of access controls.
Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in BCP 14 ( and )
when, and only when, they appear in all capitals, as shown here.
This document uses the Augmented BNF defined in and updated by
along with the "#rule" extension defined in Section 5.7.1 of
.
The definitions "representation", "selected representation", "representation
data", "representation metadata", and "payload body" in this document are to be
interpreted as described in .
Algorithm names respect the casing used in their definition document (eg. SHA-1, CRC32c)
whereas digest-algorithm tokens are quoted (eg. "sha", "crc32c").
Representation Digest
The representation digest is an integrity mechanism for HTTP resources
which uses a checksum that is calculated independently of the payload body
(see Section 5.5.4 of ).
It uses the representation data (see Section 7.2 of ),
that can be fully or partially contained in the payload body, or not contained at all:
This takes into account the effect of the HTTP semantics on the messages;
for example the payload body can be affected by Range Requests or methods such as HEAD,
while the way the payload body is transferred "on the wire" is dependent on other
transformations (eg. transfer codings for HTTP/1.1 see 6.1 of
):
contains several examples to help illustrate those effects.
A representation digest consists of
the value of a checksum computed on the entire selected representation data
(see Section 7 of ) of a resource identified according to Section 5.5.2 of
together with an indication of the algorithm used
]]>
The checksum is computed using one of the digest-algorithms listed in
and then encoded in the associated format.
The example below shows the "sha-256" digest-algorithm which uses base64 encoding.
The Digest Field
The Digest field contains a list of one or more representation digest values as
defined in . It can be used in both request and
response.
The relationship between Content-Location (see Section 7.8 of
) and Digest is demonstrated in
. A comprehensive set of examples showing the impacts of
representation metadata, payload transformations and HTTP methods on Digest is
provided in and .
A Digest field MAY contain multiple representation-data-digest values.
For example, a server may provide representation-data-digest 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 ).
A recipient MAY ignore any or all of the representation-data-digests in a Digest
field. This allows the recipient to choose which digest-algorithm(s) to use for
validation instead of verifying every received representation-data-digest.
A sender MAY send a representation-data-digest using a digest-algorithm without
knowing whether the recipient supports the digest-algorithm, or even knowing
that the recipient will ignore it.
Digest can be sent in a trailer section. When using incremental digest-algorithms
this allows the sender and the receiver to dynamically compute the digest value
while streaming the content.
Two examples of its use are
The Want-Digest Field
The Want-Digest field indicates the sender's desire to receive a representation
digest on messages associated with the request URI and representation metadata.
If a digest-algorithm is not accompanied by a "qvalue", it is treated as if its
associated "qvalue" were 1.0.
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 non-zero.
If multiple acceptable digest-algorithm values are given, the sender's preferred
digest-algorithm is the one (or ones) with the highest "qvalue".
Two examples of its use are
Digest Algorithm Values
Digest-algorithm values are used to indicate a specific digest computation.
All digest-algorithm values are case-insensitive
but the lower case is preferred.
The Internet Assigned Numbers Authority (IANA) acts as a registry for
digest-algorithm values.
The registry contains the tokens listed below.
Some digest-algorithms, although registered, rely on vulnerable algorithms:
the "md5" digest-algorithm MUST NOT be used due to collision attacks
and the "sha" digest-algorithm MUST NOT be used due
to collision attacks .
- sha-256
-
- Description: The SHA-256 algorithm . The output of
this algorithm is encoded using the base64 encoding .
- Reference: , , this document.
- Status: standard
- sha-512
-
- Description: The SHA-512 algorithm . The output of
this algorithm is encoded using the base64 encoding .
- Reference: , , this document.
- Status: standard
- md5
-
- Description: The MD5 algorithm, as specified in .
The output of this algorithm is encoded using the
base64 encoding .
This digest-algorithm MUST NOT be used as it's now vulnerable
to collision attacks .
- Reference: , , this document.
- Status: deprecated
- sha
-
- Description: The SHA-1 algorithm . The output of this
algorithm is encoded using the base64 encoding .
This digest-algorithm MUST NOT be used as it's now vulnerable
to collision attacks .
- Reference: , , , this document.
- Status: deprecated
- unixsum
-
- Description: The algorithm computed by the UNIX "sum" command,
as defined by the Single UNIX Specification,
Version 2 . The output of this algorithm is an
ASCII decimal-digit string representing the 16-bit
checksum, which is the first word of the output of
the UNIX "sum" command.
- Reference: , this document.
- Status: standard
- unixcksum
-
- Description: The algorithm computed by the UNIX "cksum" command,
as defined by the Single UNIX Specification,
Version 2 . The output of this algorithm is an
ASCII digit string representing the 32-bit CRC,
which is the first word of the output of the UNIX
"cksum" command.
- Reference: , this document.
- Status: standard
To allow sender and recipient to provide a checksum which is independent from
Content-Encoding, the following additional digest-algorithms are defined:
- id-sha-512
-
- Description: The sha-512 digest of the representation-data of the resource when no
content coding is applied
- Reference: , , this document.
- Status: standard
- id-sha-256
-
- Description: The sha-256 digest of the representation-data of the resource when no
content coding is applied
- Reference: , , this document.
- Status: standard
If other digest-algorithm values are defined, the associated encoding MUST
either be represented as a quoted string, or MUST NOT include ";" or "," in the
character sets used for the encoding.
Use of Digest when acting on resources
POST and PATCH requests can appear to convey partial representations but are
semantically acting on resources. The enclosed representation, including its
metadata refers to that action.
In these requests the representation digest MUST be computed on the
representation-data of that action.
This is the only possible choice because representation digest requires complete
representation metadata (see ).
In responses,
- if the representation describes the status of the request,
Digest MUST be computed on the enclosed representation
(see );
- if there is a referenced resource
Digest MUST be computed on the selected representation of the referenced resource
even if that is different from the target resource.
That might or might not result in computing Digest on the enclosed representation.
The latter case might be done according to the HTTP semantics of the given
method, for example using the Content-Location header field.
In contrast, the Location header field does not affect Digest because
it is not representation metadata.
Digest and PATCH
In PATCH requests the representation digest MUST be computed on the patch document
because the representation metadata refers to the patch document and not
to the target resource (see Section 2 of ).
In PATCH responses the representation digest MUST be computed on the selected
representation of the patched resource.
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 the patch document.
Deprecate Negotiation of Content-MD5
This RFC deprecates the negotiation of Content-MD5 as it has been obsoleted by
.
The contentMD5 token defined in Section 5 of MUST NOT be used as a digest-algorithm.
Obsolete Digest Header Field Parameters
This document obsoletes the usage of parameters with Digest introduced in
Section 4.1.1 and 4.2 of 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.
Relationship to Subresource Integrity (SRI)
Subresource Integrity is an integrity mechanism that shares some
similarities to the present document's mechanism. However, there are differences
in motivating factors, threat model and specification of integrity digest
generation, signalling and validation.
SRI allows a first-party authority to declare an integrity assertion 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 link HTML elements.
Therefore, the integrity assertion is always made out-of-band to the resource
fetch. In contrast, the Digest field is supplied in-band alongside the
selected representation, meaning that an authority can only declare an integrity
assertion for itself. Methods to improve the security properties of
representation digests are presented in . This
contrast is interesting because on one hand self-assertion is less likely to be
affected by coordination problems such as the first-party holding stale
information about the third party, but on the other hand the self-assertion is
only as trustworthy as the authority that provided it.
The SRI integrity attribute contains a cryptographic hash algorithm and digest
value which is similar to representation-data-digest (see
). The major differences are in serialization format.
The SRI digest value is calculated over the identity encoding of the resource,
not the selected representation (as specified for representation-data-digest
in this document). Section 3.4.5 of describes the benefit of the identity
approach - the SRI integrity attribute can contain multiple algorithm-value
pairs where each applies to a different identity encoded payload. This allows
for protection of distinct resources sharing a URL. However, this is a contrast
to the design of representation digests, where multiple Digest field-values
all protect the same representation.
SRI does not specify handling of partial representation data (e.g. Range
requests). In contrast, this document specifies handling in terms that are fully
compatible with core HTTP concepts (an example is provided in
).
SRI specifies strong requirements on the selection of algorithm for generation
and validation of digests. In contrast, the requirements in this document are
weaker.
SRI defines no method for a client to declare an integrity assertion on
resources it transfers to a server. In contrast, the Digest field can
appear on requests.
Supporting Both SRI and Representation Digest
The SRI and Representation Digest mechanisms are different and complementary but
one is not capable of replacing the other because they have different
threat, security and implementation properties.
A user agent that supports both mechanisms is expected to apply the rules
specified for each but since the two mechanisms are independent, the ordering is
not important. However, a user agent supporting both could benefit from
performing representation digest validation first because it does not always
require a conversion into identity encoding.
There is a chance that a user agent supporting both mechanisms may find one
validates successfully while the other fails. This document specifies no
requirements or guidance for user agents that experience such cases.
Examples of Unsolicited Digest
The following examples demonstrate interactions where a server responds with a
Digest field even though the client did not solicit one using
Want-Digest.
Server Returns Full Representation Data
Request:
Response:
Server Returns No Representation Data
Requests without a payload body can still send a Digest field
applying the digest-algorithm to an empty representation.
As there is no content coding applied, the "sha-256" and the "id-sha-256"
digest-values in the response are the same.
Request:
Response:
Server Returns Partial Representation Data
Request:
Response:
Client and Server Provide Full Representation Data
The request contains a Digest field calculated on the enclosed
representation.
It also includes an Accept-Encoding: br header field that advertises the
client supports brotli encoding.
The response includes a Content-Encoding: br that indicates the selected
representation is brotli encoded. The Digest field-value is therefore
different compared to the request.
The response body is displayed as a base64-encoded string because it contains
non-printable characters.
Request:
Response:
Client Provides Full Representation Data, Server Provides No Representation Data
Request Digest value is calculated on the enclosed payload. Response Digest
value depends on the representation metadata header fields, including
Content-Encoding: br even when the response does not contain a payload body.
Request:
Response:
Client and Server Provide Full Representation Data, Client Uses id-sha-256.
The response contains two digest values:
- one with no content coding applied, which in this case accidentally
matches the unencoded digest-value sent in the request;
- one taking into account the Content-Encoding.
As the response body contains non-printable characters, it is displayed as a
base64-encoded string.
Request:
Response:
POST Response does not Reference the Request URI
Request Digest value is computed on the enclosed representation (see
).
The representation enclosed in the response refers to the resource identified by
Content-Location (see , Section 5.5.2).
Digest is thus computed on the enclosed representation.
Request:
Response
Note that a 204 No Content response without a payload body but with the same
Digest field-value would have been legitimate too.
POST Response Describes the Request Status
Request Digest value is computed on the enclosed representation (see
).
The representation enclosed in the response describes the status of the request,
so Digest is computed on that enclosed representation.
Response Digest has no explicit relation with the resource referenced by
Location.
Request:
Response
Digest with PATCH
This case is analogous to a POST request where the target resource reflects the
effective request URI.
The PATCH request uses the application/merge-patch+json media type defined in
.
Digest is calculated on the enclosed payload, which corresponds to the patch
document.
The response Digest is computed on the complete representation of the patched
resource.
Request:
Response:
Note that a 204 No Content response without a payload body but with the same
Digest field-value would have been legitimate too.
Error responses
In error responses, the representation-data does not necessarily refer to the
target resource. Instead it refers to the representation of the error.
In the following example a client attempts to patch the resource located at
/books/123. However, the resource does not exist and the server generates a 404
response with a body that describes the error in accordance with .
The digest of the response is computed on this enclosed representation.
Request:
Response:
Use with trailers and transfer coding
An origin server sends Digest in the HTTP trailer, so it can calculate digest-value
while streaming content and thus mitigate resource consumption.
The field value is the same as in because Digest is designed to
be independent from the use of one or more transfer codings (see ).
Request:
Response:
Examples of Want-Digest Solicited Digest
The following examples demonstrate interactions where a client solicits a
Digest using Want-Digest.
Server Selects Client's Least Preferred Algorithm
The client requests a digest, preferring "sha". The server is free to reply with
"sha-256" anyway.
Request:
Response:
Server Selects Algorithm Unsupported by Client
The client requests a sha digest only. The server is currently free to reply
with a Digest containing an unsupported algorithm.
Request:
Response:
Server Does Not Support Client Algorithm and Returns an Error
The client requests a sha Digest, the server advises for sha-256 and sha-512
Request:
Response:
Security Considerations
Digest Does Not Protect the Full HTTP Message
This document specifies a data integrity mechanism that protects HTTP
representation data, but not HTTP representation metadata fields, from
certain kinds of accidental corruption.
Digest is not intended as general protection against malicious tampering with
HTTP messages, this can be achieved by combining it with other approaches such
as transport-layer security or digital signatures.
Broken Cryptographic Algorithms
Cryptographic algorithms are intended to provide a proof of integrity suited
towards cryptographic constructions such as signatures.
However, these rely on collision-resistance for their security proofs
. The "md5" and "sha" digest-algorithms are vulnerable to collisions attacks,
so they MUST NOT be used with Digest.
Other Deprecated Algorithms
The ADLER32 algorithm defined in has been deprecated by
because under certain conditions it provides weak detection of errors and is now
NOT RECOMMENDED for use with Digest.
Digest for End-to-End Integrity
Digest alone does not provide end-to-end integrity of HTTP messages over
multiple hops, as it just covers the representation data and not the
representation metadata.
Besides, it allows to protect representation data from buggy manipulation,
buggy compression, etc.
Moreover identity digest-algorithms (eg. "id-sha-256" and "id-sha-512") allow
piecing together a resource from different sources (e.g. different servers that
perhaps apply different content codings) enabling the user-agent to detect that
the application-layer tasks completed properly, before handing off to say the
HTML parser, video player etc.
Even a simple mechanism for end-to-end validation is thus valuable.
Digest and Content-Location in responses
When a state-changing method returns the Content-Location header field, the
enclosed representation refers to the resource identified by its value and
Digest is computed accordingly.
Usage in signatures
Digital signatures are widely used together with checksums to provide the
certain identification of the origin of a message . Such signatures
can protect one or more HTTP fields and there are additional considerations when
Digest is included in this set.
Since the Digest field is a hash of a resource representation, it explicitly
depends on the representation metadata (eg. the values of Content-Type,
Content-Encoding etc). A signature that protects Digest but not other
representation metadata can expose the communication to tampering. For
example, an actor could manipulate the Content-Type field-value and cause a
digest validation failure at the recipient, preventing the application from
accessing the representation. Such an attack consumes the resources of both
endpoints. See also .
Digest SHOULD always be used over a connection which provides integrity at
the transport layer that protects HTTP fields.
A Digest field using NOT RECOMMENDED digest-algorithms SHOULD NOT be used in
signatures.
Using signatures to protect the Digest of an empty representation
allows receiving endpoints to detect if an eventual payload has been stripped or added.
Usage in trailers
When used in trailers, the receiver gets the digest value after the payload body
and may thus be tempted to process the data before validating the digest value.
Instead, data should only be processed after validating the Digest.
If received in trailers, Digest MUST NOT be discarded;
instead it MAY be merged in the header section (See Section 5.6.2 of ).
Not every digest-algorithm is suitable for trailers, as they may require to pre-process
the whole payload before sending a message (eg. see ).
Usage with encryption
Digest may expose information details of encrypted payload when the checksum
is computed on the unencrypted data.
An example of that is the use of the "id-sha-256" digest-algorithm
in conjunction with the encrypted content-coding .
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.
Algorithm Agility
The security properties of digest-algorithms are not fixed.
Algorithm Agility (see ) is achieved by providing implementations flexibility
in their choice of digest-algorithm from the IANA Digest Algorithm Values registry in
.
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 .
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 )
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 ).
IANA Considerations
Establish the HTTP Digest Algorithm Values
This memo sets this spec to be the establishing document for the HTTP Digest
Algorithm
Values
The "status" Field in the HTTP Digest Algorithm Values
This memo adds the field "Status" to the HTTP Digest Algorithm
Values
registry. The allowed values for the "Status" fields are described below.
- Status
-
- "standard" for standardized algorithms without known problems;
- "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.
Deprecate "MD5" Digest Algorithm
This memo updates the "MD5" digest-algorithm in the HTTP Digest Algorithm
Values
registry:
- Digest Algorithm: md5
- Description: As specified in .
- Status: As specified in .
Update "UNIXsum" Digest Algorithm
This memo updates the "UNIXsum" digest-algorithm in the HTTP Digest Algorithm
Values
registry:
- Digest Algorithm: As specified in .
- Description: As specified in .
- Status: As specified in .
Update "UNIXcksum" Digest Algorithm
This memo updates the "UNIXcksum" digest-algorithm in the HTTP Digest Algorithm
Values
registry:
- Digest Algorithm: As specified in .
- Description: As specified in .
- Status: As specified in .
Update "CRC32c" Digest Algorithm
This memo updates the "CRC32c" digest-algorithm in the HTTP Digest Algorithm
Values
registry:
- Digest Algorithm: crc32c
- Description: The CRC32c algorithm is a 32-bit cyclic redundancy check. It
achieves a better hamming distance (for better error-detection performance)
than many other 32-bit CRC functions. Other places it is used include iSCSI
and SCTP. The 32-bit output 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, crc32c=0a72a4df and crc32c=A72A4DF are both valid checksums for the
3-byte message "dog".
- Reference: appendix B, this document.
- Status: standard.
Deprecate "SHA" Digest Algorithm
This memo updates the "SHA" digest-algorithm in the HTTP Digest Algorithm
Values
registry:
- Digest Algorithm: sha
- Description: As specified in .
- Status: As specified in .
Obsolete "ADLER32" Digest Algorithm
This memo updates the "ADLER32" digest-algorithm in the HTTP Digest Algorithm
Values
registry:
- Digest Algorithm: adler32
- Description: The ADLER32 algorithm is a checksum specified in "ZLIB
Compressed Data Format". The 32-bit output 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, adler32=03da0195 and adler32=3DA0195 are both valid
checksums for the 4-byte message "Wiki". This algorithm is obsoleted and
SHOULD NOT be used.
- Status: obsoleted
Obsolete "contentMD5" token in Digest Algorithm
This memo adds the "contentMD5" token in the HTTP Digest Algorithm
Values
registry:
- Digest Algorithm: contentMD5
- Description: Section 5 of defined the "contentMD5" token to be used only in Want-Digest.
This token is obsoleted and MUST NOT be used.
- Reference: of this document, Section 5 of .
- Status: obsoleted
The "id-sha-256" Digest Algorithm
This memo registers the "id-sha-256" digest-algorithm in the HTTP Digest
Algorithm
Values
registry:
- Digest Algorithm: id-sha-256
- Description: As specified in .
- Status: As specified in .
The "id-sha-512" Digest Algorithm
This memo registers the "id-sha-512" digest-algorithm in the HTTP Digest
Algorithm
Values
registry:
- Digest Algorithm: id-sha-512
- Description: As specified in .
- Status: As specified in .
Changes compared to RFC5843
The digest-algorithm values for "MD5", "SHA", "SHA-256", "SHA-512", "UNIXcksum", "UNIXsum",
"ADLER32" and "CRC32c" have been updated to lowercase.
The status of "MD5" has been updated to "deprecated", and its description states
that this algorithm MUST NOT be used.
The status of "SHA" has been updated to "deprecated", and its description states
that this algorithm MUST NOT be used.
The status for "CRC2c", "UNIXsum" and "UNIXcksum" has been updated to "standard".
The "id-sha-256" and "id-sha-512" algorithms have been added to the registry.
Want-Digest Field Registration
This section registers the Want-Digest field in the "Hypertext Transfer
Protocol (HTTP) Field Name Registry" .
Field name: Want-Digest
Status: permanent
Specification document(s): of this document
Digest Header Field Registration
This section registers the Digest field in the "Hypertext Transfer Protocol
(HTTP) Field Name Registry" .
Field name: Digest
Status: permanent
Specification document(s): of this document
References
Normative References
The MD5 Message-Digest Algorithm
This document describes the MD5 message-digest algorithm. The algorithm takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. This memo provides information for the Internet community. It does not specify an Internet standard.
US Secure Hash Algorithm 1 (SHA1)
The purpose of this document is to make the SHA-1 (Secure Hash Algorithm 1) hash algorithm conveniently available to the Internet community. This memo provides information for the Internet community.
ZLIB Compressed Data Format Specification version 3.3
This specification defines a lossless compressed data format. This memo provides information for the Internet community. This memo does not specify an Internet standard of any kind.
Instance Digests in HTTP
HTTP/1.1 defines a Content-MD5 header that allows a server to include a digest of the response body. However, this is specifically defined to cover the body of the actual message, not the contents of the full file (which might be quite different, if the response is a Content-Range, or uses a delta encoding). Also, the Content-MD5 is limited to one specific digest algorithm; other algorithms, such as SHA-1 (Secure Hash Standard), may be more appropriate in some circumstances. Finally, HTTP/1.1 provides no explicit mechanism by which a client may request a digest. This document proposes HTTP extensions that solve these problems. [STANDARDS-TRACK]
Stream Control Transmission Protocol (SCTP) Checksum Change
Key words for use in RFCs to Indicate Requirement Levels
In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.
Additional Hash Algorithms for HTTP Instance Digests
The IANA registry named "Hypertext Transfer Protocol (HTTP) Digest Algorithm Values" defines values for digest algorithms used by Instance Digests in HTTP. Instance Digests in HTTP provide a digest, also known as a checksum or hash, of an entire representation of the current state of a resource. This document adds new values to the registry and updates previous values. This document is not an Internet Standards Track specification; it is published for informational purposes.
The Base16, Base32, and Base64 Data Encodings
This document describes the commonly used base 64, base 32, and base 16 encoding schemes. It also discusses the use of line-feeds in encoded data, use of padding in encoded data, use of non-alphabet characters in encoded data, use of different encoding alphabets, and canonical encodings. [STANDARDS-TRACK]
Augmented BNF for Syntax Specifications: ABNF
Internet technical specifications often need to define a formal syntax. Over the years, a modified version of Backus-Naur Form (BNF), called Augmented BNF (ABNF), has been popular among many Internet specifications. The current specification documents ABNF. It balances compactness and simplicity with reasonable representational power. The differences between standard BNF and ABNF involve naming rules, repetition, alternatives, order-independence, and value ranges. This specification also supplies additional rule definitions and encoding for a core lexical analyzer of the type common to several Internet specifications. [STANDARDS-TRACK]
US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)
Federal Information Processing Standard, FIPS
Case-Sensitive String Support in ABNF
This document extends the base definition of ABNF (Augmented Backus-Naur Form) to include a way to specify US-ASCII string literals that are matched in a case-sensitive manner.
Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.
The Single UNIX Specification, Version 2 - 6 Vol Set for UNIX 98
The Open Group
Introduction to Public Key Technology and the Federal PKI Infrastructure
National Institute of Standards and Technology, U.S. Department of Commerce
MD5 Vulnerable to collision attacks
Carnagie Mellon University, Software Engineering Institute
SHA-1 is a Shambles
Inria, France
Nanyang Technological University, Singapore; Temasek Laboratories, Singapore
HTTP Semantics
The Hypertext Transfer Protocol (HTTP) is a stateless application- level protocol for distributed, collaborative, hypertext information systems. This document defines the semantics of HTTP: its architecture, terminology, the "http" and "https" Uniform Resource Identifier (URI) schemes, core request methods, request header fields, response status codes, response header fields, and content negotiation. This document obsoletes RFC 2818, RFC 7231, RFC 7232, RFC 7233, RFC 7235, RFC 7538, RFC 7615, RFC 7694, and portions of RFC 7230.
Stream Control Transmission Protocol
This document obsoletes RFC 2960 and RFC 3309. It describes the Stream Control Transmission Protocol (SCTP). SCTP is designed to transport Public Switched Telephone Network (PSTN) signaling messages over IP networks, but is capable of broader applications.
SCTP is a reliable transport protocol operating on top of a connectionless packet network such as IP. It offers the following services to its users:
-- acknowledged error-free non-duplicated transfer of user data,
-- data fragmentation to conform to discovered path MTU size,
-- sequenced delivery of user messages within multiple streams, with an option for order-of-arrival delivery of individual user messages,
-- optional bundling of multiple user messages into a single SCTP packet, and
-- network-level fault tolerance through supporting of multi-homing at either or both ends of an association.
The design of SCTP includes appropriate congestion avoidance behavior and resistance to flooding and masquerade attacks. [STANDARDS-TRACK]
Informative References
HTTP Over TLS
This memo describes how to use Transport Layer Security (TLS) to secure Hypertext Transfer Protocol (HTTP) connections over the Internet. This memo provides information for the Internet community.
Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content
The Hypertext Transfer Protocol (HTTP) is a stateless \%application- level protocol for distributed, collaborative, hypertext information systems. This document defines the semantics of HTTP/1.1 messages, as expressed by request methods, request header fields, response status codes, and response header fields, along with the payload of messages (metadata and body content) and mechanisms for content negotiation.
JSON Merge Patch
This specification defines the JSON merge patch format and processing rules. The merge patch format is primarily intended for use with the HTTP PATCH method as a means of describing a set of modifications to a target resource's content.
Subresource Integrity
HTTP/1.1 Messaging
The Hypertext Transfer Protocol (HTTP) is a stateless application- level protocol for distributed, collaborative, hypertext information systems. This document specifies the HTTP/1.1 message syntax, message parsing, connection management, and related security concerns. This document obsoletes portions of RFC 7230.
PATCH Method for HTTP
Several applications extending the Hypertext Transfer Protocol (HTTP) require a feature to do partial resource modification. The existing HTTP PUT method only allows a complete replacement of a document. This proposal adds a new HTTP method, PATCH, to modify an existing HTTP resource. [STANDARDS-TRACK]
Problem Details for HTTP APIs
This document defines a "problem detail" as a way to carry machine- readable details of errors in a HTTP response to avoid the need to define new error response formats for HTTP APIs.
Merkle Integrity Content Encoding
This memo introduces a content-coding for HTTP that provides progressive integrity for message contents. This integrity protection can be evaluated on a partial representation, allowing a recipient to process a message as it is delivered while retaining strong integrity protection.
Encrypted Content-Encoding for HTTP
This memo introduces a content coding for HTTP that allows message payloads to be encrypted.
Guidelines for Cryptographic Algorithm Agility and Selecting Mandatory-to-Implement Algorithms
Many IETF protocols use cryptographic algorithms to provide confidentiality, integrity, authentication, or digital signature. Communicating peers must support a common set of cryptographic algorithms for these mechanisms to work properly. This memo provides guidelines to ensure that protocols have the ability to migrate from one mandatory-to-implement algorithm suite to another over time.
Structured Field Values for HTTP
This document describes a set of data types and associated algorithms that are intended to make it easier and safer to define and handle HTTP header and trailer fields, known as "Structured Fields", "Structured Headers", or "Structured Trailers". It is intended for use by specifications of new HTTP fields that wish to use a common syntax that is more restrictive than traditional HTTP field values.
Resource Representation and Representation-Data
The following examples show how representation metadata, payload transformations
and method impacts on the message and payload body. When the payload body
contains non-printable characters (eg. when it is compressed) it is shown as
base64-encoded string.
A request with a json object without any content coding.
Request:
Here is a gzip-compressed json object
using a content coding.
Request:
Now the same payload body conveys a malformed json object.
Request:
A Range-Request alters the payload body, conveying a partial representation.
Request:
Response:
Now the method too alters the payload body.
Request:
Response:
Finally the semantics of an HTTP response might decouple the effective request URI
from the enclosed representation. In the example response below, the
Content-Location header field indicates that the enclosed representation
refers to the resource available at /authors/123.
Request:
Response:
FAQ
-
Why remove all references to content-md5?
Those were unnecessary to understanding and using this spec.
-
Why remove references to instance manipulation?
Those were unnecessary for correctly using and applying the spec. An example
with Range Request is more than enough. This doc uses the term "partial
representation" which should group all those cases.
-
How to use Digest with PATCH method?
See .
-
Why remove references to delta-encoding?
Unnecessary for a correct implementation of this spec. The revised spec can
be nicely adapted to "delta encoding", but all the references here to delta
encoding don't add anything to this RFC. Another job would be to refresh
delta encoding.
-
Why remove references to Digest Authentication?
This RFC seems to me completely unrelated to Digest Authentication but for
the word "Digest".
-
What changes in Want-Digest?
The contentMD5 token defined in Section 5 of is deprecated by .
To clarify that Digest and Want-Digest can be used in both requests and responses
- carefully uses sender and receiver in their definition -
we added examples on using Want-Digest in responses to advertise the supported
digest-algorithms and the inability to accept requests with unsupported
digest-algorithms.
-
Does this spec changes supported algorithms?
This RFC updates which is still delegated for all algorithms
updates, and adds two more algorithms: "id-sha-256" and "id-sha-512" which allows
to send a checksum of a resource representation with no content codings
applied.
To simplify a future transition to Structured Fields
we suggest to use lowercase for digest-algorithms.
-
What about mid-stream trailers?
While
mid-stream trailers
are interesting, since this specification is a rewrite of we do not
think we should face that. As a first thought, nothing in this document
precludes future work that would find a use for mid-stream trailers, for
example an incremental digest-algorithm. A document defining such a
digest-algorithm is best positioned to describe how it is used.
Acknowledgements
The vast majority of this document is inherited from , so thanks
to J. Mogul and A. Van Hoff for their great work.
The original idea of refreshing this document arose from an interesting
discussion with M. Nottingham, J. Yasskin and M. Thomson when reviewing
the MICE content coding.
Code Samples
RFC Editor: Please remove this section before publication.
How can I generate and validate the Digest values shown in the examples
throughout this document?
The following python3 code can be used to generate digests for json objects
using SHA algorithms for a range of encodings. Note that these are formatted as
base64. This function could be adapted to other algorithms and should take into
account their specific formatting rules.
Changes
RFC Editor: Please remove this section before publication.
Since draft-ietf-httpbis-digest-headers-03
- Reference semantics-12
- Detail encryption quirks
- Details on Algorithm agility #1250
- Obsolete parameters #850
Since draft-ietf-httpbis-digest-headers-02
- Deprecate SHA-1 #1154
- Avoid id-* with encrypted content
- Digest is independent from MESSAGING and HTTP/1.1 is not normative #1215
- Identity is not a valid field value for content-encoding #1223
- Mention trailers #1157
- 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
- Effect of HTTP semantics on payload and message body moved to appendix #1122
- Editorial refactoring, moving headers sections up. #1109-#1112, #1116,
#1117, #1122-#1124
Since draft-ietf-httpbis-digest-headers-00
- Align title with document name
- Add id-sha-* algorithm examples #880
- Reference and instead of FIPS-1
- Deprecate MD5
- Obsolete ADLER-32 but don't forbid it #828
- Update CRC32C value in IANA table #828
- Use when acting on resources (POST, PATCH) #853
- Added Relationship with SRI, draft Use Cases #868, #971
- Warn about the implications of Content-Location