rfc3230.txt
来自「RFC 的详细文档!」· 文本 代码 · 共 732 行 · 第 1/2 页
TXT
732 行
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.
4.2 Instance digests
An instance digest is the representation of the output of a digest
algorithm, together with an indication of the algorithm used (and any
parameters).
instance-digest = digest-algorithm "="
<encoded digest output>
The digest is computed on the entire instance associated with the
message. The instance is a snapshot of the resource prior to the
application of of any instance manipulation or transfer-coding (see
section 3). The byte order used to compute the digest is the
transmission byte order defined for the content-type of the instance.
Mogul, et. al. Standards Track [Page 7]
RFC 3230 Instance Digests in HTTP January 2002
Note: the digest is computed before the application of any
instance manipulation. If a range or a delta-coding [9] is used,
the computation of the digest after the computation of the range
or delta would not provide a digest useful for checking the
integrity of the reassembled instance.
The encoded digest output uses the encoding format defined for the
specific digest-algorithm. For example, if the digest-algorithm is
"MD5", the encoding is base64; if the digest-algorithm is "UNIXsum",
the encoding is an ASCII string of decimal digits.
Examples:
MD5=HUXZLQLMuI/KZ5KDcJPcOA==
sha=thvDyvhfIqlvFe+A9MYgxAfm1q5=
UNIXsum=30637
4.3 Header specifications
The following headers are defined.
4.3.1 Want-Digest
The Want-Digest message header field indicates the sender's desire to
receive an instance digest on messages associated with the Request-
URI.
Want-Digest = "Want-Digest" ":"
#(digest-algorithm [ ";" "q" "=" qvalue])
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 header 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.
Examples:
Want-Digest: md5
Want-Digest: MD5;q=0.3, sha;q=1
Mogul, et. al. Standards Track [Page 8]
RFC 3230 Instance Digests in HTTP January 2002
4.3.2 Digest
The Digest message header field provides a message digest of the
instance described by the message.
Digest = "Digest" ":" #(instance-digest)
The instance described by a message might be fully contained in the
message-body, partially-contained in the message-body, or not at all
contained in the message-body. The instance is specified by the
Request-URI and any cache-validator contained in the message.
A Digest header field MAY contain multiple instance-digest values.
This could be useful for responses expected to reside in caches
shared by users with different browsers, for example.
A recipient MAY ignore any or all of the instance-digests in a Digest
header field.
A sender MAY send an instance-digest using a digest-algorithm without
knowing whether the recipient supports the digest-algorithm, or even
knowing that the recipient will ignore it.
Examples:
Digest: md5=HUXZLQLMuI/KZ5KDcJPcOA==
Digest: SHA=thvDyvhfIqlvFe+A9MYgxAfm1q5=,unixsum=30637
5 Negotiation of Content-MD5
HTTP/1.1 provides a Content-MD5 header field, but does not provide
any mechanism for requesting its use (or non-use). The Want-Digest
header field defined in this document provides the basis for such a
mechanism.
First, we add to the set of digest-algorithm values (in section
4.1.1) the token "contentMD5", with the provision that this digest-
algorithm MUST NOT be used in a Digest header field.
The presence of the "contentMD5" digest-algorithm with a non-zero
qvalue in a Want-Digest header field indicates that the sender wishes
to receive a Content-MD5 header on messages associated with the
Request-URI.
The presence of the "contentMD5" digest-algorithm with a zero qvalue
in a Want-Digest header field indicates that the sender will ignore
Content-MD5 headers on messages associated with the Request-URI.
Mogul, et. al. Standards Track [Page 9]
RFC 3230 Instance Digests in HTTP January 2002
6 IANA Considerations
The Internet Assigned Numbers Authority (IANA) administers the name
space for digest-algorithm values. Values and their meaning must be
documented in an RFC or other peer-reviewed, permanent, and readily
available reference, in sufficient detail so that interoperability
between independent implementations is possible. Subject to these
constraints, name assignments are First Come, First Served (see RFC
2434 [11]).
7 Security Considerations
This document specifies a data integrity mechanism that protects HTTP
instance data, but not HTTP entity headers, from certain kinds of
accidental corruption. It is also useful in detecting at least one
spoofing attack [9]. However, it is not intended as general
protection against malicious tampering with HTTP messages.
The HTTP Digest Access Authentication mechanism [5] provides some
protection against malicious tampering.
8 Acknowledgements
It is not clear who first realized that the Content-MD5 header field
is not sufficient to provide data integrity when ranges or deltas are
used.
Laurent Demailly may have been the first to suggest an algorithm-
independent checksum header for HTTP [3]. Dave Raggett suggested the
use of the term "digest" instead of "checksum" [14].
9 References
[1] Freed, N. and N. Borenstein, N., "MIME (Multipurpose Internet
Mail Extensions) Part One: Mechanisms for Specifying and
Describing the Format of Internet Message Bodies", RFC 2049,
November 1996.
[2] Bradner, S., "Key words for use in RFCs to Indicate Requirement
Levels", BCP 14, RFC 2119, March 1997.
[3] Laurent Demailly. Re: Revised Charter.
http://www.ics.uci.edu/pub/ietf/http/hypermail/1995q4/0165.html.
[4] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L.,
Leach, P. and T. Berners-Lee, "Hypertext Transfer Protocol --
HTTP/1.1.", RFC 2616, June 1999.
Mogul, et. al. Standards Track [Page 10]
RFC 3230 Instance Digests in HTTP January 2002
[5] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S.,
Leach, P., Luotonen, A. and L. Stewart, "HTTP Authentication:
Basic and Digest Access Authentication", RFC 2617, June 1999.
[6] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part One: Format of Internet Message Bodies",
RFC 2045, November 1996.
[7] Nevin Heintze. Scalable Document Fingerprinting. Proc. Second
USENIX Workshop on Electronic Commerce, USENIX, Oakland, CA,
November, 1996, pp. 191-200.
http://www.cs.cmu.edu/afs/cs/user/nch/www/koala/main.html.
[8] Merriam-Webster. Webster's Seventh New Collegiate Dictionary.
G. & C. Merriam Co., Springfield, MA, 1963.
[9] Mogul, J., Krishnamurthy, B., Douglis, F., Feldmann, A., Goland,
Y. and A. van Hoff, "Delta encoding in HTTP", RFC 3229, December
2001.
[10] Myers, J. and M. Rose, "The Content-MD5 Header Field", RFC 1864,
October 1995.
[11] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA
Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.
[12] National Institute of Standards and Technology. Secure Hash
Standard. FEDERAL INFORMATION PROCESSING STANDARDS PUBLICATION
180-1, U.S. Department of Commerce, April, 1995.
http://csrc.nist.gov/fips/fip180-1.txt.
[13] The Open Group. The Single UNIX Specification, Version 2 - 6
Vol Set for UNIX 98. Document number T912, The Open Group,
February, 1997.
[14] Dave Raggett. Re: Revised Charter.
http://www.ics.uci.edu/pub/ietf/http/hypermail/1995q4/0182.html.
[15] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, April
1992.
Mogul, et. al. Standards Track [Page 11]
RFC 3230 Instance Digests in HTTP January 2002
10 Authors' Addresses
Jeffrey C. Mogul
Western Research Laboratory
Compaq Computer Corporation
250 University Avenue
Palo Alto, California, 94305, U.S.A.
EMail: JeffMogul@acm.org
Phone: 1 650 617 3304 (email preferred)
Arthur van Hoff
Marimba, Inc.
440 Clyde Avenue
Mountain View, CA 94043
EMail: avh@marimba.com
Phone: 1 (650) 930 5283
Mogul, et. al. Standards Track [Page 12]
RFC 3230 Instance Digests in HTTP January 2002
11 Full Copyright Statement
Copyright (C) The Internet Society (2002). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.
Mogul, et. al. Standards Track [Page 13]
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?