home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_u_z / draft-ietf-wts-shttp-03.txt < prev    next >
Text File  |  1996-08-01  |  104KB  |  2,644 lines

  1.                                                   E. Rescorla, A. Schiffman
  2. INTERNET-DRAFT                                         Terisa Systems, Inc.
  3. <draft-ietf-wts-shttp-03.txt>                July 1996 (Expires January-97)
  4.  
  5.  
  6.                  The Secure HyperText Transfer Protocol
  7.  
  8. Status of this Memo
  9.  
  10.    This document is an Internet-Draft.  Internet-Drafts are working
  11.    documents of the Internet Engineering Task Force (IETF), its areas,
  12.    and its working groups.  Note that other groups may also distribute
  13.    working documents as Internet-Drafts.
  14.  
  15.    Internet-Drafts are draft documents valid for a maximum of six months
  16.    and may be updated, replaced, or obsoleted by other documents at any
  17.    time.  It is inappropriate to use Internet-Drafts as reference
  18.    material or to cite them other than as ``work in progress.''
  19.  
  20.    To learn the current status of any Internet-Draft, please check the
  21.    ``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow
  22.    Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
  23.    munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
  24.    ftp.isi.edu (US West Coast).
  25.  
  26.    This document describes S-HTTP version 1.2. Previous versions of S-
  27.    HTTP numbered 1.0 and 1.1 have also been released as Internet-Drafts.
  28.    A companion draft, draft-ietf-wts-shtml-01.txt, describes extensions
  29.    to HTML to bind S-HTTP negotiation options to HTML anchors.
  30.  
  31. Abstract
  32.  
  33.    This memo describes a syntax for securing messages sent using the
  34.    Hypertext Transfer Protocol (HTTP), which forms the basis for the
  35.    World Wide Web. Secure HTTP (S-HTTP) provides independently applica-
  36.    ble security services for transaction confidentiality, authenticity/
  37.    integrity and non-repudiability of origin.
  38.  
  39.    The protocol emphasizes maximum flexibility in choice of key manage-
  40.    ment mechanisms, security policies and cryptographic algorithms by
  41.    supporting option negotiation between parties for each transaction.
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. Rescorla, Schiffman                                              [Page 1] Internet-Draft                Secure HTTP                 
  53.  
  54.  
  55. 1.  Introduction
  56.  
  57.    The World Wide Web (WWW) is a distributed hypermedia system which has
  58.    gained widespread acceptance among Internet users.  Although WWW
  59.    browsers support other, preexisting Internet application protocols,
  60.    the native and primary protocol used between WWW clients and servers
  61.    is the HyperText Transfer Protocol (HTTP) [BERN95b].  The ease of use
  62.    of the Web has prompted widespread interest in its employment as a
  63.    client/server architecture for many applications.  Many such applica-
  64.    tions require the client and server to be able to authenticate each
  65.    other and exchange sensitive information confidentially. The original
  66.    HTTP specification had only modest support for the cryptographic
  67.    mechanisms appropriate for such transactions.
  68.  
  69.    Secure HTTP (S-HTTP) provides secure communication mechanisms between
  70.    an HTTP client-server pair in order to enable spontaneous commercial
  71.    transactions for a wide range of applications.  Our design intent is
  72.    to provide a flexible protocol that supports multiple orthogonal
  73.    operation modes, key management mechanisms, trust models, crypto-
  74.    graphic algorithms and encapsulation formats through option negotia-
  75.    tion between parties for each transaction.
  76.  
  77. 1.1.  Summary of Features
  78.  
  79.    Secure HTTP is a secure message-oriented communications protocol
  80.    designed for use in conjunction with HTTP. It is designed to coexist
  81.    with HTTP's messaging model and to be easily integrated with HTTP
  82.    applications. Consequently, it mimics much of HTTP's style and syn-
  83.    tax.
  84.  
  85.    Secure HTTP provides a variety of security mechanisms to HTTP clients
  86.    and servers, providing the security service options appropriate to
  87.    the wide range of potential end uses possible for the World-Wide Web.
  88.    The protocol provides symmetric capabilities to both client and
  89.    server (in that equal treatment is given to both requests and
  90.    replies, as well as for the preferences of both parties) while
  91.    preserving the transaction model and implementation characteristics
  92.    of HTTP.
  93.  
  94.    Several cryptographic message format standards may be incorporated
  95.    into S-HTTP clients and servers, particularly, but in principle not
  96.    limited to, [PKCS-7] and [MOSS]. S-HTTP supports interoperation among
  97.    a variety of implementations, and is compatible with HTTP.  S-HTTP
  98.    aware clients can communicate with S-HTTP oblivious servers and
  99.    vice-versa, although such transactions obviously would not use S-HTTP
  100.    security features.
  101.  
  102.    S-HTTP does not require client-side public key certificates (or
  103.  
  104.  
  105.  
  106. Rescorla, Schiffman                                              [Page 2] Internet-Draft                Secure HTTP                 
  107.  
  108.  
  109.    public keys), as it supports symmetric key-only operation modes. This
  110.    is significant because it means that spontaneous private transactions
  111.    can occur without requiring individual users to have an established
  112.    public key.  While S-HTTP is able to take advantage of ubiquitous
  113.    certification infrastructures, its deployment does not require it.
  114.  
  115.    S-HTTP supports end-to-end secure transactions, in contrast with the
  116.    original HTTP authorization mechanisms which require the client to
  117.    attempt access and be denied before the security mechanism is
  118.    employed.  Clients may be "primed" to initiate a secure transaction
  119.    (typically using information supplied in message headers); this may
  120.    be used to support encryption of fill-out forms, for example. With
  121.    S-HTTP, no sensitive data need ever be sent over the network in the
  122.    clear.
  123.  
  124.    S-HTTP provides full flexibility of cryptographic algorithms, modes
  125.    and parameters. Option negotiation is used to allow clients and
  126.    servers to agree on transaction modes (e.g., should the request be
  127.    signed or encrypted or both -- similarly for the reply?); crypto-
  128.    graphic algorithms (RSA vs. DSA for signing, DES vs. RC2 for encrypt-
  129.    ing, etc.); and certificate selection (please sign with your "Block-
  130.    buster Video certificate").
  131.  
  132.    S-HTTP attempts to avoid presuming a particular trust model, although
  133.    its designers admit to a conscious effort to facilitate multiply-
  134.    rooted hierarchical trust, and anticipate that principals may have
  135.    many public key certificates.
  136.  
  137. 1.2.  Changes
  138.  
  139.    This document describes S-HTTP/1.2. It differs from the previous
  140.    draft in coalescing all option negotiation headers onto a single
  141.    header line and in replacing PEM with MOSS. Also, the relationship
  142.    between S-HTTP and HTTP has been clarified.
  143.  
  144. 1.3.  Processing Model
  145.  
  146. 1.3.1.  Message Preparation
  147.  
  148.    The creation of an S-HTTP message can be thought of as a a function
  149.    with three inputs:
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160. Rescorla, Schiffman                                              [Page 3] Internet-Draft                Secure HTTP                 
  161.  
  162.  
  163.  
  164.            1. The cleartext message. This is either an HTTP message or some
  165.            other data object.
  166.            2. The receiver's cryptographic preferences and keying material.
  167.            This is either explicitly specified by the receiver or subject
  168.            to some default set of preferences.
  169.            3. The sender's cryptographic preferences and keying material.
  170.            This input to the function can be thought of as implicit
  171.            since it exists only in the memory of the sender.
  172.  
  173.  
  174.    In order to create an S-HTTP message, then, the sender integrates the
  175.    sender's preferences with the receiver's preferences. The result of
  176.    this is a list of cryptographic enhancements to be applied and keying
  177.    material to be used to apply them. This may require some user inter-
  178.    vention. For instance, there might be multiple keys available to sign
  179.    the message. (See Section 3.2.4.9.3 for more on this topic.) Using
  180.    this data, the sender applies the enhancements to the message clear-
  181.    text to create the S-HTTP message.
  182.  
  183.    The processing steps required to transform the cleartext message into
  184.    the S-HTTP message are described in Sections 2 and 3. The processing
  185.    steps required to merge the sender's and receiver's preferences are
  186.    described in Sections 3.2.
  187.  
  188. 1.3.2.  Message Recovery
  189.  
  190.    The recovery of an S-HTTP message can be thought of as a function of
  191.    four distinct inputs:
  192.  
  193.            1. The S-HTTP message.
  194.            2. The receiver's stated cryptographic preferences and keying
  195.            material. The receiver has the opportunity to remember what
  196.            cryptographic preferences it provided in order for this document
  197.            to be dereferenced.
  198.            3. The receiver's current cryptographic preferences and keying
  199.            material.
  200.            4. The sender's previously stated cryptographic options.
  201.            The sender may have stated that he would perform certain
  202.            cryptographic operations in this message. (Again, see sections
  203.            4 and 5 for details on how to do this.)
  204.  
  205.  
  206.    In order to recover an S-HTTP message, the receiver needs to read the
  207.    headers to discover which cryptographic transformations were per-
  208.    formed on the message, then remove the transformations using some
  209.    combination of the sender's and receiver's keying material, while
  210.    taking note of which enhancements were applied.
  211.  
  212.  
  213.  
  214. Rescorla, Schiffman                                              [Page 4] Internet-Draft                Secure HTTP                 
  215.  
  216.  
  217.    The receiver may also choose to verify that the applied enhancements
  218.    match both the enhancements that the sender said he would apply
  219.    (input 4 above) and that the receiver requested (input 2 above) as
  220.    well as the current preferences to see if the S-HTTP message was
  221.    appropriately transformed. This process may require interaction with
  222.    the user to verify that the enhancements are acceptable to the user.
  223.    (See Section 6.4 for more on this topic.)
  224.  
  225. 1.4.  Modes of Operation
  226.  
  227.    Message protection may be provided on three orthogonal axes: signa-
  228.    ture, authentication, and encryption. Any message may be signed,
  229.    authenticated, encrypted, or any combination of these (including no
  230.    protection).
  231.  
  232.    Multiple key management mechanisms are supported, including
  233.    password-style manually shared secrets, public-key key exchange and
  234.    Kerberos [RFC-1510] ticket distribution.  In particular, provision
  235.    has been made for prearranged (in an earlier transaction or out of
  236.    band) symmetric session keys in order to send confidential messages
  237.    to those who have no public key pair.
  238.  
  239.    Additionally, a challenge-response (``nonce'') mechanism is provided
  240.    to allow parties to assure themselves of transaction freshness.
  241.  
  242. 1.4.1.  Signature
  243.  
  244.    If the digital signature enhancement is applied, an appropriate cer-
  245.    tificate may either be attached to the message (possibly along with a
  246.    certificate chain) or the sender may expect the recipient to obtain
  247.    the required certificate (chain) independently.
  248.  
  249. 1.4.2.  Key Exchange and Encryption
  250.  
  251.    In support of bulk encryption, S-HTTP defines two key transfer
  252.    mechanisms, one using public-key enveloped key exchange and another
  253.    with externally arranged keys.
  254.  
  255.    In the former case, the symmetric-key cryptosystem parameter is
  256.    passed encrypted under the receiver's public key.
  257.  
  258.    In the latter mode, we encrypt the content using a prearranged ses-
  259.    sion key, with key identification information specified on one of the
  260.    header lines. Keys may also be extracted from Kerberos tickets.
  261.  
  262. 1.4.3.  Message Integrity and Sender Authentication
  263.  
  264.    Secure HTTP provides a means to verify message integrity and sender
  265.  
  266.  
  267.  
  268. Rescorla, Schiffman                                              [Page 5] Internet-Draft                Secure HTTP                 
  269.  
  270.  
  271.    authenticity for a message via the computation of a Message Authenti-
  272.    cation Code (MAC), computed as a keyed hash over the document using a
  273.    shared secret -- which could potentially have been arranged in a
  274.    number of ways, e.g.: manual arrangement or Kerberos.  This technique
  275.    requires neither the use of public key cryptography nor encryption.
  276.  
  277.    This mechanism is also useful for cases where it is appropriate to
  278.    allow parties to identify each other reliably in a transaction
  279.    without providing (third-party) non-repudiability for the transac-
  280.    tions themselves. The provision of this mechanism is motivated by our
  281.    bias that the action of "signing" a transaction should be explicit
  282.    and conscious for the user, whereas many authentication needs (i.e.,
  283.    access control) can be met with a lighter-weight mechanism that
  284.    retains the scalability advantages of public-key cryptography for key
  285.    exchange.
  286.  
  287. 1.4.4.  Freshness
  288.  
  289.    The protocol provides a simple challenge-response mechanism, allowing
  290.    both parties to insure the freshness of transmissions. Additionally,
  291.    the integrity protection provided to HTTP headers permits implementa-
  292.    tions to consider the Date: header allowable in HTTP messages as a
  293.    freshness indicator, where appropriate (although this requires imple-
  294.    mentations to make allowances for maximum clock skew between parties,
  295.    which we choose not to specify).
  296.  
  297. 1.5.  Implementation Options
  298.  
  299.    In order to encourage widespread adoption of secure documents for the
  300.    World-Wide Web in the face of the broad scope of application require-
  301.    ments, variability of user sophistication, and disparate implementa-
  302.    tion constraints, Secure HTTP deliberately caters to a variety of
  303.    implementation options.  See Section 8 for implementation recommenda-
  304.    tions and requirements.
  305.  
  306. 2.  Message Format
  307.  
  308.    Secure HTTP syntax deliberately mimics HTTP syntax in an effort to
  309.    ease integration with systems that already process HTTP. In addition,
  310.    certain HTTP headers are promoted to be Secure HTTP headers because
  311.    they provide useful functionality that has security implications.
  312.  
  313.    A Secure HTTP message consists of a request or status line (as in
  314.    HTTP) followed by a series of RFC-822 style headers followed by
  315.    encapsulated content. Once the content has been recovered, it should
  316.    either be another Secure HTTP message, an HTTP message, or simple
  317.    data.
  318.  
  319.  
  320.  
  321.  
  322. Rescorla, Schiffman                                              [Page 6] Internet-Draft                Secure HTTP                 
  323.  
  324.  
  325.    For the purposes of compatibility with existing HTTP implementations,
  326.    we distinguish S-HTTP transaction requests and replies with a dis-
  327.    tinct protocol designator ('Secure-HTTP/1.2').
  328.  
  329. 2.1.  The Request Line
  330.  
  331.    The S-HTTP request line format is similar to that of HTTP.  However,
  332.    all S-HTTP request use the method, 'Secure'.  All S-HTTP requests
  333.    (using this version of the protocol) should read:
  334.  
  335.            Secure * Secure-HTTP/1.2
  336.  
  337.    All case variations should be accepted. The asterisk shown here is a
  338.    placeholder and should be ignored by servers; proxy-aware clients
  339.    should substitute the URL (and must provide at least the host+port
  340.    portion) of the request when communicating via proxy, as is the
  341.    current HTTP convention; (e.g. http://www.terisa.com/*); proxies
  342.    should remove the appropriate amount of this information to minimize
  343.    the threat of traffic analysis.  See Section 7.2.2.1 for a situation
  344.    where providing more information is appropriate.
  345.  
  346. 2.2.  The Status Line
  347.  
  348.    For server responses, the first line should be:
  349.  
  350.            Secure-HTTP/1.2 200 OK
  351.  
  352.    whether the request succeeded or failed.  This prevents analysis of
  353.    success or failure for any request, which the correct recipient can
  354.    determine from the encapsulated data. All case variations should be
  355.    accepted.
  356.  
  357. 2.3.  Secure HTTP Header Lines
  358.  
  359.    The header lines described in this section go in the header of a
  360.    Secure HTTP message. All except 'Content-Type' and 'Content-Privacy-
  361.    Domain' are optional. The message body shall be separated from the
  362.    header block by two successive CRLFs.
  363.  
  364.    All data and fields in header lines should be treated as case insen-
  365.    sitive unless otherwise specified. Linear whitespace [RFC-822] should
  366.    be used only as a token separator unless otherwise quoted.  Long
  367.    header lines may be line folded in the style of [RFC-822].
  368.  
  369.    This document refers to the header block following the S-HTTP
  370.    request/response line and preceding the successive CRLFs collectively
  371.    as "S-HTTP headers".
  372.  
  373.  
  374.  
  375.  
  376. Rescorla, Schiffman                                              [Page 7] Internet-Draft                Secure HTTP                 
  377.  
  378.  
  379. 2.3.1.  Content-Privacy-Domain
  380.  
  381.    The two values defined by this document are 'MOSS' and 'PKCS-7'.
  382.    PKCS-7 [PKCS-7] refers to the privacy enhancement specified in sec-
  383.    tion 3. MOSS refers to the format defined in [RFC-1847] and [RFC-
  384.    1848].
  385.  
  386. 2.3.2.  Content-Transfer-Encoding
  387.  
  388.    The PKCS-7 message format is designed for an 8-bit clear channel, but
  389.    may be passed over other channels using base-64 encoding (see [RFC-
  390.    1421] for a description of base-64).
  391.  
  392.    For 'Content-Privacy-Domain: PKCS-7', acceptable values for this
  393.    field are 'BASE64','8BIT', or 'BINARY'. Unless such a line is
  394.    included, the rest of the message is assumed to be 'BINARY'. (Note
  395.    that the difference between 'BINARY' and '8BIT' has to do with line
  396.    length. See [RFC-1521] for details)
  397.  
  398.    For 'Content-Privacy-Domain: MOSS' all content transfer encodings are
  399.    permitted.
  400.  
  401. 2.3.3.  Content-Type for PKCS7
  402.  
  403.    Under normal conditions, the terminal encapsulated content (after all
  404.    privacy enhancements have been removed) would be an HTTP message. In
  405.    this case, there shall be a Content-Type line reading:
  406.  
  407.            Content-Type: application/http
  408.  
  409.  
  410.    If the inner message is an S-HTTP message, then the content type
  411.    shall be 'application/s-http'.
  412.  
  413.    It is intended that these types be registered with IANA as MIME con-
  414.    tent types.
  415.  
  416.    The terminal content may be of some other type provided that the type
  417.    is properly indicated by the use of an appropriate Content-Type
  418.    header line. In this case, the header fields for the encapsulation of
  419.    the terminal content apply to the terminal content (the 'final
  420.    headers'). But in any case, final headers should themselves always be
  421.    S-HTTP encapsulated, so that the applicable S-HTTP/HTTP headers are
  422.    never passed unenhanced.
  423.  
  424.    S-HTTP encapsulation of non-HTTP data is a useful mechanism for pass-
  425.    ing pre-enhanced data (especially presigned data) without requiring
  426.    that the HTTP headers themselves be pre-enhanced.
  427.  
  428.  
  429.  
  430. Rescorla, Schiffman                                              [Page 8] Internet-Draft                Secure HTTP                 
  431.  
  432.  
  433. 2.3.4.  Content-Type for MOSS
  434.  
  435.    The Content-Type for MOSS shall be an acceptable MIME content type
  436.    describing the cryptographic processing applied. (e.g.
  437.    multipart/signed). The content type of the inner content is described
  438.    in the content type line corresponding to that inner content, and for
  439.    HTTP messages shall be 'application/http'.
  440.  
  441. 2.3.5.  Prearranged-Key-Info
  442.  
  443.    This header line is intended to convey information about a key which
  444.    has been arranged outside of the internal cryptographic format. One
  445.    use of this is to permit in-band communication of session keys for
  446.    return encryption in the case where one of the parties does not have
  447.    a key pair. However, this should also be useful in the event that the
  448.    parties choose to use some other mechanism, for instance, a one-time
  449.    key list.
  450.  
  451.    This specification defines three methods for exchanging named keys,
  452.    Inband, Kerberos and Outband. Inband and Kerberos indicates that the
  453.    session key was exchanged previously, using a Key-Assign header of
  454.    the corresponding method.  Outband arrangements imply that agents
  455.    have external access to key materials corresponding to a given name,
  456.    presumably via database access or perhaps supplied immediately by a
  457.    user from keyboard input. The syntax for the header line is:
  458.  
  459.         Prearranged-Key-Info: <Hdr-Cipher>','<CoveredDEK>','<CoverKey-ID>
  460.         <CoverKey-ID> := <method>':'<key-name>
  461.         <CoveredDEK> := <hex-digits>
  462.         <method> := 'inband' | 'krb-'<kv> | 'outband'
  463.         <kv> := '4' | '5'
  464.  
  465.  
  466.    While chaining ciphers require an Initialization Vector (IV) [FIPS-
  467.    81] to start off the chaining, that information is not carried by
  468.    this field. Rather, it should be passed internal to the cryptographic
  469.    format being used. Likewise, the bulk cipher used is specified in
  470.    this fashion.
  471.  
  472.    <Hdr-Cipher> should be the name of the block cipher used to encrypt
  473.    the session key (see section 3.2.4.7)
  474.  
  475.    <CoveredDEK> is the protected Data Encryption Key (a.k.a. transaction
  476.    key) under which the encapsulated message was encrypted. It should be
  477.    appropriately (randomly) generated by the sending agent, then
  478.    encrypted under the cover of the negotiated key (a.k.a. session key)
  479.    using the indicated header cipher, and then converted into hex.
  480.  
  481.  
  482.  
  483.  
  484. Rescorla, Schiffman                                              [Page 9] Internet-Draft                Secure HTTP                 
  485.  
  486.  
  487.    In order to avoid name collisions, cover key namespaces must be main-
  488.    tained separately by host and port.
  489.  
  490.    Note that some Content-Privacy-Domains, notably likely future revi-
  491.    sions of MOSS and PKCS-7 may have support for symmetric key manage-
  492.    ment.  The Prearranged-Key-Info field need not be used in such cir-
  493.    cumstances.  Rather, the native syntax is preferred. Keys exchanged
  494.    with Key-Assign, however, may be used in this situation.
  495.  
  496. 2.3.6.  MAC-Info
  497.  
  498.    This header is used to supply a Message Authenticity Check, providing
  499.    both message authentication and integrity, computed from the message
  500.    text, the time (optional -- to prevent replay attack), and a shared
  501.    secret between client and server. The MAC should be computed over the
  502.    encapsulated content of the S-HTTP message.  S-HTTP/1.1 defined that
  503.    MACs should be computed using the following algorithm ('||' means
  504.    concatenation):
  505.  
  506.         MAC = hex(H(Message||[<time>]||<shared key>))
  507.  
  508.  
  509.    The time should be represented as an unsigned 32 bit quantity
  510.    representing seconds since 00:00:00 GMT January 1, 1970 (the UNIX
  511.    epoch), in network byte order. The shared key format is a local
  512.    matter.
  513.  
  514.    Recent research [VANO95] has demonstrated some weaknesses in this
  515.    approach, and this draft introduces a new construction, derived from
  516.    [KRAW96a]. In the name of backwards compatibility, we retain the pre-
  517.    vious constructions with the same names as before. However, we also
  518.    introduce a new series of names (See Section 3.2.4.8 for the names)
  519.    that obey a different (hopefully stronger) construction. (^ means
  520.    bitwise XOR)
  521.  
  522.  
  523.            HMAC = hex(H(K' ^ pad2 || H(K' ^ pad1 ||[<time>]|| Message)))
  524.            pad1 = the byte 0x36 repeated enough times to fill out a
  525.                    hash input block. (I.e. 64 times for both MD5 and SHA-1)
  526.            pad2 = the byte 0x5c repeated enough times to fill out a
  527.                    hash input block.
  528.            K' = H(<shared key>)
  529.  
  530.    The original HMAC construction is for the use of a key with length
  531.    equal to the length of the hash output. Although it is considered
  532.    safe to use a key of a different length (Note that strength cannot be
  533.    increased past the length of the hash function itself, but can be
  534.    reduced by using a shorter key.) [KRAW96b] we hash the original key
  535.  
  536.  
  537.  
  538. Rescorla, Schiffman                                             [Page 10] Internet-Draft                Secure HTTP                 
  539.  
  540.  
  541.    to permit the use of shared keys (e.g. passphrases) longer than the
  542.    length of the hash. It is noteworthy (though obvious) that this tech-
  543.    nique does not increase the strength of short keys.
  544.  
  545.    The format of the MAC-Info line is:
  546.  
  547.         MAC-Info: [hex(<time>)],<hash-alg>, hex(<hash-data>),<key-spec>
  548.         <time> := "unsigned seconds since Unix epoch"
  549.         <hash-alg> := "hash algorithms from section 3.2.4.8"
  550.         <hash-data> := "computation as described above"
  551.         <Key-Spec> := 'null' | 'dek' | <Key-ID>
  552.  
  553.  
  554.    Key-Ids can refer either to keys bound using the Key-Assign header
  555.    line or those bound in the same fashion as the Outband method
  556.    described later. The use of a 'Null' key-spec implies that a zero
  557.    length key was used, and therefore that the MAC merely represents a
  558.    hash of the message text and (optionally) the time.  The special
  559.    key-spec 'DEK' refers to the Data Exchange Key used to encrypt the
  560.    following message body (it is an error to use the DEK key-spec in
  561.    situations where the following message body is unencrypted).
  562.  
  563.    If the time is omitted from the MAC-Info line, it should simply not
  564.    be included in the hash.
  565.  
  566.    Note that this header line can be used to provide a more advanced
  567.    equivalent of the original HTTP Basic authentication mode in that the
  568.    user can be asked to provide a username and password. However, the
  569.    password remains private and message integrity can be assured. More-
  570.    over, this can be accomplished without encryption of any kind.
  571.  
  572.    In addition, MAC-Info permits fast message integrity verification (at
  573.    the loss of non-repudiability) for messages, provided that the parti-
  574.    cipants share a key (possibly passed using Key-Assign in a previous
  575.    message).
  576.  
  577.    Note that some Content-Privacy-Domains, notably likely future revi-
  578.    sions of MOSS and PKCS-7 may have support for symmetric integrity
  579.    protection The MAC-Info field need not be used in such circumstances.
  580.    Rather, the native syntax is preferred. Keys exchanged with Key-
  581.    Assign, however, may be used in this situation.
  582.  
  583. 2.4.  Content
  584.  
  585.    The content of the message is largely dependent upon the values of
  586.    the Content-Privacy-Domain and Content-Transfer-Encoding fields.
  587.  
  588.    For a PKCS-7 message, with '8BIT' Content-Transfer-Encoding, the
  589.  
  590.  
  591.  
  592. Rescorla, Schiffman                                             [Page 11] Internet-Draft                Secure HTTP                 
  593.  
  594.  
  595.    content should simply be the PKCS-7 message itself.
  596.  
  597.    If the Content-Transfer-Encoding is 'BASE64', the content should be
  598.    preceded by a line that reads:
  599.  
  600.            -----BEGIN PRIVACY-ENHANCED MESSAGE-----
  601.  
  602.    and followed by a line that reads
  603.  
  604.            -----END PRIVACY-ENHANCED MESSAGE-----
  605.  
  606.    (see RFC1421) with the content simply being the base-64 representa-
  607.    tion of original content. If the inner (protected) content is itself
  608.    a PKCS-7 message, then the ContentType of the outer content should be
  609.    set appropriately; else, the ContentType should be represented as
  610.    'Data'.
  611.  
  612.    If the Content-Privacy-Domain is MOSS, the content should consist of
  613.    a MOSS Security Multipart as described in RFC1847.
  614.  
  615.    It is expected that once the privacy enhancements have been removed,
  616.    the resulting (possibly protected) contents will be a normal HTTP
  617.    request. Alternately, the content may be another Secure-HTTP message,
  618.    in which case privacy enhancements should be unwrapped until clear
  619.    content is obtained or privacy enhancements can no longer be removed.
  620.    (This permits embedding of enhancements, such as sequential Signed
  621.    and Enveloped enhancements.) Provided that all enhancements can be
  622.    removed, the final de-enhanced content should be a valid HTTP request
  623.    (or response) unless otherwise specified by the Content-Type line.
  624.  
  625.    Note that this recursive encapsulation of messages potentially per-
  626.    mits security enhancements to be applied (or removed) for the benefit
  627.    of intermediaries who may be a party to the transaction between a
  628.    client and server (e.g., a proxy requiring client authentication).
  629.    How such intermediaries should indicate such processing is described
  630.    in Section 7.2.1.
  631.  
  632. 2.5.  Encapsulation Format Options
  633.  
  634. 2.5.1.  Content-Privacy-Domain: PKCS-7
  635.  
  636.    Content-Privacy-Domain 'PKCS-7' follows the form of the PKCS-7 stan-
  637.    dard (see Appendix).
  638.  
  639.    Message protection may proceed on two orthogonal axes: signature and
  640.    encryption. Any message may be either signed, encrypted, both, or
  641.    neither. Note that the 'auth' protection mode of S-HTTP is provided
  642.    independently of PKCS-7 coding via the MAC-Info header of section
  643.  
  644.  
  645.  
  646. Rescorla, Schiffman                                             [Page 12] Internet-Draft                Secure HTTP                 
  647.  
  648.  
  649.    2.3.6 since PKCS-7 does not support a 'KeyDigestedData' type,
  650.    although it does support a 'DigestedData' type.
  651.  
  652. 2.5.1.1.  Signature
  653.  
  654.    This enhancement uses the 'SignedData' (or 'SignedAndEnvelopedData')
  655.    type of PKCS-7.  When digital signatures are used, an appropriate
  656.    certificate may either be attached to the message (possibly along
  657.    with a certificate chain) as specified in PKCS-7 or the sender may
  658.    expect the recipient to obtain its certificate (and/or chain)
  659.    independently.  Note that an explicitly allowed instance of this is a
  660.    certificate signed with the private component corresponding to the
  661.    public component being attested to.  This shall be referred to as a
  662.    self-signed certificate. What, if any, weight to give to such a cer-
  663.    tificate is a purely local matter.  In either case, a purely signed
  664.    message is precisely PKCS-7 compliant.
  665.  
  666. 2.5.1.2.  Encryption
  667.  
  668. 2.5.1.2.1.  Encryption -- normal, public key
  669.  
  670.    This enhancement is performed precisely as enveloping (using either
  671.    'EnvelopedData' or 'SignedAndEnvelopedData' types) under PKCS-7. A
  672.    message encrypted in this fashion, signed or otherwise, is PKCS-7
  673.    compliant.
  674.  
  675. 2.5.1.2.2.  Encryption -- prearranged key
  676.  
  677.    This uses the 'EncryptedData' type of PKCS-7. In this mode, we
  678.    encrypt the content using a DEK encrypted under cover of a prear-
  679.    ranged session key (how this key may be exchanged is discussed
  680.    later), with key identification information specified on one of the
  681.    header lines. The IV is in the EncryptedContentInfo type of the
  682.    EncryptedData element.  To generate signed, encrypted data, it is
  683.    necessary to generate the 'SignedData' production and then encrypt it
  684.    (since PKCS-7 does not support a 'SignedAndEncryptedData' type -- see
  685.    Appendix A for a description of PKCS-7 operational modes.).
  686.  
  687. 2.5.2.  Content-Privacy-Domain: MOSS
  688.  
  689.    The body of the message should be a MIME compliant message with con-
  690.    tent type that matches the Content-Type line in the S-HTTP headers.
  691.    Encrypted messages should use multipart/encrypted. Signed messages
  692.    should use multipart/signed. However, since multipart/signed does not
  693.    convey keying material, is is acceptable to use multipart/mixed where
  694.    the first part is application/mosskey-data and the second part is
  695.    multipart/mixed in order to convey certificates for use in verifying
  696.    the signature.
  697.  
  698.  
  699.  
  700. Rescorla, Schiffman                                             [Page 13] Internet-Draft                Secure HTTP                 
  701.  
  702.  
  703.    Implementation Note: When both encryption and signature are applied
  704.    by the same agent, signature should in general be applied before
  705.    encryption.
  706.  
  707. 2.5.3.  Imported HTTP headers
  708.  
  709. 2.5.3.1.  Overview
  710.  
  711.    Some HTTP facilities, particularly those involved with caching and
  712.    proxies, require special consideration when S-HTTP processing has
  713.    been applied. Secure HTTP makes special accomodation for these
  714.    features by copying the relevant HTTP header lines into Secure HTTP
  715.    header syntax as well.
  716.  
  717.    The behavior of these headers is intended to be in line with HTTP
  718.    practice.  This text is largely paraphrased from HTTP/1.0. [BERN95b].
  719.    Note that since the semantics of some of these headers may vary
  720.    across HTTP versions, this document is the definitive reference for
  721.    the meaning of these headers when present in S-HTTP headers.
  722.  
  723. 2.5.3.2.  Connection: Keep-Alive
  724.  
  725.    The 'Connection: Keep-Alive' header is designed to permit persistent
  726.    connections between client/proxy and proxy/server pairs.  A client or
  727.    proxy which desires persistent connections should send the header
  728.    'Connection: Keep-Alive'. A server which agrees should respond with
  729.    'Connection: Keep-Alive'.
  730.  
  731.    The persistent connection ends when either side closes the connection
  732.    or after the receipt of a response which lacks the "keep-alive" key-
  733.    word. The server may close the connection immediately after respond-
  734.    ing to a request without a "keep-alive" keyword. A client can tell if
  735.    the connection will be closed by looking for a "keep-alive" in the
  736.    response.
  737.  
  738.    Proxies and gateways should remove the Keep-Alive header, though, of
  739.    course, they may optionally regenerate it if they desire a persistent
  740.    connection with the next hop. HTTP clients not using gateways and
  741.    desiring a persistent connection with the server should not use this
  742.    mechanism, but rather should use whatever mechanisms HTTP provides.
  743.  
  744. 2.5.3.3.  If-Modified-Since
  745.  
  746.    This may be used by the proxy to indicate that the document may be in
  747.    its cache and that it is prepared to serve the document to the
  748.    current requestor. Servers receiving this header and deciding not to
  749.    resend the document should respond using the 320 response code as
  750.    described in Section 5.2.5.
  751.  
  752.  
  753.  
  754. Rescorla, Schiffman                                             [Page 14] Internet-Draft                Secure HTTP                 
  755.  
  756.  
  757.    This header should only be placed in S-HTTP headers by proxies.
  758.    Clients wanting to use If-Modified-Since should place it in the HTTP
  759.    headers of the inner content.
  760.  
  761. 2.5.3.4.  Content-MD5
  762.  
  763.    Servers may generate a Content-MD5 header to enable proxies to detect
  764.    when valid cache hits have occurred. Note that the Content-MD5 header
  765.    provides the possibility of traffic analysis. Servers using this
  766.    should bear that risk in mind.
  767.  
  768.    The Content-MD5 is exactly as described in [RFC-1864] except that it
  769.    is computed on the inner content rather than on the ciphertext.
  770.  
  771. 3.  Cryptographic Parameters
  772.  
  773. 3.1.  Options Headers
  774.  
  775.    As described in Section 1.3.2, every S-HTTP request is (at least con-
  776.    ceptually) preconditioned by the negotiation options provided by the
  777.    potential receiver. The two primary locations for these options are
  778.  
  779.            1. In the headers of an HTTP Request/Response.
  780.            2. In the HTML which contains the anchor being dereferenced.
  781.  
  782.  
  783.    There are two kinds of cryptographic options which may be provided:
  784.    Negotiation options, as discussed in Section 3.2 convey a potential
  785.    message recipient's cryptographic preferences. Keying options, as
  786.    discussed in Section 3.3 provide keying material (or pointers to key-
  787.    ing material) which may be of use to the sender when enhancing a mes-
  788.    sage.
  789.  
  790.    Binding cryptographic options to anchors using HTML extensions is the
  791.    topic of the companion document draft-ietf-wts-shtml-01.txt and will
  792.    not be treated here.
  793.  
  794.  
  795.    3.2.  Negotiation Options
  796.  
  797.    3.2.1.  Negotiation Overview
  798.  
  799.    Both parties are able to express their requirements and preferences
  800.    regarding what cryptographic enhancements they will permit/require
  801.    the other party to provide. The appropriate option choices depend on
  802.    implementation capabilities and the requirements of particular appli-
  803.    cations.
  804.  
  805.  
  806.  
  807.  
  808. Rescorla, Schiffman                                             [Page 15] Internet-Draft                Secure HTTP                 
  809.  
  810.  
  811.    A negotiation header is a sequence of specifications each conforming
  812.    to a four-part schema detailing:
  813.  
  814.         Property -- the option being negotiated, such as bulk
  815.         encryption algorithm.
  816.  
  817.         Value -- the value being discussed for the property, such
  818.         as DES-CBC
  819.  
  820.         Direction -- the direction which is to be affected, namely:
  821.         during reception or origination (from the perspective of
  822.         the originator).
  823.  
  824.         Strength -- strength of preference, namely: required,
  825.         optional, refused
  826.  
  827.    As an example, the header line:
  828.  
  829.            SHTTP-Symmetric-Content-Algorithms: recv-optional=DES-CBC,RC2
  830.  
  831.    could be thought to say: ``You are free to use DES-CBC or RC2 for
  832.    bulk encryption for encrypting messages to me.''
  833.  
  834.    We define new headers (to be used in the encapsulated HTTP header,
  835.    not in the S-HTTP header) to permit negotiation of these matters.
  836.  
  837. 3.2.2.  Negotiation Option Format
  838.  
  839.    The general format for negotiation options is:
  840.  
  841.            <Option> := <Field> ':' <Key-val>(';'<Key-val>)*
  842.            <Key-val> := <Key> '=' <Value>(','<Value>)*
  843.            <Key> := <Mode>'-'<Action>
  844.            <Mode> := 'orig'|'recv'
  845.            <Action> := 'optional'|'required'|'refused'
  846.  
  847.    The <Mode> value indicates whether this <Key-val> refers to what the
  848.    agent's actions are upon sending privacy enhanced messages as opposed
  849.    to upon receiving them. For any given mode-action pair, the interpre-
  850.    tation to be placed on the enhancements (<Value>s) listed is:
  851.  
  852.          'recv-optional:' The agent will process the enhancement if
  853.         the other party uses it, but will also gladly process mes-
  854.         sages without the enhancement.
  855.  
  856.          'recv-required:' The agent will not process messages
  857.         without this enhancement.
  858.  
  859.  
  860.  
  861.  
  862. Rescorla, Schiffman                                             [Page 16] Internet-Draft                Secure HTTP                 
  863.  
  864.  
  865.          'recv-refused:' The agent will not process messages with
  866.         this enhancement.
  867.  
  868.          'orig-optional:' When encountering an agent which refuses
  869.         this enhancement, the agent will not provide it, and when
  870.         encountering an agent which requires it, this agent will
  871.         provide it.
  872.  
  873.          'orig-required:' The agent will always generate the
  874.         enhancement.
  875.  
  876.          'orig-refused:' The agent will never generate the enhance-
  877.         ment.
  878.  
  879.    The behavior of agents which discover that they are communicating
  880.    with an incompatible agent is at the discretion of the agents. It is
  881.    inappropriate to blindly persist in a behavior that is known to be
  882.    unacceptable to the other party. Plausible responses include simply
  883.    terminating the connection, or, in the case of a server response,
  884.    returning 'Not implemented 501'.
  885.  
  886.    Optional values are considered to be listed in decreasing order of
  887.    preference. Agents are free to choose any member of the intersection
  888.    of the optional lists (or none) however.
  889.  
  890.    If any <Key-Val> is left undefined, it should be assumed to be set to
  891.    the default. Any key which is specified by an agent shall override
  892.    any appearance of that key in any <Key-Val> in the default for that
  893.    field.
  894.  
  895. 3.2.3.  Parametrization for Variable-length Key Ciphers
  896.  
  897.    For ciphers with variable key lengths, values may be parametrized
  898.    using the syntax <cipher>'['<length>']'
  899.  
  900.    For example, 'RSA[1024]' represents a 1024 bit key for RSA. Ranges
  901.    may be represented as
  902.  
  903.            <cipher>'['<bound1>'-'<bound2>']'
  904.  
  905.  
  906.    For purposes of preferences, this notation should be treated as if it
  907.    read (assuming x and y are integers)
  908.  
  909.            <cipher>[x], <cipher>[x+1],...<cipher>[y] (if x<y)
  910.  
  911.    and
  912.  
  913.  
  914.  
  915.  
  916. Rescorla, Schiffman                                             [Page 17] Internet-Draft                Secure HTTP                 
  917.  
  918.  
  919.  
  920.            <cipher>[x], <cipher>[x-1],...<cipher>[y] (if x>y)
  921.  
  922.    The special value 'inf' may be used to denote infinite length.
  923.  
  924.    Using simply <cipher> for such a cipher shall be read as the maximum
  925.    range possible with the given cipher.
  926.  
  927. 3.2.4.  Negotiation Syntax
  928.  
  929. 3.2.4.1.  SHTTP-Privacy-Domains
  930.  
  931.    This header refers to the Content-Privacy-Domain type of section
  932.    2.3.1. Acceptable values are as listed there. For instance,
  933.  
  934.            SHTTP-Privacy-Domains: orig-required=pkcs-7;
  935.                                   recv-optional=pkcs-7,MOSS
  936.  
  937.    would indicate that the agent always generates PKCS-7 compliant mes-
  938.    sages, but can read PKCS-7 or MOSS (or, unenhanced messages).
  939.  
  940. 3.2.4.2.  SHTTP-Certificate-Types
  941.  
  942.    This indicates what sort of Public Key certificates the agent will
  943.    accept. Currently defined values are 'X.509' and 'X.509v3'.
  944.  
  945. 3.2.4.3.  SHTTP-Key-Exchange-Algorithms
  946.  
  947.    This header indicates which algorithms may be used for key exchange.
  948.    Defined values are 'RSA', 'Outband', 'Inband', and 'Krb-'<kv>.  RSA
  949.    refers to RSA enveloping. Outband refers to some sort of external key
  950.    agreement. Inband and Kerberos refer to the protocols of sections
  951.    3.3.3.1 and 3.3.3.2 respectively.
  952.  
  953.    The expected common configuration of clients having no certificates
  954.    and servers having certificates would look like this (in a message
  955.    sent by the server):
  956.  
  957.            SHTTP-Key-Exchange-Algorithms: orig-optional=Inband, RSA;
  958.                                           recv-required=RSA
  959.  
  960.  
  961. 3.2.4.4.  SHTTP-Signature-Algorithms
  962.  
  963.    This header indicates what Digital Signature algorithms may be used.
  964.    Defined values are 'RSA' [PKCS-1] and 'NIST-DSS' [FIPS-186] Since
  965.    NIST-DSS and RSA use variable length moduli the parametrization syn-
  966.    tax of section 3.2.3 should be used.  Note that a key length
  967.  
  968.  
  969.  
  970. Rescorla, Schiffman                                             [Page 18] Internet-Draft                Secure HTTP                 
  971.  
  972.  
  973.    specification may interact with the acceptability of a given certifi-
  974.    cate, since keys (and their lengths) are specified in public-key cer-
  975.    tificates.
  976.  
  977. 3.2.4.5.  SHTTP-Message-Digest-Algorithms
  978.  
  979.    This indicates what message digest algorithms may be used.  Previ-
  980.    ously defined values are 'RSA-MD2' [RFC-1319], 'RSA-MD5' [RFC-1321],
  981.  
  982. 3.2.4.6.  SHTTP-Symmetric-Content-Algorithms
  983.  
  984.    This header specifies the symmetric-key bulk cipher used to encrypt
  985.    message content.  Defined values are:
  986.  
  987.         DES-CBC -- DES in Cipher Block Chaining (CBC) mode [FIPS-81]
  988.         DES-EDE-CBC -- 2 Key 3DES using Encrypt-Decrypt-Encrypt in outer CBC mode
  989.         DES-EDE3-CBC -- 3 Key 3DES using Encrypt-Decrypt-Encrypt in outer CBC mode
  990.         DESX-CBC -- RSA's DESX in CBC mode
  991.         IDEA-CBC -- IDEA in CBC mode [XXXX]
  992.         RC2-CBC -- RSA's RC2 in CBC mode
  993.         CDMF-CBC -- IBM's CDMF (weakened key DES) [JOHN93] in CBC mode
  994.  
  995.    Since RC2 keys are variable length, the syntax of section 3.2.3
  996.    should be used.
  997.  
  998. 3.2.4.7.  SHTTP-Symmetric-Header-Algorithms
  999.  
  1000.    This header specifies the symmetric-key cipher used to encrypt mes-
  1001.    sage headers.
  1002.  
  1003.         DES-ECB -- DES in Electronic Codebook (ECB) mode [FIPS-81]
  1004.         DES-EDE-ECB -- 2 Key 3DES using Encrypt-Decrypt-Encrypt in ECB mode
  1005.         DES-EDE3-ECB -- 3 Key 3DES using Encrypt-Decrypt-Encrypt in ECB mode
  1006.         DESX-ECB -- RSA's DESX in ECB mode
  1007.         IDEA-ECB -- IDEA
  1008.         RC2-ECB -- RSA's RC2 in ECB mode
  1009.         CDMF-ECB -- IBM's CDMF in ECB mode
  1010.  
  1011.  
  1012.    Since RC2 is variable length, the syntax of section 3.2.3 should be
  1013.    used.
  1014.  
  1015. 3.2.4.8.  SHTTP-MAC-Algorithms
  1016.  
  1017.    This header indicates what algorithms are acceptable for use in pro-
  1018.    viding a symmetric key MAC. 'RSA-MD2', 'RSA-MD5' and 'NIST-SHS' per-
  1019.    sist from S-HTTP/1.1 using the old MAC construction. The tokens
  1020.    'RSA-MD2-HMAC', 'RSA-MD5-HMAC' and 'NIST-SHS-HMAC' indicate the new
  1021.  
  1022.  
  1023.  
  1024. Rescorla, Schiffman                                             [Page 19] Internet-Draft                Secure HTTP                 
  1025.  
  1026.  
  1027.    HMAC construction of 2.3.6 with the MD2, MD5, and SHA-1 algorithms
  1028.    respectively.
  1029.  
  1030.    3.2.4.9.  SHTTP-Privacy-Enhancements
  1031.  
  1032.    This header indicates security enhancements to apply.  Possible
  1033.    values are 'sign', 'encrypt' and 'auth' indicating whether messages
  1034.    are signed, encrypted, or authenticated (i.e., provided with a MAC),
  1035.    respectively.
  1036.  
  1037. 3.2.4.10.  Your-Key-Pattern
  1038.  
  1039.    This is a generalized pattern match syntax to describe identifiers
  1040.    for a large number of types of keying material. The general syntax
  1041.    is:
  1042.  
  1043.         Your-Key-Pattern : <key-use>','<pattern-info>
  1044.         <key-use> := 'cover-key' | 'auth-key' | 'signing-key' | 'krbID-'<kv>
  1045.  
  1046.  
  1047. 3.2.4.10.1.  Cover Key Patterns
  1048.  
  1049.    This header specifies desired values for key names used for encryp-
  1050.    tion of transaction keys using the Prearranged-Key-Info syntax of
  1051.    section 2.3.5.  The pattern-info syntax consists of a series of comma
  1052.    separated regular expressions. Commas should be escaped with
  1053.    backslashes if they appear in the regexps. The first pattern should
  1054.    be assumed to be the most preferred.
  1055.  
  1056. 3.2.4.10.2.  Auth key patterns
  1057.  
  1058.    Auth-key patterns specify name forms desired for use for MAC authen-
  1059.    ticators.  The pattern-info syntax consists of a series of comma
  1060.    separated regular expressions. Commas should be escaped with
  1061.    backslashes if they appear in the regexps. The first pattern should
  1062.    be assumed to be the most preferred.
  1063.  
  1064. 3.2.4.10.3.  Signing Key Pattern
  1065.  
  1066.    This parameter describes a pattern or patterns for what keys are
  1067.    acceptable for signing for the digital signature enhancement.  The
  1068.    pattern-info syntax for signing-key is:
  1069.  
  1070.            <pattern-info> := <name-domain>','<pattern-data>
  1071.  
  1072.  
  1073.    The only currently defined name-domain is 'DN-1485'.  This parameter
  1074.    specifies desired values for fields of Distinguished Names.  DNs are
  1075.  
  1076.  
  1077.  
  1078. Rescorla, Schiffman                                             [Page 20] Internet-Draft                Secure HTTP                 
  1079.  
  1080.  
  1081.    considered to be represented as specified in RFC1485, the order of
  1082.    fields and whitespace between fields is not significant.
  1083.  
  1084.    All RFC1485 values should use ',' as a separator rather than ';',
  1085.    since ';' is used as a statement separator in S-HTTP.
  1086.  
  1087.    Pattern-data is a modified RFC1485 string, with regular expressions
  1088.    permitted as field values.  Pattern match is performed field-wise,
  1089.    unspecified fields match any value (and therefore leaving the DN-
  1090.    Pattern entirely unspecified allows for any DN). Certificate chains
  1091.    may be matched as well (to allow for certificates without name subor-
  1092.    dination). DN chains are considered to be ordered left-to-right with
  1093.    the issuer of a given certificate on its immediate right, although
  1094.    issuers need not be specified. A trailing '.' indicates that the
  1095.    sequence of DNs is absolute. I.e. that the one furthest to the right
  1096.    is a root.
  1097.  
  1098.    The syntax for the pattern values is,
  1099.  
  1100.         <Value> := <DN-spec> (','<Dn-spec>)*[.]
  1101.         <Dn-spec> := '/'<Field-spec>*'/'
  1102.         <Field-spec> := <Attr>'='<Pattern>
  1103.         <Attr> := 'CN' | 'L' | 'ST' | 'O' |
  1104.                    'OU' | 'C' | "or as appropriate"
  1105.         <Pattern> := "POSIX 1003.2 regular expressions"
  1106.  
  1107.  
  1108.    For example, to request that the other agent sign with a key certi-
  1109.    fied by the RSA Persona CA (which uses name subordination) one could
  1110.    use the expression below.  Note the use of RFC1485 quoting to protect
  1111.    the comma (an RFC1485 field separator) and the POSIX 1003.2 quoting
  1112.    to protect the dot (a regular expression metacharacter).
  1113.       Your-Key-Pattern: signing-key, DN-1485,
  1114.                   /OU=Persona Certificate, O="RSA Data Security, Inc\."/
  1115.  
  1116. 3.2.4.11.  Example
  1117.  
  1118.    A representative header block for a server follows.
  1119.  
  1120.         SHTTP-Privacy-Domains: recv-optional=MOSS, PKCS-7;
  1121.               orig-required=PKCS-7
  1122.         SHTTP-Certificate-Types: recv-optional=X.509;
  1123.               orig-required=X.509
  1124.         SHTTP-Key-Exchange-Algorithms: recv-required=RSA;
  1125.               orig-optional=Inband,RSA
  1126.         SHTTP-Signature-Algorithms: orig-required=RSA; recv-required=RSA
  1127.         SHTTP-Privacy-Enhancements: orig-required=sign;
  1128.               orig-optional=encrypt
  1129.  
  1130.  
  1131.  
  1132. Rescorla, Schiffman                                             [Page 21] Internet-Draft                Secure HTTP                 
  1133.  
  1134.  
  1135. 3.2.4.12.  Defaults
  1136.  
  1137.    Explicit negotiation parameters take precedence over default values.
  1138.    For a given negotiation option type, defaults for a given mode-action
  1139.    pair (such as 'orig-required') are implicitly merged unless expli-
  1140.    citly overridden.
  1141.  
  1142.    The default values (these may be negotiated downward or upward) are:
  1143.  
  1144.         SHTTP-Privacy-Domains: orig-optional=PKCS-7, MOSS;
  1145.                                recv-optional=PKCS-7, MOSS
  1146.         SHTTP-Certificate-Types: orig-optional=X.509;
  1147.                                  recv-optional=X.509
  1148.         SHTTP-Key-Exchange-Algorithms: orig-optional=RSA,Inband,Outband;
  1149.                                        recv-optional=RSA,Inband,Outband
  1150.         SHTTP-Signature-Algorithms: orig-optional=RSA; recv-optional=RSA
  1151.         SHTTP-Message-Digest-Algorithms: orig-optional=RSA-MD5;
  1152.                                          recv-optional=RSA-MD5
  1153.         SHTTP-Symmetric-Content-Algorithms: orig-optional=DES-CBC;
  1154.                                             recv-optional=DES-CBC
  1155.         SHTTP-Symmetric-Header-Algorithms: orig-optional=DES-ECB;
  1156.                                            recv-optional=DES-ECB
  1157.         SHTTP-Privacy-Enhancements: orig-optional=sign,encrypt, auth;
  1158.                                             recv-required=encrypt;
  1159.                                             recv-optional=sign, auth
  1160.  
  1161.  
  1162. 3.3.  Non-Negotiation Headers
  1163.  
  1164.    There are a number of options that are used to communicate or iden-
  1165.    tify the potential recipient's keying material.
  1166.  
  1167. 3.3.1.  Encryption-Identity
  1168.  
  1169.    This header identifies a potential principal for whom the message
  1170.    described by these options could be encrypted; Note that this expli-
  1171.    citly permits return encryption under (say) public key without the
  1172.    other agent signing first (or under a different key than that of the
  1173.    signature). Or, in the Kerberos case, provides information as the
  1174.    agent's Kerberos identity.  The syntax of the Encryption-Identity
  1175.    line is:
  1176.  
  1177.            Encryption-Identity: <name-class>,<key-sel>,<name-arg>
  1178.            <name-class> := 'DN-1485' | MOSS name forms
  1179.  
  1180.    The name-class is an ASCII string representing the domain within
  1181.    which the name is to be interpreted, in the spirit of the new MOSS
  1182.    drafts. In addition to the MOSS name forms of RFC1848, we add the
  1183.  
  1184.  
  1185.  
  1186. Rescorla, Schiffman                                             [Page 22] Internet-Draft                Secure HTTP                 
  1187.  
  1188.  
  1189.    DN-1485 name form to represent a more convenient form of dis-
  1190.    tinguished name.
  1191.  
  1192.    Note: The Kerberos name forms of previous drafts are subsumed by the
  1193.    MOSS email string form.
  1194.  
  1195. 3.3.1.1.  DN-1485 Name Class
  1196.  
  1197.    The argument is an RFC-1485 encoded DN.
  1198.  
  1199. 3.3.2.  Certificate-Info
  1200.  
  1201.    In order to permit public key operations on DNs specified by
  1202.    Encryption-Identity headers without explicit certificate fetches by
  1203.    the receiver, the sender may include certification information in the
  1204.    Certificate-Info option. The format of this option is:
  1205.  
  1206.            Certificate-Info: <Cert-Fmt>','<Cert-Group>
  1207.  
  1208.    <Cert-Fmt> should be the type of <Cert-Group> being presented.
  1209.    Defined values are 'PEM' and 'PKCS-7'. PKCS-7 certificate groups are
  1210.    provided as a base-64 encoded PKCS-7 SignedData message containing
  1211.    sequences of certificates with or without the SignerInfo field. A PEM
  1212.    format certificate group is a list of comma-separated base64-encoded
  1213.    PEM certificates.
  1214.  
  1215.    Multiple Certificate-Info lines may be defined.
  1216.  
  1217. 3.3.3.  Key-Assign
  1218.  
  1219.    This option serves to indicate that the agent wishes to bind a key to
  1220.    a symbolic name for (presumably) later reference.
  1221.  
  1222.    The general syntax of the key-assign header is:
  1223.  
  1224.         Key-Assign: <Method>,<Key-Name>,<Lifetime>,<Ciphers>;<Method-args>
  1225.  
  1226.         <Key-name> := <string>
  1227.         <Lifetime> := 'this' | 'reply' | ''
  1228.         <Method> :='inband' | 'krb-'<kv>
  1229.         <Ciphers> := 'null' | <Cipher>+
  1230.         <Cipher> := "Header cipher from section 3.2.4.7"
  1231.         <kv> := '4' | '5'
  1232.  
  1233.  
  1234.    Key-Name is the symbolic name to which this key is to be bound.
  1235.    Ciphers is a list of ciphers for which this key is potentially appli-
  1236.    cable (see the list of header ciphers in section 3.2.4.7).  The
  1237.  
  1238.  
  1239.  
  1240. Rescorla, Schiffman                                             [Page 23] Internet-Draft                Secure HTTP                 
  1241.  
  1242.  
  1243.    keyword 'null' should be used to indicate that it is inappropriate
  1244.    for use with ANY cipher. This is potentially useful for exchanging
  1245.    keys for MAC computation.
  1246.  
  1247.    Lifetime is a representation of the longest period of time during
  1248.    which the recipient of this message can expect the sender to accept
  1249.    that key. 'this' indicates that it is likely to be valid only for
  1250.    reading this transmission. 'reply' indicates that it is useful for a
  1251.    reply to this message.  If a Key-Assign with the reply lifetime
  1252.    appears in a CRYPTOPTS block, it indicates that it is good for at
  1253.    least one (but perhaps only one) dereference of this anchor.  An
  1254.    unspecified lifetime implies that this key may be reused for an inde-
  1255.    finite number of transactions.
  1256.  
  1257.    Method should be one of a number of key exchange methods.  The
  1258.    currently defined values are 'inband', 'krb-4' and 'krb-5', referring
  1259.    respectively to Inband keys (i.e., direct assignment) and Kerberos
  1260.    versions 4 and 5 respectively. Method-args will depend on methods.
  1261.  
  1262.    This header line may appear either in an unencapsulated header or in
  1263.    an encapsulated message, though when an uncovered key is being
  1264.    directly assigned, it may only appear in an encrypted encapsulated
  1265.    content. Assigning to a key that already exists causes that key to be
  1266.    overwritten.
  1267.  
  1268.    Keys defined by this header are referred to elsewhere in this specif-
  1269.    ication as Key-IDs, which have the syntax:
  1270.  
  1271.            <Key-ID> := <method>':'<key-name>
  1272.  
  1273.  
  1274.    Key-Assign may also be used as a header line in the S-HTTP headers if
  1275.    the data it is carrying does not need to be secured itself, e.g. with
  1276.    Kerberos.
  1277.  
  1278. 3.3.3.1.  Inband Key Assignment
  1279.  
  1280.    This refers to the direct assignment of an uncovered key to a sym-
  1281.    bolic name. Method-args should be just the desired session key
  1282.    encoded in hexidecimal as in:
  1283.  
  1284.         Key-Assign: inband,akey,reply,DES-ECB;0123456789abcdef
  1285.  
  1286.  
  1287.    Short keys should be derived from long keys by reading bits from left
  1288.    to right.
  1289.  
  1290.    Note that inband key assignment is especially important in order to
  1291.  
  1292.  
  1293.  
  1294. Rescorla, Schiffman                                             [Page 24] Internet-Draft                Secure HTTP                 
  1295.  
  1296.  
  1297.    permit confidential spontaneous communication between agents where
  1298.    one (but not both) of the agents have key pairs.  However, this
  1299.    mechanism is also useful to permit key changes without public key
  1300.    computations. The key information is carried in this header line must
  1301.    be in the inner secured HTTP request, therefore use in unencrypted
  1302.    messages is not permitted.
  1303.  
  1304. 3.3.3.2.  Kerberos Key Assignment
  1305.  
  1306.    This permits the binding of the shared secret derived from a Kerberos
  1307.    ticket/authenticator pair to a symbolic keyname.  In this case,
  1308.    method-args should be the ticket/authenticator pair (each base64-
  1309.    encoded), comma separated. For example:
  1310.  
  1311.         Key-Assign: krb-4,akerbkey,reply,DES-ECB;<krb-ticket>,<krb-auth>
  1312.  
  1313.  
  1314. 3.3.4.  Nonces
  1315.  
  1316.    Nonces are opaque, transient, session-oriented identifiers which may
  1317.    be used to provide demonstrations of freshness. Nonce values are a
  1318.    local matter, although they are might well be simply random numbers
  1319.    generated by the originator. The value is supplied simply to be
  1320.    returned by the recipient.
  1321.  
  1322. 3.3.4.1.  Nonce
  1323.  
  1324.    This header is used by an originator to specify what value is to be
  1325.    returned in the reply. The field may be any value. Multiple nonces
  1326.    may be supplied, each to be echoed independently.
  1327.  
  1328.    The Nonce should be returned in a Nonce-Echo header line. See section
  1329.    4.1.1.
  1330.  
  1331. 3.4.  Grouping Headers With SHTTP-Cryptopts
  1332.  
  1333.    In order for servers to bind a group of headers to an HTML anchor, it
  1334.    is possible to combine a number of headers on a single S-HTTP Cryp-
  1335.    topts header line. The names of the anchors to which these headers
  1336.    apply is indicated with a 'scope' parameter.
  1337.  
  1338. 3.4.1.  SHTTP-Cryptopts
  1339.  
  1340.    This option provides a set of cryptopts and a list of references to
  1341.    which it applies. (For HTML, these references would be named using
  1342.    the NAME tag). The names are provided in the scope attribute as a
  1343.    comma separated list and separated from the next header line by a
  1344.    semicolon. The format for the SHTTP-Cryptopts line is:
  1345.  
  1346.  
  1347.  
  1348. Rescorla, Schiffman                                             [Page 25] Internet-Draft                Secure HTTP                 
  1349.  
  1350.  
  1351.  
  1352.            SHTTP-Cryptopts: <scope>';'<cryptopt-list>
  1353.            <scope> := 'scope='<tag-spec>
  1354.            <tag-spec> := <tag>(','<tag>)* | <null>
  1355.            <cryptopt-list> := <cryptopt>(';'<cryptopt>)*
  1356.            <cryptopt> := "S-HTTP cryptopt lines described below"
  1357.            <tag> := "value used in HTML anchor NAME attribute"
  1358.  
  1359.  
  1360.    For example:
  1361.  
  1362.            SHTTP-Cryptopts: scope=tag1,tag2;
  1363.                    SHTTP-Privacy-Domains:
  1364.                    orig-required=pkcs-7; recv-optional=pkcs-7,MOSS
  1365.  
  1366.  
  1367.    If a message contains both S-HTTP negotiation headers and headers
  1368.    grouped on SHTTP-Cryptopts line(s), the other headers shall be taken
  1369.    to apply to all anchors not bound on the SHTTP-Cryptopts line(s).
  1370.    Note that this is an all-or-nothing proposition. That is, if a
  1371.    SHTTP-Cryptopts header binds options to a reference, then none of
  1372.    these global options apply, even if some of the options headers do
  1373.    not appear in the bound options. Rather, the S-HTTP defaults found in
  1374.    Section 3.2.4.11 apply.
  1375.  
  1376. 4.  New Header Lines for HTTP
  1377.  
  1378.    Two non-negotiation header lines for HTTP are defined here.
  1379.  
  1380. 4.1.  Security-Scheme
  1381.  
  1382.    All S-HTTP compliant agents must generate the Security-Scheme header
  1383.    in the headers of all HTTP messages they generate. This header per-
  1384.    mits other agents to detect that they are communicating with an S-
  1385.    HTTP compliant agent and generate the appropriate cryptographic
  1386.    options headers.
  1387.  
  1388.    For implementations compliant with this specification, the value must
  1389.    be 'S-HTTP/1.2'.
  1390.  
  1391. 4.1.1.  Nonce-Echo
  1392.  
  1393.    The header is used to return the value provided in a previously
  1394.    received Nonce: field. This has to go in the encapsulated headers so
  1395.    that it an be cryptographically protected.
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402. Rescorla, Schiffman                                             [Page 26] Internet-Draft                Secure HTTP                 
  1403.  
  1404.  
  1405. 5.  (Retriable) Server Status Error Reports
  1406.  
  1407.    We describe here the special processing appropriate for client
  1408.    retries in the face of servers returning an error status.
  1409.  
  1410. 5.1.  Retry for Option (Re)Negotiation
  1411.  
  1412.    A server may respond to a client request with an error code that
  1413.    indicates that the request has not completely failed but rather that
  1414.    the client may possibly achieve satisfaction through another request.
  1415.    HTTP already has this concept with the 3XX redirection codes.
  1416.  
  1417.    In the case of S-HTTP, it is conceivable (and indeed likely) that the
  1418.    server expects the client to retry his request using another set of
  1419.    cryptographic options. E.g., the document which contains the anchor
  1420.    that the client is dereferencing is old and did not require digital
  1421.    signature for the request in question, but the server now has a pol-
  1422.    icy requiring signature for dereferencing this URL. These options
  1423.    should be carried in the header of the encapsulated HTTP message,
  1424.    precisely as client options are carried.
  1425.  
  1426.    The general idea is that the client will perform the retry in the
  1427.    manner indicated by the combination of the original request and the
  1428.    precise nature of the error and the cryptographic enhancements
  1429.    depending on the options carried in the server response.
  1430.  
  1431.    The guiding principle in client response to these errors should be to
  1432.    provide the user with the same sort of informed choice with regard to
  1433.    dereference of these anchors as with normal anchor dereference. For
  1434.    instance, in the case above, it would be inappropriate for the client
  1435.    to sign the request without requesting permission for the action.
  1436.  
  1437. 5.2.  Specific Retry Behavior
  1438.  
  1439. 5.2.1.  Unauthorized 401, PaymentRequired 402
  1440.  
  1441.    The HTTP errors 'Unauthorized 401', 'PaymentRequired 402' represent
  1442.    failures of HTTP style authentication and payment schemes. While S-
  1443.    HTTP has no explicit support for these mechanisms, they can be per-
  1444.    formed under S-HTTP while taking advantage of the privacy services
  1445.    offered by S-HTTP. (There are other errors for S-HTTP specific
  1446.    authentication errors.)
  1447.  
  1448. 5.2.2.  420 SecurityRetry
  1449.  
  1450.    This server status reply is provided so that the server may inform
  1451.    the client that although the current request is rejected, a retried
  1452.    request with different cryptographic enhancements is worth
  1453.  
  1454.  
  1455.  
  1456. Rescorla, Schiffman                                             [Page 27] Internet-Draft                Secure HTTP                 
  1457.  
  1458.  
  1459.    attempting. This header shall also be used in the case where an HTTP
  1460.    request has been made but an S-HTTP request should have been made.
  1461.    Obviously, this serves no useful purpose other than signalling an
  1462.    error if the original request should have been encrypted, but in
  1463.    other situations (e.g. access control) may be useful.
  1464.  
  1465. 5.2.2.1.  SecurityRetries for S-HTTP Requests
  1466.  
  1467.    In the case of a request that was made as an SHTTP request, it indi-
  1468.    cates that for some reason the cryptographic enhancements applied to
  1469.    the request were unsatisfactory and that the request should be
  1470.    repeated with the options found in the response header.  Note that
  1471.    this can be used as a way to force a new public key negotiation if
  1472.    the session key in use has expired or to supply a unique nonce for
  1473.    the purposes of ensuring request freshness.
  1474.  
  1475. 5.2.2.2.  SecurityRetries for HTTP Requests
  1476.  
  1477.    If the 420 code is returned in response to an HTTP request, it indi-
  1478.    cates that the request should be retried using S-HTTP and the crypto-
  1479.    graphic options indicated in the response header.
  1480.  
  1481. 5.2.3.  421 BogusHeader
  1482.  
  1483.    This error code indicates that something about the S-HTTP request was
  1484.    bad. The error code is to be followed by an appropriate explanation,
  1485.    e.g.:
  1486.  
  1487.            421 BogusHeader Content-Privacy-Domain must be specified
  1488.  
  1489.  
  1490. 5.2.4.  422 SHTTP Proxy Authentication Required
  1491.  
  1492.    This response is analagous to the 420 response except that the
  1493.    options in the message refer to enhancements that the client must
  1494.    perform in order to satisfy the proxy.
  1495.  
  1496. 5.2.5.  320 SHTTP Not Modifed
  1497.  
  1498.    This response code is specifically for use with proxy-server interac-
  1499.    tion where the proxy has placed the If-Modified-Since header in the
  1500.    S-HTTP headers of its request. This response indicates that the fol-
  1501.    lowing S-HTTP message contains sufficient keying material for the
  1502.    proxy to forward the cached document for the new requestor.
  1503.  
  1504.    In general, this takes the form of an S-HTTP message where the actual
  1505.    enhanced content is missing, but all the headers and keying material
  1506.    are retained. (I.e. the optional content section of the PKCS7 message
  1507.  
  1508.  
  1509.  
  1510. Rescorla, Schiffman                                             [Page 28] Internet-Draft                Secure HTTP                 
  1511.  
  1512.  
  1513.    has been removed.) So, if the original response was encrypted, the
  1514.    response contains the original DEK re-covered for the new recipient.
  1515.    (Notice that the server performs the same processing as it would have
  1516.    in the server side caching case of 7.1 except that the message body
  1517.    is elided.)
  1518.  
  1519. 5.2.6.  Redirection 3XX
  1520.  
  1521.    These headers are again internal to HTTP, but may contain S-HTTP
  1522.    negotiation options of significance to S-HTTP. The request should be
  1523.    redirected in the sense of HTTP, with appropriate cryptographic pre-
  1524.    cautions being observed.
  1525.  
  1526. 5.3.  Limitations On Automatic Retries
  1527.  
  1528.    Permitting automatic client retry in response to this sort of server
  1529.    response permits several forms of attack.  Consider for the moment
  1530.    the simple credit card case:
  1531.  
  1532.         The user views a document which requires his credit card.
  1533.         The user verifies that the DN of the intended recipient is
  1534.         acceptable and that the request will be encrypted and
  1535.         dereferences the anchor.  The attacker intercepts the
  1536.         server's reply and responds with a message encrypted under
  1537.         the client's public key containing the Moved 301 header. If
  1538.         the client were to automatically perform this redirect it
  1539.         would allow compromise of the user's credit card.
  1540.  
  1541. 5.3.1.  Automatic Encryption Retry
  1542.  
  1543.    This shows one possible danger of automatic retries -- potential
  1544.    compromise of encrypted information. While it is impossible to con-
  1545.    sider all possible cases, clients should never automatically reen-
  1546.    crypt data unless the server requesting the retry proves that he
  1547.    already has the data. So, situations in which it would be acceptable
  1548.    to reencrypt would be if:
  1549.  
  1550.         1. The retry response was returned encrypted under an inband key
  1551.         freshly generated for the original request.
  1552.         2. The retry response was signed by the intended recipient of the
  1553.         original request.
  1554.         3. The original request used an outband key and the response is
  1555.         encrypted under that key.
  1556.  
  1557.  
  1558.    This is not an exhaustive list, however the browser author would be
  1559.    well advised to consider carefully before implementing automatic
  1560.    reencryption in other cases. Note that an appropriate behavior in
  1561.  
  1562.  
  1563.  
  1564. Rescorla, Schiffman                                             [Page 29] Internet-Draft                Secure HTTP                 
  1565.  
  1566.  
  1567.    cases where automatic reencryption is not appropriate is to query the
  1568.    user for permission.
  1569.  
  1570. 5.3.2.  Automatic Signature Retry
  1571.  
  1572.    Since we discourage automatic (without user confirmation) signing in
  1573.    even the usual case, and given the dangers described above, it is
  1574.    prohibited to automatically retry signature enchancement.
  1575.  
  1576. 5.3.3.  Automatic MAC Authentication Retry
  1577.  
  1578.    Assuming that all the other conditions are followed, it is permissi-
  1579.    ble to automatically retry MAC authentication.
  1580.  
  1581. 6.  Other Issues
  1582.  
  1583. 6.1.  Compatibility of Servers with Old Clients
  1584.  
  1585.    Servers which receive requests in the clear which should be secured
  1586.    should return 'SecurityRetry 420' with header lines set to indicate
  1587.    the required privacy enhancements.
  1588.  
  1589. 6.2.  URL Protocol Type
  1590.  
  1591.    We define a new URL protocol designator, 'shttp'. Use of this desig-
  1592.    nator as part of an anchor URL implies that the target server is S-
  1593.    HTTP capable, and that a dereference of this URL should undergo S-
  1594.    HTTP processing.
  1595.  
  1596.    Note that S-HTTP oblivious agents should not be willing to derefer-
  1597.    ence a URL with an unknown protocol specifier, and hence sensitive
  1598.    data will not be accidentally sent in the clear by users of non-
  1599.    secure clients.
  1600.  
  1601. 6.3.  Server Conventions
  1602.  
  1603. 6.3.1.  Certificate Requests
  1604.  
  1605.    We define the convention that issuing a normal HTTP request:
  1606.  
  1607.            GET /SERVER-CERTIFICATE[<B64-DN>] <http-version>
  1608.  
  1609.    shall cause the server to return the corresponding certificate.
  1610.    <B64-DN> is the base-64 encoding (to protect whitespace) of the
  1611.    fully-specified canonical ASCII form for the DN of the requested cer-
  1612.    tificate (as in RFC 1485). If no DN is specified, then the server
  1613.    shall choose whatever certificate it deems most appropriate. The
  1614.    server should sign the response with the key corresponding to the DN
  1615.  
  1616.  
  1617.  
  1618. Rescorla, Schiffman                                             [Page 30] Internet-Draft                Secure HTTP                 
  1619.  
  1620.  
  1621.    supplied.
  1622.  
  1623. 6.3.2.  Policy Requests
  1624.  
  1625.    Servers should (but not must) store the policies of the Policy Cer-
  1626.    tification Authorities, if available, corresponding to their various
  1627.    certificates. The convention for retrieving such policies via HTTP is
  1628.    the request:
  1629.  
  1630.            GET /POLICY-<B64-DN> <http-version>
  1631.  
  1632.    Again, <B64-DN> is the DN (encoded as per section 6.3.1) of the cer-
  1633.    tificate corresponding to the requested policy. It is recommended
  1634.    that this document be (pre-) signed by the PCA.
  1635.  
  1636. 6.3.3.  CRL Requests
  1637.  
  1638.    Servers should (but not must) store the CRLs of the PCAs correspond-
  1639.    ing to their various certificates. The convention for retrieving such
  1640.    CRLs is:
  1641.  
  1642.            GET /CRL-<B64-DN> <http-version>
  1643.  
  1644.    Again, <B64-DN> is the DN (encoded as per section 6.3.1) of the cer-
  1645.    tificate corresponding to the requested CRL.
  1646.  
  1647. 6.4.  Browser Presentation
  1648.  
  1649. 6.4.1.  Transaction Security Status
  1650.  
  1651.    While preparing a secure message, the browser should provide a visual
  1652.    indication of the security of the transaction, as well as an indica-
  1653.    tion of the party who will be able to read the message. While reading
  1654.    a signed and/or enveloped message, the browser should indicate this
  1655.    and (if applicable) the identity of the signer. Self-signed certifi-
  1656.    cates should be clearly differentiated from those validated by a cer-
  1657.    tification hierarchy.
  1658.  
  1659. 6.4.2.  Failure Reporting
  1660.  
  1661.    Failure to authenticate or decrypt an S-HTTP message should be
  1662.    presented differently from a failure to retrieve the document. Com-
  1663.    pliant clients may at their option display unverifiable documents but
  1664.    must clearly indicate that they were unverifiable in a way clearly
  1665.    distinct from the manner in which they display documents which pos-
  1666.    sessed no digital signatures or documents with verifiable signatures.
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672. Rescorla, Schiffman                                             [Page 31] Internet-Draft                Secure HTTP                 
  1673.  
  1674.  
  1675. 6.4.3.  Certificate Management
  1676.  
  1677.    Clients shall provide a method for determining that HTTP requests are
  1678.    to be signed and for determining which (assuming there are many) cer-
  1679.    tificate is to be used for signature. It is suggested that users be
  1680.    presented with some sort of selection list from which they may choose
  1681.    a default. No signing should be performed without some sort of expli-
  1682.    cit user interface action, though such action may take the form of a
  1683.    persistent setting via a user preferences mechanism (although this is
  1684.    discouraged.)
  1685.  
  1686. 6.4.4.  Anchor Dereference
  1687.  
  1688.    Clients shall provide a method to display the DN and certificate
  1689.    chain associated with a given anchor to be dereferenced so that users
  1690.    may determine for whom their data is being encrypted.  This should be
  1691.    distinct from the method for displaying who has signed the document
  1692.    containing the anchor since these are orthogonal pieces of encryption
  1693.    information.
  1694.  
  1695. 7.  Implementation Notes
  1696.  
  1697. 7.1.  Preenhanced Data
  1698.  
  1699.    While S-HTTP has always supported preenhanced documents, in previous
  1700.    versions it was never made clear how to actually implement them.
  1701.    This section describes two methods for doing so: preenhancing the
  1702.    HTTP request/response and preenhancing the underlying data.
  1703.  
  1704. 7.1.1.  Motivation
  1705.  
  1706.    The two primary motivations for preenhanced documents are security
  1707.    and performance. These advantages primarily accrue to signing but may
  1708.    also under special circumstances apply to confidentiality or repudi-
  1709.    able (MAC-based) authentication.
  1710.  
  1711.    Consider the case of a server which repeatedly serves the same con-
  1712.    tent to multiple clients. One such example would be a server which
  1713.    serves catalogs or price lists. Clearly, customers would like to be
  1714.    able to verify that these are actual prices. However, since the
  1715.    prices are typically the same to all comers, confidentiality is not
  1716.    an issue. (Note: see Section 7.1.5 below for how to deal with this
  1717.    case as well).
  1718.  
  1719.    Consequently, the server might wish to sign the document once and
  1720.    simply send the cached signed document out when a client makes a new
  1721.    request, avoiding the overhead of a private key operation each time.
  1722.    Note that conceivably, the signed document might have been generated
  1723.  
  1724.  
  1725.  
  1726. Rescorla, Schiffman                                             [Page 32] Internet-Draft                Secure HTTP                 
  1727.  
  1728.  
  1729.    by a third party and placed in the server's cache. The server might
  1730.    not even have the signing key! This illustrates the security benefit
  1731.    of presigning: Untrusted servers can serve authenticated data without
  1732.    risk even if the server is compromised.
  1733.  
  1734. 7.1.2.  Presigned Requests/Responses
  1735.  
  1736.    The obvious implementation is simply to take a single
  1737.    request/response, cache it, and send it out in situations where a new
  1738.    message would otherwise be generated.
  1739.  
  1740. 7.1.3.  Presigned Documents
  1741.  
  1742.    It is also possible using S-HTTP to sign the underlying data and send
  1743.    it as an S-HTTP messsage. In order to do this, one would take the
  1744.    signed document (a PKCS-7 or MOSS message) and attach both S-HTTP
  1745.    headers (e.g. the S-HTTP request/response line, the Content-Privacy-
  1746.    Domain)  and  the necessary HTTP headers (including a Content-Type
  1747.    that reflects the inner content).
  1748.  
  1749.            SECURE * Secure-HTTP/1.2
  1750.            Content-Type: text/html
  1751.            Content-Privacy-Domain: PKCS-7
  1752.            Content-Transfer-Encoding: base64
  1753.  
  1754.            -----BEGIN PRIVACY-ENHANCED MESSAGE-----
  1755.            Random signed message here...
  1756.            -----END PRIVACY-ENHANCED MESSAGE-----
  1757.  
  1758.  
  1759.    This message itself cannot be sent, but needs to be recursively
  1760.    encapsulated, as described in the next section.
  1761.  
  1762. 7.1.4.  Recursive Encapsulation
  1763.  
  1764.    As required by Section 7.3, the result above needs to be itself
  1765.    encapsulated to protect the HTTP headers. the obvious case [and the
  1766.    one illustrated here] is when confidentiality is required, but the
  1767.    auth enhancement or even the null transform might be applied instead.
  1768.    That is, the message shown above can be used as the inner content of
  1769.    a new S-HTTP message, like so:
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780. Rescorla, Schiffman                                             [Page 33] Internet-Draft                Secure HTTP                 
  1781.  
  1782.  
  1783.  
  1784.         SECURE * Secure-HTTP/1.2
  1785.         Content-Type: application/s-http
  1786.         Content-Privacy-Domain: PKCS-7
  1787.         Content-Transfer-Encoding: base64
  1788.  
  1789.         -----BEGIN PRIVACY-ENHANCED MESSAGE-----
  1790.         Encrypted version of the message above...
  1791.         -----END PRIVACY-ENHANCED MESSAGE-----
  1792.  
  1793.  
  1794.    To unfold this, the receiver would decode the outer S-HTTP message,
  1795.    reenter the (S-)HTTP parsing loop to process the new message, see
  1796.    that that too was S-HTTP, decode that, and recover the inner content.
  1797.  
  1798.    Note that this approach can also be used to provide freshness of
  1799.    server activity (though not of the document itself) while still pro-
  1800.    viding nonrepudiation of the document data if a NONCE is included in
  1801.    the request.
  1802.  
  1803. 7.1.5.  Preencrypted Messages
  1804.  
  1805.    Although preenhancement works best with signature, it can also be
  1806.    used with encryption under certain conditions. Consider the situation
  1807.    where the same confidential document is to be sent out repeatedly.
  1808.    The time spent to encrypt can be saved by caching the ciphertext and
  1809.    simply generating a new key exchange block for each recipient. [Note
  1810.    that this is logically equivalent to a multi- recipient message as
  1811.    defined in both MOSS and PKCS-7 and so care must be taken to use
  1812.    proper PKCS-1 padding if RSA is being used since otherwise, one may
  1813.    be open to a low encryption exponent attack.[HAST96]
  1814.  
  1815. 7.2.  Proxy Interaction
  1816.  
  1817.    The use of S-HTTP presents implementation issues to the use of HTTP
  1818.    proxies. While simply having the proxy blindly forward responses is
  1819.    straightforward, it would be preferable if S-HTTP aware proxies were
  1820.    still able to cache responses in at least some circumstances. In
  1821.    addition, S-HTTP services should be usable to protect client-proxy
  1822.    authentication. This section describes how to achieve those goals
  1823.    using the mechanisms described above.
  1824.  
  1825. 7.2.1.  Client-Proxy Authentication
  1826.  
  1827.    When an S-HTTP aware proxy receives a request (HTTP or S-HTTP) that
  1828.    (by whatever access control rules it uses) it requires to be S-HTTP
  1829.    authenticated (and if it isn't already so), it should return the 422
  1830.    response code (5.7.4).
  1831.  
  1832.  
  1833.  
  1834. Rescorla, Schiffman                                             [Page 34] Internet-Draft                Secure HTTP                 
  1835.  
  1836.  
  1837.    When the client receives the 422 response code, it should read the
  1838.    cryptographic options that the proxy sent and determine whether or
  1839.    not it is willing to apply that enhancement to the message. If the
  1840.    client is willing to meet these requirements, it should recursively
  1841.    encapsulate the request it previously sent using the appropriate
  1842.    options.  (Note that since the enhancement is recursively applied,
  1843.    even clients which are unwilling to send requests to servers in the
  1844.    clear may be willing to send the already encrypted message to the
  1845.    proxy without further encryption.) (See Section 7.1 for another exam-
  1846.    ple of a recursively encapsulated message)
  1847.  
  1848.    When the proxy receives such a message, it should strip the outer
  1849.    encapsulation to recover the message which should be sent to the
  1850.    server.
  1851.  
  1852. 7.2.2.  Proxy Caching of S-HTTP Messages
  1853.  
  1854.    Although it is often considered that security in general and confi-
  1855.    dentiality in specific obviate caching, this is only true under cer-
  1856.    tain circumstances. For example, when confidentiality is being used
  1857.    to restrict access to some class of documents to a broad class of
  1858.    users, and those users are behind a single proxy, it is obviously
  1859.    advantageous if that proxy can cache such documents. S-HTTP's message
  1860.    orientation makes this a fairly straightforward proposition, provided
  1861.    that the parties cooperate.
  1862.  
  1863. 7.2.2.1.  Client Behavior
  1864.  
  1865.    All the client needs to do is to provide enough URL information to
  1866.    the proxy to enable the proxy to detect when potentially cached data
  1867.    is being requested. In order to do this, the client simply provides
  1868.    the whole URL HTTP style instead of the URI-less URL described in
  1869.    Section 2.1. Note that this provides the proxy with the URI. Conse-
  1870.    quently, clients which don't trust their proxy to receive that infor-
  1871.    mation or are worried about traffic analysis by the proxy should not
  1872.    enable caching in this way. (An insecure channel to the proxy can be
  1873.    defended against using a recursive encapsulation.)
  1874.  
  1875. 7.2.2.2.  Proxy Behavior
  1876.  
  1877.    When forwarding requests, the proxy merely needs to recognize URLs
  1878.    that are in it's cache and add the If-Modified-Since header as it
  1879.    does for HTTP.
  1880.  
  1881.    When forwarding responses, the proxy needs to detect the 320 response
  1882.    and reassemble a valid S-HTTP response from the cached data and the
  1883.    new keying material provided by the server. The proxy should check
  1884.    the Content-MD5 header if supplied to ensure that a valid cache hit
  1885.  
  1886.  
  1887.  
  1888. Rescorla, Schiffman                                             [Page 35] Internet-Draft                Secure HTTP                 
  1889.  
  1890.  
  1891.    has occurred and retry the request minus the If-Modified-Since header
  1892.    if the Content-MD5s do not match.
  1893.  
  1894. 7.2.2.3.  Server Behavior
  1895.  
  1896.    The server needs to detect the If-Modified-Since header provided by
  1897.    the proxy and generate the content-less message described in 5.2.5,
  1898.    if the document has not been modified since the time the header.
  1899.  
  1900. 8.  Implementation Recommendations and Requirements
  1901.  
  1902.    All S-HTTP agents must support the MD5 message digest and MAC authen-
  1903.    tication. As of S-HTTP/1.2, all agents must also support the RSA-
  1904.    MD5-HMAC construction.
  1905.  
  1906.    All S-HTTP agents must support Outband key exchange.
  1907.  
  1908.    Support for encryption is recommended; agents which implement encryp-
  1909.    tion must support the in-band key exchange method and one of the fol-
  1910.    lowing three cryptosystems (in ECB and CBC modes): DES, RC2[40] and
  1911.    CDMF.
  1912.  
  1913.    Agents are recommended to support signature verification; server sup-
  1914.    port of signature generation is additionally recommended.  Agents
  1915.    which implement either signing or verification should support the RSA
  1916.    algorithm.
  1917.  
  1918.    Note that conformant implementations of the protocol (although not
  1919.    recommended ones) can avoid the use of public key cryptography
  1920.    entirely.
  1921.  
  1922. 9.  Protocol Syntax Summary
  1923.  
  1924.    We present below a summary of the main syntactic features of S-
  1925.    HTTP/1.2, excluding message encapsulation proper.
  1926.  
  1927. 9.1.  S-HTTP (Unencapsulated) Headers
  1928.  
  1929.    Content-Privacy-Domain: ('PKCS-7' | 'MOSS')
  1930.    Content-Transfer-Encoding: ('8BIT' | '7BIT' | 'BASE64')
  1931.    Prearranged-Key-Info: <Hdr-Cipher>,<Key>,<Key-ID>
  1932.    Content-Type: 'application/http'
  1933.    MAC-Info: [hex(timeofday)',']<hash-alg>','hex(<hash-data>)','
  1934.            <key-spec>
  1935.  
  1936. 9.2.  HTTP (Encapsulated) Non-negotiation Options
  1937.  
  1938.    Key-Assign: <Method>','<Key-Name>','<Lifetime>','
  1939.  
  1940.  
  1941.  
  1942. Rescorla, Schiffman                                             [Page 36] Internet-Draft                Secure HTTP                 
  1943.  
  1944.  
  1945.            <Ciphers>';'<Method-args>
  1946.    Encryption-Identity: <name-class>','<key-sel>','<name-args>
  1947.    Certificate-Info: <Cert-Fmt>','<Cert-Group>
  1948.    Nonce: <string>
  1949.    Nonce-Echo: <string>
  1950.  
  1951. 9.3.  Encapsulated Negotiation Options
  1952.  
  1953.    SHTTP-Cryptopts: <scope>';'<string>(,<string>)*
  1954.    SHTTP-Privacy-Domains: ('PKCS-7' | 'MOSS')
  1955.    SHTTP-Certificate-Types: ('X.509')
  1956.    SHTTP-Key-Exchange-Algorithms: ('RSA' | 'KRB-'<kv>)
  1957.    SHTTP-Signature-Algorithms: ('RSA' | 'NIST-DSS')
  1958.    SHTTP-Message-Digest-Algorithms: ('RSA-MD2' | 'RSA-MD5' | 'NIST-SHS'
  1959.            'RSA-MD2-HMAC', 'RSA-MD5-HMAC', 'NIST-SHS-HMAC')
  1960.    SHTTP-Symmetric-Content-Algorithms: ('DES-CBC' | 'DES-EDE-CBC' |
  1961.            'DES-EDE3-CBC' | 'DESX-CBC' | 'CDMF-CBC' | 'IDEA-CBC' |
  1962.            'RC2-CBC' )
  1963.    SHTTP-Symmetric-Header-Algorithms: ('DES-ECB' | 'DES-EDE-ECB' |
  1964.            'DES-EDE3-EBC' | 'DESX-ECB' | 'CDMF-ECB' |
  1965.            'IDEA-ECB' | 'RC2-ECB')
  1966.    SHTTP-Privacy-Enhancements: ('sign' | 'encrypt' | 'auth')
  1967.    Your-Key-Pattern: <key-use>','<pattern-info>
  1968.  
  1969. 9.4.  HTTP Methods
  1970.  
  1971.    Secure * Secure-HTTP/1.2
  1972.  
  1973. 9.5.  Server Status Reports
  1974.  
  1975.    Secure-HTTP/1.2 200 OK
  1976.    SecurityRetry 420
  1977.    BogusHeader 421 <reason>
  1978.  
  1979. 9.6.  Server Conventions
  1980.  
  1981.    GET SERVER-CERTIFICATE-<B64-DN> <http-version>
  1982.    GET POLICY-<B64-DN> <http-version>
  1983.    GET CRL-<B64-DN> <http-version>
  1984.  
  1985. 10.  An Extended Example
  1986.  
  1987.    We provide here a contrived example of a series of S-HTTP requests
  1988.    and replies. Rows of equal signs are used to set off the narrative
  1989.    from sample message traces. Note that, since we use base-64 encoding
  1990.    here for expository purposes, the example messages have the otherwise
  1991.    unnecessary MOSS-style "BEGIN/END PRIVACY-ENHANCED MESSAGE" delim-
  1992.    iters.
  1993.  
  1994.  
  1995.  
  1996. Rescorla, Schiffman                                             [Page 37] Internet-Draft                Secure HTTP                 
  1997.  
  1998.  
  1999. 10.1.  A request using RSA key exchange with Inband key reply
  2000.  
  2001.    Alice, using an S-HTTP-capable client, begins by making an HTTP
  2002.    request which yields the following response page:
  2003.    ============================================================
  2004.    200 OK HTTP/1.0
  2005.    Server-Name: Navaho-0.1.2.3alpha
  2006.    Certificate-Info: PKCS7,MIAGCSqGSIb3DQEHAqCAMIACAQExADCABgkqh
  2007.            kiG9w0BBwEAAKCAM
  2008.            IIBrTCCAUkCAgC2MA0GCSqGSIb3DQEBAgUAME0xCzAJBgNVBAYTAlVTMSAwH
  2009.            gYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEcMBoGA1UECxMTUGVyc
  2010.            29uYSBDZXJ0aWZpY2F0ZTAeFw05NDA0MDkwMDUwMzdaFw05NDA4MDIxODM4N
  2011.            TdaMGcxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBTZWN1cml0e
  2012.            SwgSW5jLjEcMBoGA1UECxMTUGVyc29uYSBDZXJ0aWZpY2F0ZTEYMBYGA1UEA
  2013.            xMPU2V0ZWMgQXN0cm9ub215MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMy8Q
  2014.            cW7RMrB4sTdQ8Nmb2DFmJmkWn+el+NdeamIDElX/qw9mIQu4xNj1FfepfJNx
  2015.            zPvA0OtMKhy6+bkrlyMEU8CAwEAATANBgkqhkiG9w0BAQIFAANPAAYn7jDgi
  2016.            rhiIL4wnP8nGzUisGSpsFsF4/7z2P2wqne6Qk8Cg/Dstu3RyaN78vAMGP8d8
  2017.            2H5+Ndfhi2mRp4YHiGHz0HlK6VbPfnyvS2wdjCCAccwggFRAgUCQAAAFDANB
  2018.            gkqhkiG9w0BAQIFADBfMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXUlNBIERhd
  2019.            GEgU2VjdXJpdHksIEluYy4xLjAsBgNVBAsTJUxvdyBBc3N1cmFuY2UgQ2Vyd
  2020.            GlmaWNhdGlvbiBBdXRob3JpdHkwHhcNOTQwMTA3MDAwMDAwWhcNOTYwMTA3M
  2021.            jM1OTU5WjBNMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXUlNBIERhdGEgU2Vjd
  2022.            XJpdHksIEluYy4xHDAaBgNVBAsTE1BlcnNvbmEgQ2VydGlmaWNhdGUwaTANB
  2023.            gkqhkiG9w0BAQEFAANYADBVAk4GqghQDa9Xi/2zAdYEqJVIcYhlLN1FpI9tX
  2024.            Q1m6zZ39PYXK8Uhoj0Es7kWRv8hC04vqkOKwndWbzVtvoHQOmP8nOkkuBi+A
  2025.            QvgFoRcgOUCAwEAATANBgkqhkiG9w0BAQIFAANhAD/5Uo7xDdp49oZm9GoNc
  2026.            PhZcW1e+nojLvHXWAU/CBkwfcR+FSf4hQ5eFu1AjYv6Wqf430Xe9Et5+jgnM
  2027.            Tiq4LnwgTdA8xQX4elJz9QzQobkE3XVOjVAtCFcmiin80RB8AAAMYAAAAAAA
  2028.            AAAAA==
  2029.    Encryption-Identity: DN-1485, null, CN=Setec Astronomy, OU=Persona
  2030.            Certificate,O="RSA Data Security, Inc.", C=US;
  2031.    SHTTP-Privacy-Enhancements: recv-required=encrypt
  2032.  
  2033.    <A name=tag1 HREF="shttp://www.setec.com/secret">
  2034.    Don't read this. </A>
  2035.    ============================================================
  2036.  
  2037.    An appropriate HTTP request to dereference this URL would be:
  2038.    ============================================================
  2039.    GET /secret HTTP/1.0
  2040.    Security-Scheme: S-HTTP/1.2
  2041.    User-Agent: Web-O-Vision 1.2beta
  2042.    Accept: *.*
  2043.    Key-Assign: Inband,1,reply,des-ecb;7878787878787878
  2044.  
  2045.    ============================================================
  2046.  
  2047.  
  2048.  
  2049.  
  2050. Rescorla, Schiffman                                             [Page 38] Internet-Draft                Secure HTTP                 
  2051.  
  2052.  
  2053.    The added Key-Assign line that would not have been in an ordinary
  2054.    HTTP request permits Bob (the server) to encrypt his reply to Alice,
  2055.    even though Alice does not have a public key, since they would share
  2056.    a key after the request is received by Bob.  This request has the
  2057.    following S-HTTP encapsulation:
  2058.    ============================================================
  2059.    Secure * Secure-HTTP/1.2
  2060.    Content-Transfer-Encoding: base64
  2061.    Content-Type: application/http
  2062.    Content-Privacy-Domain: PKCS-7
  2063.  
  2064.    -----BEGIN PRIVACY-ENHANCED MESSAGE-----
  2065.    MIAGCSqGSIb3DQEHA6CAMIACAQAxgDCBqQIBADBTME0xCzAJBgNVBAYTAlVTMSAw
  2066.    HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEcMBoGA1UECxMTUGVyc29u
  2067.    YSBDZXJ0aWZpY2F0ZQICALYwDQYJKoZIhvcNAQEBBQAEQCU/R+YCJSUsV6XLilHG
  2068.    cNVzwqKcWzmT/rZ+duOv8Ggb7oO/d8H3xUVGQ2LsX4kYGq2szwj8Q6eWhsmhf4oz
  2069.    lvMAADCABgkqhkiG9w0BBwEwEQYFKw4DAgcECFif7BadXlw3oIAEgZBNcMexKe16
  2070.    +mNxx8YQPukBCL0bWqS86lvws/AgRkKPELmysBi5lco8MBCsWK/fCyrnxIRHs1oK
  2071.    BXBVlsAhKkkusk1kCf/GbXSAphdSgG+d6LxrNZwHbBFOX6A2hYS63Iczd5bOVDDW
  2072.    Op2gcgUtMJq6k2LFrs4L7HHqRPPlqNJ6j5mFP4xkzOCNIQynpD1rV6EECMIk/T7k
  2073.    1JLSAAAAAAAAAAAAAA==
  2074.    -----END PRIVACY-ENHANCED MESSAGE-----
  2075.    ============================================================
  2076.  
  2077.    The data between the delimiters is a PKCS-7 message, RSA enveloped
  2078.    for Setec Astronomy.
  2079.  
  2080.    Bob decrypts the request, finds the document in question, and is
  2081.    ready to serve it back to Alice.
  2082.  
  2083.    An appropriate HTTP server response would be:
  2084.    ============================================================
  2085.    HTTP/1.0 200 OK
  2086.    Security-Scheme: S-HTTP/1.2
  2087.    Content-Type: text/html
  2088.  
  2089.    Congratulations, you've won.
  2090.    <A href="/prize.html"
  2091.     CRYPTOPTS="Key-Assign: Inband,alice1,reply,des-ecb;020406080a0c0e0f;
  2092.     SHTTP-Privacy-Enhancements: recv-required=auth">Click here to
  2093.    claim your prize</A>
  2094.    ============================================================
  2095.  
  2096.    This HTTP response, encapsulated as an S-HTTP message becomes:
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104. Rescorla, Schiffman                                             [Page 39] Internet-Draft                Secure HTTP                 
  2105.  
  2106.  
  2107.    ============================================================
  2108.    Secure * Secure-HTTP/1.2
  2109.    Content-Transfer-Encoding: base64
  2110.    Content-Type: application/http
  2111.    Prearranged-Key-Info: des-ecb,697fa820df8a6e53,inband:1
  2112.    Content-Privacy-Domain: PKCS-7
  2113.  
  2114.    -----BEGIN PRIVACY-ENHANCED MESSAGE-----
  2115.    MIAGCSqGSIb3DQEHBqCAMIACAQAwgAYJKoZIhvcNAQcBMBEGBSsOAwIHBAifqtdy
  2116.    x6uIMYCCARgvFzJtOZBn773DtmXlx037ck3giqnV0WC0QAx5f+fesAiGaxMqWcir
  2117.    r9XvT0nT0LgSQ/8tiLCDBEKdyCNgdcJAduy3D0r2sb5sNTT0TyL9uydG3w55vTnW
  2118.    aPbCPCWLudArI1UHDZbnoJICrVehxG/sYX069M8v6VO8PsJS7//hh1yM+0nekzQ5
  2119.    l1p0j7uWKu4W0csrlGqhLvEJanj6dQAGSTNCOoH3jzEXGQXntgesk8poFPfHdtj0
  2120.    5RH4MuJRajDmoEjlrNcnGl/BdHAd2JaCo6uZWGcnGAgVJ/TVfSVSwN5nlCK87tXl
  2121.    nL7DJwaPRYwxb3mnPKNq7ATiJPf5u162MbwxrddmiE7e3sST7naSN+GS0ateY5X7
  2122.    AAAAAAAAAAA=
  2123.    -----END PRIVACY-ENHANCED MESSAGE-----
  2124.    ============================================================
  2125.  
  2126.    The data between the delimiters is a PKCS7 message encrypted under a
  2127.    randomly-chosen DEK which can be recovered by computing:
  2128.  
  2129.            DES-DECRYPT(inband:1,697fa820df8a6e53)
  2130.  
  2131.    where 'inband:1' is the key exchanged in the Key-Assign line in the
  2132.    original request.
  2133.  
  2134. 10.2.  A request using the auth enhancement
  2135.  
  2136.    There is a link on the HTML page that was just returned, which Alice
  2137.    dereferences, creating the HTTP message:
  2138.    ============================================================
  2139.    GET /prize.html HTTP/1.0
  2140.    Security-Scheme: S-HTTP/1.2
  2141.    User-Agent: Web-O-Vision 1.1beta
  2142.    Accept: *.*
  2143.  
  2144.    ============================================================
  2145.  
  2146.    Which, when encapsulated as an S-HTTP message, becomes:
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158. Rescorla, Schiffman                                             [Page 40] Internet-Draft                Secure HTTP                 
  2159.  
  2160.  
  2161.    ============================================================
  2162.    Secure * Secure-HTTP/1.2
  2163.    Content-Transfer-Encoding: base64
  2164.    Content-Type: application/http
  2165.    MAC-Info:31ff8122,rsa-md5,b3ca4575b841b5fc7553e69b0896c416,inband:alice1
  2166.    Content-Privacy-Domain: PKCS-7
  2167.  
  2168.    -----BEGIN PRIVACY-ENHANCED MESSAGE-----
  2169.    MIAGCSqGSIb3DQEHAaCABGNHRVQgL3ByaXplLmh0bWwgSFRUUC8xLjAKU2VjdXJp
  2170.    dHktU2NoZW1lOiBTLUhUVFAvMS4xClVzZXItQWdlbnQ6IFdlYi1PLVZpc2lvbiAx
  2171.    LjFiZXRhCkFjY2VwdDogKi4qCgoAAAAA
  2172.    -----END PRIVACY-ENHANCED MESSAGE-----
  2173.    ============================================================
  2174.  
  2175.    The data between the delimiters is a PKCS-7 'Data' representation of
  2176.    the request.
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212. Rescorla, Schiffman                                             [Page 41] Internet-Draft                Secure HTTP                 
  2213.  
  2214.  
  2215. Appendix: A Review of PKCS-7
  2216.  
  2217.    PKCS-7 ("Cryptographic Message Syntax Standard") is a cryptographic
  2218.    message encapsulation format, similar to PEM, which was defined by
  2219.    RSA Laboratories as part of a family of related standards. They
  2220.    state: "The PKCS standards are offered by RSA Laboratories to
  2221.    developers of computer systems employing public key cryptography.  It
  2222.    is RSA Laboratories' intention to improve and refine the standards in
  2223.    conjunction with computer system developers, with the goal of produc-
  2224.    ing standards that most if not all developers adopt."
  2225.  
  2226.    PKCS-7 is only one of two encapsulation formats supported by S-HTTP,
  2227.    but it is to be preferred since it permits the least restricted set
  2228.    of negotiable options, and permits binary encoding.  In the interest
  2229.    of making this specification more self-contained, we summarize PKCS-7
  2230.    here.
  2231.  
  2232.    PKCS-7 is a superset of PEM, in that PEM messages can be converted to
  2233.    PKCS-7 messages without any cryptographic operations, and vice-versa
  2234.    (given PKCS-7 messages which are restricted to PEM facilities).
  2235.    Additionally, PEM key management materials such as certificates and
  2236.    certificate revocation lists are compatible with PKCS-7's.
  2237.  
  2238.    PKCS-7 is defined in terms of OSI's Abstract Syntax Notation (ASN.1,
  2239.    defined in X.208), and is concretely represented using ASN.1's Basic
  2240.    Encoding Rules (BER, defined in X.209).  A PKCS-7 message is a
  2241.    sequence of typed content parts. There are six content types, recur-
  2242.    sively composable:
  2243.  
  2244.         Data -- Some bytes, with no enhancement.
  2245.  
  2246.         SignedData -- A content part, with zero or more signature
  2247.         blocks, and associated keying materials. Keying materials
  2248.         can be transported via the degenerate case of no signature
  2249.         blocks and no data.
  2250.  
  2251.         EnvelopedData -- One or more (per recipient) key exchange
  2252.         blocks and an encrypted content part.
  2253.  
  2254.         SignedAndEnvelopedData -- The obvious combination of
  2255.         SignedData and EnvelopedData for a single content part.
  2256.  
  2257.         DigestedData -- A content part with a single digest block.
  2258.  
  2259.         EncryptedData -- An encrypted content part, with key
  2260.         materials externally provided.
  2261.  
  2262.    Here we will dispense with convention for the sake of ASN.1-impaired
  2263.  
  2264.  
  2265.  
  2266. Rescorla, Schiffman                                             [Page 42] Internet-Draft                Secure HTTP                 
  2267.  
  2268.  
  2269.    readers, and present a syntax for PKCS-7 in informal BNF (with much
  2270.    gloss).  In the actual encoding, most productions have explicit tag
  2271.    and length fields.
  2272.  
  2273.    <Message> := (<Content>)+
  2274.    <Content> := <Data> | <SignedData> | <EnvelopedData> |
  2275.                    <SignedAndEnvelopedData> |
  2276.                    <DigestedData> | <EncryptedData>
  2277.    <Data> := <Bytes>
  2278.    <SignedData> := <DigestAlg>* <Content> <Certificates>*
  2279.                     <CRLs>* <SignerInfo>*
  2280.    <EnvelopedData> := <RecipientInfo>+ <BulkCryptAlg>
  2281.                    Encrypted(<Content>)
  2282.    <SignedAndEnvelopedData> := <RecipientInfo>* <DigestAlg>*
  2283.                    <EncryptedData> <Certificates>*
  2284.                    <CRLs>* <SignerInfos>*
  2285.    <DigestedData> := <DigestAlg> <Content> <DigestBytes>
  2286.    <EncryptedData> := <BulkCryptAlg> Encrypted(<Bytes>)
  2287.    <SignerInfo> := <CertID> ... Encrypted(<DigestBytes>) ...
  2288.    <RecipientInfo> := <CertID> <KeyCryptAlg> Encrypted(<DEK>)
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320. Rescorla, Schiffman                                             [Page 43] Internet-Draft                Secure HTTP                 
  2321.  
  2322.  
  2323. Bibliography and References
  2324.    [BELL96] Bellare, M., Canetti, R., Krawczyk, H., "Keying Hash Functions for
  2325.         Message Authentication", Preprint.
  2326.  
  2327.    [BERN95a] Berners-Lee, T., Connolly, D., "Hypertext Markup Language - 2.0",
  2328.         draft-ietf-html-spec-04, June 1995 (working draft)
  2329.  
  2330.    [BERN95b] Berners-Lee, T., Fielding, R. T., Nielsen, H., "Hypertext
  2331.         Transfer Protocol -- HTTP/1.0", draft-ietf-http-v10-spec-00,
  2332.         March 1995. (working draft)
  2333.  
  2334.    [FIPS-46-1] Federal Information Processing Standards Publication (FIPS PUB)
  2335.         46-1, Data Encryption Standard, Reaffirmed 1988 January 22
  2336.         (supersedes FIPS PUB 46, 1977 January 15).
  2337.  
  2338.    [FIPS-81] Federal Information Processing Standards Publication (FIPS PUB)
  2339.         81, DES Modes of Operation, 1980 December 2.
  2340.  
  2341.    [FIPS-180] Federal Information Processing Standards Publication (FIPS PUB)
  2342.        180-1, "Secure Hash Standard", 1995 April 17.
  2343.  
  2344.    [FIPS-186] Federal Information Processing Standards Publication (FIPS PUB)
  2345.         186, Digital Signature Standard, 1994 May 19.
  2346.  
  2347.    [HAST86] Hastad, J., "On Using RSA With Low Exponents in a Public Key
  2348.         Network," Advances in Cryptology-CRYPTO 95 Proceedings,
  2349.         Springer-Verlag, 1986.
  2350.  
  2351.    [JOHN93] Johnson, D.B., Matyas, S.M., Le, A.V., Wilkins, J.D., "Design of the
  2352.         Commercial Data Masking Facility Data Privacy Algorithm," Proceedings
  2353.         1st ACM Conference on Computer & Communications Security,
  2354.         November 1993, Fairfax, VA., pp. 93-96.
  2355.  
  2356.    [KRAW96a] Krawczyk, H., Bellare, M., Canetti, R., "HMAC-MD5: Keyed-MD5 for
  2357.         Message Authentication", draft-ietf-ipsec-hmac-md5-00.txt, March 1996.
  2358.  
  2359.    [KRAW96b] Krawczyk, H. personal communication.
  2360.  
  2361.    [LAI92] Lai, X. "On the Design and Security of Block Ciphers," ETH Series in
  2362.         Information Processing, v. 1, Konstanz: Hartung-Gorre Verlag, 1992.
  2363.  
  2364.    [PKCS-6] RSA Data Security, Inc. "Extended Certificate Syntax Standard",
  2365.        PKCS-6, Nov 1, 1993.
  2366.  
  2367.    [PKCS-7] RSA Data Security, Inc. "Cryptographic Message Syntax Standard",
  2368.        PKCS-7, Nov 1, 1993.
  2369.  
  2370.    [RFC-822] Crocker, D. "Standard For The Format Of ARPA Internet Text Messages",
  2371.  
  2372.  
  2373.  
  2374. Rescorla, Schiffman                                             [Page 44] Internet-Draft                Secure HTTP                 
  2375.  
  2376.  
  2377.         RFC822, August 1982.
  2378.  
  2379.    [RFC-1319] Kaliski, B. "The MD2 Message-Digest Algorithm", RFC1319, April 1992
  2380.  
  2381.    [RFC-1321] Rivest, R. "The MD5 Message-Digest Algorithm", RFC1321, April 1992
  2382.  
  2383.    [RFC-1421] Linn J. "Privacy Enhancement for Internet Electronic Mail:
  2384.        Part I: Message Encryption and Authentication Procedures",
  2385.        RFC1421, Feb 1993.
  2386.  
  2387.    [RFC-1422] Kent, S. "Privacy Enhancement for Internet Electronic Mail:
  2388.        Part II: Certificate-Based Key Management", RFC1422, Feb 1993.
  2389.  
  2390.    [RFC-1485] Hardcastle-Kille, S. "A String Representation of Distinguished
  2391.        Names", RFC1485, July 1993.
  2392.  
  2393.    [RFC-1510] Kohl, J., and Neuman, C., "The Kerberos Authentication Service
  2394.         (V5)", RFC1510, September 1993.
  2395.  
  2396.    [RFC-1521] Borenstein, N., Freed, N., "MIME (Multipurpose Internet
  2397.         Mail Extensions) Part One: Mechanisms for Specifying and Describing
  2398.         the Format of Internet Message Bodies", RFC-1521, September 1993.
  2399.  
  2400.    [RFC-1738] Berners-Lee, T. "Uniform Resource Locators (URLs)", RFC1738,
  2401.         Dec 1994
  2402.  
  2403.    [RFC-1847] Galvin, J., Murphy, S., Crocker, S., Freed, N.,
  2404.         "Security Muliparts for MIME: Multipart/Signed and Multipart/Encrypted",
  2405.          RFC-1847, October 1995.
  2406.  
  2407.    [RFC-1848] Crocker, S., Freed, N., Galvin, J., Murphy, S.,
  2408.         "MIME Object Security Services", RFC-1848, October 1995.
  2409.  
  2410.    [RFC-1864] Myers, J.  Rose, M. "The Content-MD5 Header Field", 10/24/1995.
  2411.         RFC1864, October 1995.
  2412.  
  2413.    [SHTML] Rescorla, E., Schiffman, A., "Security Extensions For HTML",
  2414.         draft-ietf-wts-shtml-02.txt.
  2415.  
  2416.    [VANO95] B. Prennel and P. van Oorschot, "On the security of two MAC
  2417.         algorithms", to appear Eurocrypt'96.
  2418.  
  2419.    [X509] CCITT Recommendation X.509 (1988), "The Directory -
  2420.        Authentication Framework".
  2421.  
  2422.  
  2423.  
  2424. Security Considerations
  2425.  
  2426.  
  2427.  
  2428. Rescorla, Schiffman                                             [Page 45] Internet-Draft                Secure HTTP                 
  2429.  
  2430.  
  2431.    This entire document is about security.
  2432.  
  2433. Acknowledgements
  2434.  
  2435.    The authors wish to thank our colleagues at Terisa Systems, Enter-
  2436.    prise Integration, Technologies, RSA Data Security, TIS, MCI, BBN, HP
  2437.    Labs Bristol, NCSA, Spyglass, MIT, CERN, Open Market, Spry, Digital,
  2438.    W3C and elsewhere for their review of earlier drafts. We also wish to
  2439.    thank the many users who shared their experience with the S-HTTP
  2440.    reference implementation distributed by the CommerceNet Consortium.
  2441.  
  2442.    This work was initiated at Enterprise Integration Technologies Cor-
  2443.    poration and funded in part by the ARPA MADE (Manufacturing Automa-
  2444.    tion and Design Engineering) program, under contract management by
  2445.    the USAF Wright Laboratory.  In addition to the funding support, we
  2446.    appreciate the administrative and intellectual resources of the spon-
  2447.    sors and the research community they maintain.
  2448.  
  2449. Authors' Address
  2450.  
  2451. Eric Rescorla <ekr@terisa.com>
  2452. Terisa Systems, Inc.
  2453. 4984 El Camino Real
  2454. Los Altos, CA 94022
  2455. Phone: (415) 919-1753
  2456.  
  2457. Allan M. Schiffman <ams@terisa.com>
  2458. Terisa Systems, Inc.
  2459. 4984 El Camino Real
  2460. Los Altos, CA 94022
  2461. Phone: (415) 919-1755
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482. Rescorla, Schiffman                                             [Page 46] Internet-Draft                Secure HTTP                 
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.                            Table of Contents
  2489.  
  2490.  
  2491.  
  2492.  
  2493. 1. Introduction ...................................................    2
  2494.  
  2495. 1.1. Summary of Features ..........................................    2
  2496.  
  2497. 1.2. Changes ......................................................    3
  2498.  
  2499. 1.3. Processing Model .............................................    3
  2500.  
  2501. 1.4. Modes of Operation ...........................................    5
  2502.  
  2503. 1.5. Implementation Options .......................................    6
  2504.  
  2505. 2. Message Format .................................................    6
  2506.  
  2507. 2.1. The Request Line .............................................    7
  2508.  
  2509. 2.2. The Status Line ..............................................    7
  2510.  
  2511. 2.3. Secure HTTP Header Lines .....................................    7
  2512.  
  2513. 2.3.2. Content-Transfer-Encoding ..................................    8
  2514.  
  2515. 2.4. Content ......................................................   11
  2516.  
  2517. 2.5. Encapsulation Format Options .................................   12
  2518.  
  2519. 2.5.1. Content-Privacy-Domain: PKCS-7 .............................   12
  2520.  
  2521. 2.5.2. Content-Privacy-Domain: MOSS ...............................   13
  2522.  
  2523. 2.5.3. Imported HTTP headers ......................................   14
  2524.  
  2525. 2.5.3.2. Connection: Keep-Alive ...................................   14
  2526.  
  2527. 2.5.3.3. If-Modified-Since ........................................   14
  2528.  
  2529. 2.5.3.4. Content-MD5 ..............................................   15
  2530.  
  2531. 3. Cryptographic Parameters .......................................   15
  2532.  
  2533.  
  2534.  
  2535.  
  2536. Rescorla, Schiffman                                             [Page 47] Internet-Draft                Secure HTTP                 
  2537.  
  2538.  
  2539. 3.1. Options Headers ..............................................   15
  2540.  
  2541.    3.2. Negotiation Options .......................................   15
  2542.  
  2543.    3.2.1. Negotiation Overview ....................................   15
  2544.  
  2545. 3.2.2. Negotiation Option Format ..................................   16
  2546.  
  2547. 3.2.3. Parametrization for Variable-length Key Ciphers ............   17
  2548.  
  2549. 3.2.4. Negotiation Syntax .........................................   18
  2550.  
  2551. 3.3. Non-Negotiation Headers ......................................   22
  2552.  
  2553. 3.3.1. Encryption-Identity ........................................   22
  2554.  
  2555. 3.3.2. Certificate-Info ...........................................   23
  2556.  
  2557. 3.3.4. Nonces .....................................................   25
  2558.  
  2559. 3.4. Grouping Headers With SHTTP-Cryptopts ........................   25
  2560.  
  2561. 3.4.1. SHTTP-Cryptopts ............................................   25
  2562.  
  2563. 4. New Header Lines for HTTP ......................................   26
  2564.  
  2565. 4.1. Security-Scheme ..............................................   26
  2566.  
  2567. 5. (Retriable) Server Status Error Reports ........................   27
  2568.  
  2569. 5.1. Retry for Option (Re)Negotiation .............................   27
  2570.  
  2571. 5.2. Specific Retry Behavior ......................................   27
  2572.  
  2573. 5.3. Limitations On Automatic Retries .............................   29
  2574.  
  2575. 6. Other Issues ...................................................   30
  2576.  
  2577. 6.1. Compatibility of Servers with Old Clients ....................   30
  2578.  
  2579. 6.2. URL Protocol Type ............................................   30
  2580.  
  2581. 6.3. Server Conventions ...........................................   30
  2582.  
  2583. 6.4. Browser Presentation .........................................   31
  2584.  
  2585. 7. Implementation Notes ...........................................   32
  2586.  
  2587.  
  2588.  
  2589.  
  2590. Rescorla, Schiffman                                             [Page 48] Internet-Draft                Secure HTTP                 
  2591.  
  2592.  
  2593. 7.1. Preenhanced Data .............................................   32
  2594.  
  2595. 7.2. Note:Proxy Interaction .......................................   34
  2596.  
  2597. 7.2.1. Client-Proxy Authentication ................................   34
  2598.  
  2599. 7.2.2. Proxy Caching of S-HTTP Message ............................   35
  2600.  
  2601. 8. Implementation Recommendations and Requirements ................   36
  2602.  
  2603. 9. Protocol Syntax Summary ........................................   36
  2604.  
  2605. 10. An Extended Example ...........................................   37
  2606.  
  2607. Appendix: A Review of PKCS-7 ......................................   42
  2608.  
  2609. Bibliography and References .......................................   44
  2610.  
  2611. Security Considerations ...........................................   45
  2612.  
  2613. Acknowledgements ..................................................   46
  2614.  
  2615. Authors' Address ..................................................   46
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.