rfc2660.txt
来自「中、英文RFC文档大全打包下载完全版 .」· 文本 代码 · 共 1,642 行 · 第 1/5 页
TXT
1,642 行
In the former case, the symmetric-key cryptosystem parameter is passed encrypted under the receiver's public key.Rescorla & Schiffman Experimental [Page 6]RFC 2660 The Secure HyperText Transfer Protocol August 1999 In the latter mode, we encrypt the content using a prearranged session key, with key identification information specified on one of the header lines.1.4.3. Message Integrity and Sender Authentication Secure HTTP provides a means to verify message integrity and sender authenticity for a message via the computation of a Message Authentication Code (MAC), computed as a keyed hash over the document using a shared secret -- which could potentially have been arranged in a number of ways, e.g.: manual arrangement or 'inband' key management. This technique requires neither the use of public key cryptography nor encryption. This mechanism is also useful for cases where it is appropriate to allow parties to identify each other reliably in a transaction without providing (third-party) non-repudiability for the transactions themselves. The provision of this mechanism is motivated by our bias that the action of "signing" a transaction should be explicit and conscious for the user, whereas many authentication needs (i.e., access control) can be met with a lighter-weight mechanism that retains the scalability advantages of public-key cryptography for key exchange.1.4.4. Freshness The protocol provides a simple challenge-response mechanism, allowing both parties to insure the freshness of transmissions. Additionally, the integrity protection provided to HTTP headers permits implementations to consider the Date: header allowable in HTTP messages as a freshness indicator, where appropriate (although this requires implementations to make allowances for maximum clock skew between parties, which we choose not to specify).1.5. Implementation Options In order to encourage widespread adoption of secure documents for the World-Wide Web in the face of the broad scope of application requirements, variability of user sophistication, and disparate implementation constraints, Secure HTTP deliberately caters to a variety of implementation options. See Section 8 for implementation recommendations and requirements.2. Message Format Syntactically, Secure HTTP messages are the same as HTTP, consisting of a request or status line followed by headers and a body. However, the range of headers is different and the bodies are typicallyRescorla & Schiffman Experimental [Page 7]RFC 2660 The Secure HyperText Transfer Protocol August 1999 cryptographically enhanced.2.1. Notational Conventions This document uses the augmented BNF from HTTP [RFC-2616]. You should refer to that document for a description of the syntax.2.2. Request Line In order to differentiate S-HTTP messages from HTTP messages and allow for special processing, the request line should use the special Secure" method and use the protocol designator "Secure-HTTP/1.4". Consequently, Secure-HTTP and HTTP processing can be intermixed on the same TCP port, e.g. port 80. In order to prevent leakage of potentially sensitive information Request-URI should be "*". For example: Secure * Secure-HTTP/1.4 When communicating via a proxy, the Request-URI should be consist of the AbsoluteURI. Typically, the rel path section should be replaced by "*" to minimize the information passed to in the clear. (e.g. http://www.terisa.com/*); proxies should remove the appropriate amount of this information to minimize the threat of traffic analysis. See Section 7.2.2.1 for a situation where providing more information is appropriate.2.3. The Status Line S-HTTP responses should use the protocol designator "Secure- HTTP/1.4". For example: Secure-HTTP/1.4 200 OK Note that the status in the Secure HTTP response line does not indicate anything about the success or failure of the unwrapped HTTP request. Servers should always use 200 OK provided that the Secure HTTP processing is successful. This prevents analysis of success or failure for any request, which the correct recipient can determine from the encapsulated data. All case variations should be accepted.2.4. Secure HTTP Header Lines The header lines described in this section go in the header of a Secure HTTP message. All except 'Content-Type' and 'Content-Privacy- Domain' are optional. The message body shall be separated from the header block by two successive CRLFs.Rescorla & Schiffman Experimental [Page 8]RFC 2660 The Secure HyperText Transfer Protocol August 1999 All data and fields in header lines should be treated as case insensitive unless otherwise specified. Linear whitespace [RFC-822] should be used only as a token separator unless otherwise quoted. Long header lines may be line folded in the style of [RFC-822]. This document refers to the header block following the S-HTTP request/response line and preceding the successive CRLFs collectively as "S-HTTP headers".2.4.1. Content-Privacy-Domain The two values defined by this document are 'MOSS' and 'CMS'. CMS refers to the privacy enhancement specified in section 2.6.1. MOSS refers to the format defined in [RFC-1847] and [RFC-1848].2.4.2. Content-Type for CMS Under normal conditions, the terminal encapsulated content (after all privacy enhancements have been removed) would be an HTTP message. In this case, there shall be a Content-Type line reading: Content-Type: message/http The message/http content type is defined in RFC-2616. If the inner message is an S-HTTP message, then the content type shall be 'application/s-http'. (See Appendix for the definition of this.) It is intended that these types be registered with IANA as MIME content types. The terminal content may be of some other type provided that the type is properly indicated by the use of an appropriate Content-Type header line. In this case, the header fields for the encapsulation of the terminal content apply to the terminal content (the 'final headers'). But in any case, final headers should themselves always be S-HTTP encapsulated, so that the applicable S-HTTP/HTTP headers are never passed unenhanced. S-HTTP encapsulation of non-HTTP data is a useful mechanism for passing pre-enhanced data (especially presigned data) without requiring that the HTTP headers themselves be pre-enhanced.Rescorla & Schiffman Experimental [Page 9]RFC 2660 The Secure HyperText Transfer Protocol August 19992.4.3. Content-Type for MOSS The Content-Type for MOSS shall be an acceptable MIME content type describing the cryptographic processing applied. (e.g. multipart/signed). The content type of the inner content is described in the content type line corresponding to that inner content, and for HTTP messages shall be 'message/http'.2.4.4. Prearranged-Key-Info This header line is intended to convey information about a key which has been arranged outside of the internal cryptographic format. One use of this is to permit in-band communication of session keys for return encryption in the case where one of the parties does not have a key pair. However, this should also be useful in the event that the parties choose to use some other mechanism, for instance, a one-time key list. This specification defines two methods for exchanging named keys, Inband, Outband. Inband indicates that the session key was exchanged previously, using a Key-Assign header of the corresponding method. Outband arrangements imply that agents have external access to key materials corresponding to a given name, presumably via database access or perhaps supplied immediately by a user from keyboard input. The syntax for the header line is: Prearranged-Key-Info = "Prearranged-Key-Info" ":" Hdr-Cipher "," CoveredDEK "," CoverKey-ID CoverKey-ID = method ":" key-name CoveredDEK = *HEX method = "inband" | "outband" While chaining ciphers require an Initialization Vector (IV) [FIPS- 81] to start off the chaining, that information is not carried by this field. Rather, it should be passed internal to the cryptographic format being used. Likewise, the bulk cipher used is specified in this fashion. <Hdr-Cipher> should be the name of the block cipher used to encrypt the session key (see section 3.2.4.7) <CoveredDEK> is the protected Data Encryption Key (a.k.a. transaction key) under which the encapsulated message was encrypted. It should be appropriately (randomly) generated by the sending agent, then encrypted under the cover of the negotiated key (a.k.a. session key) using the indicated header cipher, and then converted into hex.Rescorla & Schiffman Experimental [Page 10]RFC 2660 The Secure HyperText Transfer Protocol August 1999 In order to avoid name collisions, cover key namespaces must be maintained separately by host and port. Note that some Content-Privacy-Domains, notably likely future revisions of MOSS and CMS may have support for symmetric key management. The Prearranged-Key-Info field need not be used in such circumstances. Rather, the native syntax is preferred. Keys exchanged with Key-Assign, however, may be used in this situation.2.4.5. MAC-Info This header is used to supply a Message Authenticity Check, providing both message authentication and integrity, computed from the message text, the time (optional -- to prevent replay attack), and a shared secret between client and server. The MAC should be computed over the encapsulated content of the S-HTTP message. S-HTTP/1.1 defined that MACs should be computed using the following algorithm ('||' means concatenation): MAC = hex(H(Message||[<time>]||<shared key>)) The time should be represented as an unsigned 32 bit quantity representing seconds since 00:00:00 GMT January 1, 1970 (the UNIX epoch), in network byte order. The shared key format is a local matter. Recent research [VANO95] has demonstrated some weaknesses in this approach, and this memo introduces a new construction, derived from [RFC-2104]. In the name of backwards compatibility, we retain the previous constructions with the same names as before. However, we also introduce a new series of names (See Section 3.2.4.8 for the names) that obey a different (hopefully stronger) construction. (^ means bitwise XOR) HMAC = hex(H(K' ^ pad2 || H(K' ^ pad1 ||[<time>]|| Message))) pad1 = the byte 0x36 repeated enough times to fill out a hash input block. (I.e. 64 times for both MD5 and SHA-1) pad2 = the byte 0x5c repeated enough times to fill out a hash input block. K' = H(<shared key>) The original HMAC construction is for the use of a key with length equal to the length of the hash output. Although it is considered safe to use a key of a different length (Note that strength cannot be increased past the length of the hash function itself, but can be reduced by using a shorter key.) [KRAW96b] we hash the original keyRescorla & Schiffman Experimental [Page 11]RFC 2660 The Secure HyperText Transfer Protocol August 1999 to permit the use of shared keys (e.g. passphrases) longer than the length of the hash. It is noteworthy (though obvious) that this technique does not increase the strength of short keys. The format of the MAC-Info line is: MAC-Info = "MAC-Info" ":" [hex-time], hash-alg, hex-hash-data, key-spec hex-time = <unsigned seconds since Unix epoch represented as HEX> hash-alg = <hash algorithms from section 3.2.4.8> hex-hash-data = <computation as described above represented as HEX> Key-Spec = "null" | "dek" | Key-ID Key-Ids can refer either to keys bound using the Key-Assign header line or those bound in the same fashion as the Outband method described later. The use of a 'Null' key-spec implies that a zero length key was used, and therefore that the MAC merely represents a hash of the message text and (optionally) the time. The special key-spec 'DEK' refers to the Data Exchange Key used to encrypt the following message body (it is an error to use the DEK key-spec in situations where the following message body is unencrypted). If the time is omitted from the MAC-Info line, it should simply not be included in the hash. Note that this header line can be used to provide a more advanced equivalent of the original HTTP Basic authentication mode in that the user can be asked to provide a username and password. However, the password remains private and message integrity can be assured. Moreover, this can be accomplished without encryption of any kind. In addition, MAC-Info permits fast message integrity verification (at the loss of non-repudiability) for messages, provided that the participants share a key (possibly passed using Key-Assign in a previous message).
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?