home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_q_t / draft-ietf-tls-protocol-03.txt < prev    next >
Text File  |  1997-05-21  |  164KB  |  3,924 lines

  1.  
  2. Transport Layer Security Working Group                      Tim Dierks
  3. INTERNET-DRAFT                                   Consensus Development
  4. Expires September 22, 1997                           Christopher Allen
  5.                                                  Consensus Development
  6.                                                           May 21, 1997
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                           The TLS Protocol
  15.                              Version 1.0
  16.  
  17.  
  18.                    <draft-ietf-tls-protocol-03.txt>
  19.  
  20. Status of this memo
  21.  
  22.    This document is an Internet-Draft. Internet-Drafts are working
  23.    documents of the Internet Engineering Task Force (IETF), its areas,
  24.    and its working groups. Note that other groups may also distribute
  25.    working documents as Internet-Drafts.
  26.  
  27.    Internet-Drafts are draft documents valid for a maximum of six
  28.    months and may be updated, replaced, or made obsolete by other
  29.    documents at any time. It is inappropriate to use Internet-Drafts as
  30.    reference material or to cite them other than as work in progress.
  31.  
  32.    To learn the current status of any Internet-Draft, please check the
  33.    1id-abstracts.txt listing contained in the Internet Drafts Shadow
  34.    Directories on ds.internic.net (US East Coast), nic.nordu.net
  35.    (Europe), ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific
  36.    Rim).
  37.  
  38. Abstract
  39.  
  40.    This document specifies Version 1.0 of the Transport Layer Security
  41.    (TLS) protocol, which is at this stage is strictly based on the
  42.    Secure Sockets Layer (SSL) version 3.0 protocol, and is to serve as
  43.    a basis for future discussions. The TLS protocol provides
  44.    communications privacy over the Internet. The protocol allows
  45.    client/server applications to communicate in a way that is designed
  46.    to prevent eavesdropping, tampering, or message forgery.
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. Dierks, T.                  Expires September, 1997             [Page 1]
  58. INTERNET-DRAFT                     TLS 1.0                    March 1997
  59.  
  60. Table of Contents
  61.  
  62.             Status of this memo                                        1
  63.             Abstract                                                   1
  64.             Table of Contents                                          2
  65.    1.       Introduction                                               3
  66.    2.       Goals                                                      4
  67.    3.       Goals of this document                                     5
  68.    4.       Presentation language                                      5
  69.    4.1.     Basic block size                                           6
  70.    4.2.     Miscellaneous                                              6
  71.    4.3.     Vectors                                                    6
  72.    4.4.     Numbers                                                    7
  73.    4.5.     Enumerateds                                                7
  74.    4.6.     Constructed types                                          8
  75.    4.6.1.   Variants                                                   8
  76.    4.7.     Cryptographic attributes                                   9
  77.    4.8.     Constants                                                 10
  78.    5.       HMAC and the pseudorandom function                        11
  79.    6.       The TLS Record Protocol                                   12
  80.    6.1.     Connection states                                         13
  81.    6.2.     Record layer                                              15
  82.    6.2.1.   Fragmentation                                             15
  83.    6.2.2.   Record compression and decompression                      16
  84.    6.2.3.   Record payload protection                                 17
  85.    6.2.3.1. Null or standard stream cipher                            18
  86.    6.2.3.2. CBC block cipher                                          18
  87.    6.3.     Key calculation                                           19
  88.    6.3.1.   Export key generation example                             21
  89.    7.       The TLS Handshake Protocol                                21
  90.    7.1.     Change cipher spec protocol                               22
  91.    7.2.     Alert protocol                                            23
  92.    7.2.1.   Closure alerts                                            24
  93.    7.2.2.   Error alerts                                              24
  94.    7.3.     Handshake Protocol overview                               27
  95.    7.4.     Handshake protocol                                        29
  96.    7.4.1.   Hello messages                                            30
  97.    7.4.1.1. Hello request                                             30
  98.    7.4.1.2. Client hello                                              31
  99.    7.4.1.3. Server hello                                              33
  100.    7.4.2.   Server certificate                                        34
  101.    7.4.3.   Server key exchange message                               36
  102.    7.4.4.   Certificate request                                       38
  103.    7.4.5.   Server hello done                                         39
  104.    7.4.6.   Client certificate                                        39
  105.    7.4.7.   Client key exchange message                               40
  106.    7.4.7.1. RSA encrypted premaster secret message                    40
  107.    7.4.7.2. Client Diffie-Hellman public value                        41
  108.    7.4.8.   Certificate verify                                        42
  109.    7.4.9.   Finished                                                  42
  110.    8.       Cryptographic computations                                43
  111.    8.1.     Computing the master secret                               43
  112.  
  113. Dierks, T.                  Expires September, 1997             [Page 2]
  114. INTERNET-DRAFT                     TLS 1.0                    March 1997
  115.  
  116.    8.1.1.   RSA                                                       44
  117.    8.1.2.   Diffie-Hellman                                            44
  118.    9.       Application data protocol                                 44
  119.    A.       Protocol constant values                                  44
  120.    A.1.     Reserved port assignments                                 44
  121.    A.2.     Record layer                                              45
  122.    A.3.     Change cipher specs message                               46
  123.    A.4.     Alert messages                                            46
  124.    A.5.     Handshake protocol                                        47
  125.    A.5.1.   Hello messages                                            47
  126.    A.5.2.   Server authentication and key exchange messages           48
  127.    A.5.3.   Client authentication and key exchange messages           49
  128.    A.5.4.   Handshake finalization message                            50
  129.    A.6.     The CipherSuite                                           50
  130.    A.7.     The Security Parameters                                   51
  131.    B.       Glossary                                                  52
  132.    C.       CipherSuite definitions                                   55
  133.    D.       Implementation Notes                                      57
  134.    D.1.     Temporary RSA keys                                        58
  135.    D.2.     Random Number Generation and Seeding                      58
  136.    D.3.     Certificates and authentication                           59
  137.    D.4.     CipherSuites                                              59
  138.    E.       Backward Compatibility With SSL                           59
  139.    E.1.     Version 2 client hello                                    60
  140.    E.2.     Avoiding man-in-the-middle version rollback               61
  141.    F.       Security analysis                                         62
  142.    F.1.     Handshake protocol                                        62
  143.    F.1.1.   Authentication and key exchange                           62
  144.    F.1.1.1. Anonymous key exchange                                    63
  145.    F.1.1.2. RSA key exchange and authentication                       63
  146.    F.1.1.3. Diffie-Hellman key exchange with authentication           64
  147.    F.1.2.   Version rollback attacks                                  64
  148.    F.1.3.   Detecting attacks against the handshake protocol          65
  149.    F.1.4.   Resuming sessions                                         65
  150.    F.1.5.   MD5 and SHA                                               65
  151.    F.2.     Protecting application data                               65
  152.    F.3.     Final notes                                               66
  153.    G.       Patent Statement                                          66
  154.             References                                                67
  155.             Credits                                                   69
  156.             Comments                                                  70
  157.  
  158. 1. Introduction
  159.  
  160. |  The primary goal of the TLS Protocol is to provide privacy and data
  161. |  integrity between two communicating applications. The protocol is
  162.    composed of two layers: the TLS Record Protocol and the TLS
  163.    Handshake Protocol. At the lowest level, layered on top of some
  164.    reliable transport protocol (e.g., TCP[TCP]), is the TLS Record
  165.    Protocol. The TLS Record Protocol provides connection security that
  166.    has two basic properties:
  167.  
  168.  
  169. Dierks, T.                  Expires September, 1997             [Page 3]
  170. INTERNET-DRAFT                     TLS 1.0                    March 1997
  171.  
  172.      - The connection is private. Symmetric cryptography is used for
  173.        data encryption (e.g., DES[DES], RC4[RC4], etc.) The keys for
  174.        this symmetric encryption are generated uniquely for each
  175.        connection and are based on a secret negotiated by another
  176.        protocol (such as the TLS Handshake Protocol). The Record
  177.        Protocol can also be used without encryption.
  178.  
  179.      - The connection is reliable. Message transport includes a message
  180.        integrity check using a keyed MAC. Secure hash functions (e.g.,
  181.        SHA, MD5, etc.) are used for MAC computations. The Record
  182.        Protocol can operate without a MAC, but is generally only used
  183.        in this mode while another protocol is using the Record Protocol
  184.        as a transport for negotiating security parameters.
  185.  
  186.    The TLS Record Protocol is used for encapsulation of various higher
  187.    level protocols. One such encapsulated protocol, the TLS Handshake
  188.    Protocol, allows the server and client to authenticate each other
  189.    and to negotiate an encryption algorithm and cryptographic keys
  190.    before the application protocol transmits or receives its first byte
  191.    of data. The TLS Handshake Protocol provides connection security
  192.    that has three basic properties:
  193.  
  194.      - The peer's identity can be authenticated using asymmetric, or
  195.        public key, cryptography (e.g., RSA[RSA], DSS[DSS], etc.). This
  196.        authentication can be made optional, but is generally required
  197.        for at least one of the peers.
  198.  
  199.      - The negotiation of a shared secret is secure: the negotiated
  200.        secret is unavailable to eavesdroppers, and for any
  201.        authenticated connection the secret cannot be obtained, even by
  202.        an attacker who can place himself in the middle of the
  203.        connection.
  204.  
  205.      - The negotiation is reliable: no attacker can modify the
  206.        negotiation communication without being detected by the parties
  207.        to the communication.
  208.  
  209.    One advantage of TLS is that it is application protocol independent.
  210. ]  Higher level protocols can layer on top of the TLS Protocol
  211. ]  transparently. The TLS standard, however, does not specify how
  212. ]  protocols add security with TLS; the decisions on how to initiate
  213. ]  TLS handshaking and how to interpret the authentication certificates
  214. ]  exchanged are left up to the judgment of the designers and
  215. ]  implementors of protocols which run on top of TLS.
  216.  
  217. 2. Goals
  218.  
  219.    The goals of TLS Protocol, in order of their priority, are:
  220.  
  221.     1. Cryptographic security: TLS should be used to establish a secure
  222.        connection between two parties.
  223.  
  224.  
  225. Dierks, T.                  Expires September, 1997             [Page 4]
  226. INTERNET-DRAFT                     TLS 1.0                    March 1997
  227.  
  228.     2. Interoperability: Independent programmers should be able to
  229.        develop applications utilizing TLS that will then be able to
  230.        successfully exchange cryptographic parameters without knowledge
  231.        of one another's code.
  232.  
  233.  Note: It is not the case that all instances of TLS (even in the same
  234.        application domain) will be able to successfully connect. For
  235.        instance, if the server supports a particular hardware token,
  236.        and the client does not have access to such a token, then the
  237. ]      connection will not succeed. There is no required set of ciphers
  238. ]      for minimal compliance, so some implementations may be unable to
  239. ]      communicate.
  240.  
  241.     3. Extensibility: TLS seeks to provide a framework into which new
  242.        public key and bulk encryption methods can be incorporated as
  243.        necessary. This will also accomplish two sub-goals: to prevent
  244.        the need to create a new protocol (and risking the introduction
  245.        of possible new weaknesses) and to avoid the need to implement
  246.        an entire new security library.
  247.  
  248.     4. Relative efficiency: Cryptographic operations tend to be highly
  249.        CPU intensive, particularly public key operations. For this
  250.        reason, the TLS protocol has incorporated an optional session
  251.        caching scheme to reduce the number of connections that need to
  252.        be established from scratch. Additionally, care has been taken
  253.        to reduce network activity.
  254.  
  255. 3. Goals of this document
  256.  
  257. ]  This document and the TLS protocol itself are based on the SSL 3.0
  258. ]  Protocol Specification as published by Netscape. The differences
  259. ]  between this protocol and SSL 3.0 are not dramatic, but they are
  260. ]  significant enough that TLS 1.0 and SSL 3.0 do not interoperate
  261. ]  (although TLS 1.0 does incorporate a mechanism by which a TLS
  262. ]  implementation can back down to SSL 3.0). This document is intended
  263. ]  primarily for readers who will be implementing the protocol and
  264. ]  those doing cryptographic analysis of it. The specification has been
  265. ]  written with this in mind, and it is intended to reflect the needs
  266. ]  of those two groups. For that reason, many of the
  267. ]  algorithm-dependent data structures and rules are included in the
  268. ]  body of the text (as opposed to in an appendix), providing easier
  269. ]  access to them.
  270.  
  271.    This document is not intended to supply any details of service
  272.    definition nor interface definition, although it does cover select
  273.    areas of policy as they are required for the maintenance of solid
  274.    security.
  275.  
  276. 4. Presentation language
  277.  
  278.    This document deals with the formatting of data in an external
  279.    representation. The following very basic and somewhat casually
  280.  
  281. Dierks, T.                  Expires September, 1997             [Page 5]
  282. INTERNET-DRAFT                     TLS 1.0                    March 1997
  283.  
  284.    defined presentation syntax will be used. The syntax draws from
  285.    several sources in its structure. Although it resembles the
  286.    programming language "C" in its syntax and XDR [XDR] in both its
  287.    syntax and intent, it would be risky to draw too many parallels. The
  288.    purpose of this presentation language is to document TLS only, not
  289.    to have general application beyond that particular goal.
  290.  
  291. 4.1. Basic block size
  292.  
  293.    The representation of all data items is explicitly specified. The
  294.    basic data block size is one byte (i.e. 8 bits). Multiple byte data
  295.    items are concatenations of bytes, from left to right, from top to
  296.    bottom. From the bytestream a multi-byte item (a numeric in the
  297.    example) is formed (using C notation) by:
  298.  
  299.        value = (byte[0] << 8*(n-1)) | (byte[1] << 8*(n-2)) |
  300.                ... | byte[n-1];
  301.  
  302.    This byte ordering for multi-byte values is the commonplace network
  303.    byte order or big endian format.
  304.  
  305. 4.2. Miscellaneous
  306.  
  307.    Comments begin with "/*" and end with "*/".
  308.  
  309.    Optional components are denoted by enclosing them in "[[ ]]" double
  310.    brackets.
  311.  
  312.    Single byte entities containing uninterpreted data are of type
  313.    opaque.
  314.  
  315. 4.3. Vectors
  316.  
  317.    A vector (single dimensioned array) is a stream of homogeneous data
  318.    elements. The size of the vector may be specified at documentation
  319.    time or left unspecified until runtime. In either case the length
  320.    declares the number of bytes, not the number of elements, in the
  321.    vector. The syntax for specifying a new type T' that is a fixed
  322.    length vector of type T is
  323.  
  324.        T T'[n];
  325.  
  326.    Here T' occupies n bytes in the data stream, where n is a multiple
  327.    of the size of T. The length of the vector is not included in the
  328.    encoded stream.
  329.  
  330.    In the following example, Datum is defined to be three consecutive
  331.    bytes that the protocol does not interpret, while Data is three
  332.    consecutive Datum, consuming a total of nine bytes.
  333.  
  334.  
  335.  
  336.  
  337. Dierks, T.                  Expires September, 1997             [Page 6]
  338. INTERNET-DRAFT                     TLS 1.0                    March 1997
  339.  
  340.        opaque Datum[3];      /* three uninterpreted bytes */
  341.        Datum Data[9];        /* 3 consecutive 3 byte vectors */
  342.  
  343.    Variable length vectors are defined by specifying a subrange of
  344.    legal lengths, inclusively, using the notation <floor..ceiling>.
  345.    When encoded, the actual length precedes the vector's contents in
  346.    the byte stream. The length will be in the form of a number
  347.    consuming as many bytes as required to hold the vector's specified
  348.    maximum (ceiling) length. A variable length vector with an actual
  349.    length field of zero is referred to as an empty vector.
  350.  
  351.        T T'<floor..ceiling>;
  352.  
  353.    In the following example, mandatory is a vector that must contain
  354.    between 300 and 400 bytes of type opaque. It can never be empty. The
  355.    actual length field consumes two bytes, a uint16, sufficient to
  356.    represent the value 400 (see Section 4.4). On the other hand, longer
  357.    can represent up to 800 bytes of data, or 400 uint16 elements, and
  358.    it may be empty. Its encoding will include a two byte actual length
  359. |  field prepended to the vector. The length of an encoded vector must
  360. |  be an even multiple of the length of a single element (for example,
  361. |  a 17 byte vector of uint16 would be illegal).
  362.  
  363.        opaque mandatory<300..400>;
  364.              /* length field is 2 bytes, cannot be empty */
  365.        uint16 longer<0..800>;
  366.              /* zero to 400 16-bit unsigned integers */
  367.  
  368. 4.4. Numbers
  369.  
  370.    The basic numeric data type is an unsigned byte (uint8). All larger
  371.    numeric data types are formed from fixed length series of bytes
  372.    concatenated as described in Section 4.1 and are also unsigned. The
  373.    following numeric types are predefined.
  374.  
  375.        uint8 uint16[2];
  376.        uint8 uint24[3];
  377.        uint8 uint32[4];
  378.        uint8 uint64[8];
  379.  
  380. ]  All values, here and elsewhere in the specification, are stored in
  381. ]  "network" or "big-endian" order; the uint32 represented by the hex
  382. ]  bytes 01 02 03 04 is equivalent to the decimal value 16909060.
  383.  
  384. 4.5. Enumerateds
  385.  
  386.    An additional sparse data type is available called enum. A field of
  387.    type enum can only assume the values declared in the definition.
  388.    Each definition is a different type. Only enumerateds of the same
  389.    type may be assigned or compared. Every element of an enumerated
  390.    must be assigned a value, as demonstrated in the following example.
  391.    Since the elements of the enumerated are not ordered, they can be
  392.  
  393. Dierks, T.                  Expires September, 1997             [Page 7]
  394. INTERNET-DRAFT                     TLS 1.0                    March 1997
  395.  
  396.    assigned any unique value, in any order.
  397.  
  398.        enum { e1(v1), e2(v2), ... , en(vn), [[(n)]] } Te;
  399.  
  400.    Enumerateds occupy as much space in the byte stream as would its
  401.    maximal defined ordinal value. The following definition would cause
  402.    one byte to be used to carry fields of type Color.
  403.  
  404.        enum { red(3), blue(5), white(7) } Color;
  405.  
  406.    One may optionally specify a value without its associated tag to
  407.    force the width definition without defining a superfluous element.
  408.    In the following example, Taste will consume two bytes in the data
  409.    stream but can only assume the values 1, 2 or 4.
  410.  
  411.        enum { sweet(1), sour(2), bitter(4), (32000) } Taste;
  412.  
  413.    The names of the elements of an enumeration are scoped within the
  414.    defined type. In the first example, a fully qualified reference to
  415.    the second element of the enumeration would be Color.blue. Such
  416.    qualification is not required if the target of the assignment is
  417.    well specified.
  418.  
  419.        Color color = Color.blue;     /* overspecified, legal */
  420.        Color color = blue;           /* correct, type implicit */
  421.  
  422.    For enumerateds that are never converted to external representation,
  423.    the numerical information may be omitted.
  424.  
  425.        enum { low, medium, high } Amount;
  426.  
  427. 4.6. Constructed types
  428.  
  429.    Structure types may be constructed from primitive types for
  430.    convenience. Each specification declares a new, unique type. The
  431.    syntax for definition is much like that of C.
  432.  
  433.        struct {
  434.          T1 f1;
  435.          T2 f2;
  436.          ...
  437.          Tn fn;
  438.        } [[T]];
  439.  
  440.    The fields within a structure may be qualified using the type's name
  441.    using a syntax much like that available for enumerateds. For
  442.    example, T.f2 refers to the second field of the previous
  443.    declaration. Structure definitions may be embedded.
  444.  
  445. 4.6.1. Variants
  446.  
  447.    Defined structures may have variants based on some knowledge that is
  448.  
  449. Dierks, T.                  Expires September, 1997             [Page 8]
  450. INTERNET-DRAFT                     TLS 1.0                    March 1997
  451.  
  452.    available within the environment. The selector must be an enumerated
  453.    type that defines the possible variants the structure defines. There
  454.    must be a case arm for every element of the enumeration declared in
  455.    the select. The body of the variant structure may be given a label
  456.    for reference. The mechanism by which the variant is selected at
  457.    runtime is not prescribed by the presentation language.
  458.  
  459.        struct {
  460.            T1 f1;
  461.            T2 f2;
  462.            ....
  463.            Tn fn;
  464.            select (E) {
  465.                case e1: Te1;
  466.                case e2: Te2;
  467.                ....
  468.                case en: Ten;
  469.            } [[fv]];
  470.        } [[Tv]];
  471.  
  472.    For example:
  473.  
  474.        enum { apple, orange } VariantTag;
  475.        struct {
  476.            uint16 number;
  477.            opaque string<0..10>; /* variable length */
  478.        } V1;
  479.        struct {
  480.            uint32 number;
  481.            opaque string[10];    /* fixed length */
  482.        } V2;
  483.        struct {
  484.            select (VariantTag) { /* value of selector is implicit */
  485.                case apple: V1;   /* VariantBody, tag = apple */
  486.                case orange: V2;  /* VariantBody, tag = orange */
  487.            } variant_body;       /* optional label on variant */
  488.        } VariantRecord;
  489.  
  490.    Variant structures may be qualified (narrowed) by specifying a value
  491.    for the selector prior to the type. For example, a
  492.  
  493.        orange VariantRecord
  494.  
  495.    is a narrowed type of a VariantRecord containing a variant_body of
  496.    type V2.
  497.  
  498. 4.7. Cryptographic attributes
  499.  
  500.    The four cryptographic operations digital signing, stream cipher
  501.    encryption, block cipher encryption, and public key encryption are
  502.    designated digitally-signed, stream-ciphered, block-ciphered, and
  503.    public-key-encrypted, respectively. A field's cryptographic
  504.  
  505. Dierks, T.                  Expires September, 1997             [Page 9]
  506. INTERNET-DRAFT                     TLS 1.0                    March 1997
  507.  
  508.    processing is specified by prepending an appropriate key word
  509.    designation before the field's type specification. Cryptographic
  510.    keys are implied by the current session state (see Section 5.1).
  511.  
  512.    In digital signing, one-way hash functions are used as input for a
  513.    signing algorithm. In RSA signing, a 36-byte structure of two hashes
  514.    (one SHA and one MD5) is signed (encrypted with the private key). In
  515.    DSS, the 20 bytes of the SHA hash are run directly through the
  516.    Digital Signing Algorithm with no additional hashing. A
  517.    digitally-signed element is encoded as an opaque vector <0..2^16-1>,
  518.    where the length is specified by the signing algorithm and key.
  519.  
  520.    In stream cipher encryption, the plaintext is exclusive-ORed with an
  521.    identical amount of output generated from a cryptographically-secure
  522.    keyed pseudorandom number generator.
  523.  
  524.    In block cipher encryption, every block of plaintext encrypts to a
  525.    block of ciphertext. All block cipher encryption is done in CBC
  526.    (Cipher Block Chaining) mode, and all items which are block-ciphered
  527.    will be an exact multiple of the cipher block length.
  528.  
  529.    In public key encryption, a public key algorithm is used to encrypt
  530.    data in such a way that it can be decrypted only with the matching
  531.    private key. A public-key-encrypted element is encoded as an opaque
  532.    vector <0..2^16-1>, where the length is specified by the signing
  533.    algorithm and key.
  534.  
  535.    In the following example:
  536.  
  537.        stream-ciphered struct {
  538.            uint8 field1;
  539.            uint8 field2;
  540.            digitally-signed opaque hash[20];
  541.        } UserType;
  542.  
  543.    The contents of hash are used as input for the signing algorithm,
  544.    then the entire structure is encrypted with a stream cipher. The
  545.    length of this structure, in bytes would be equal to 2 bytes for
  546.    field1 and field2, plus two bytes for the length of the signature,
  547.    plus the length of the output of the signing algorithm. This is
  548.    known due to the fact that the algorithm and key used for the
  549.    signing are known prior to encoding or decoding this structure.
  550.  
  551. 4.8. Constants
  552.  
  553.    Typed constants can be defined for purposes of specification by
  554.    declaring a symbol of the desired type and assigning values to it.
  555.    Under-specified types (opaque, variable length vectors, and
  556.    structures that contain opaque) cannot be assigned values. No fields
  557.    of a multi-element structure or vector may be elided.
  558.  
  559.  
  560.  
  561. Dierks, T.                  Expires September, 1997            [Page 10]
  562. INTERNET-DRAFT                     TLS 1.0                    March 1997
  563.  
  564.    For example,
  565.  
  566.        struct {
  567.            uint8 f1;
  568.            uint8 f2;
  569.        } Example1;
  570.  
  571.        Example1 ex1 = {1, 4};  /* assigns f1 = 1, f2 = 4 */
  572.  
  573. 5. HMAC and the pseudorandom function
  574.  
  575. ]  A number of operations in the TLS record and handshake layer
  576. ]  required a keyed MAC; this is a secure digest of some data protected
  577. ]  by a secret. Forging the MAC is infeasible without knowledge of the
  578. ]  MAC secret. Finding two data messages which have the same MAC is
  579. ]  also cryptographically infeasible. The construction we use for this
  580. ]  operation is known as HMAC, described in [HMAC].
  581.  
  582. ]  HMAC can be used with a variety of different hash algorithms. TLS
  583. ]  uses it in the handshake with two different algorithms: MD5 and
  584. ]  SHA-1, denoting these as HMAC_MD5(secret, data) and HMAC_SHA(secret,
  585. ]  data). Additional hash algorithms can be defined by cipher suites
  586. ]  and used to protect record data, but MD5 and SHA-1 are hard coded
  587. ]  into the description of the handshaking for this version of the
  588. ]  protocol.
  589.  
  590. ]  In addition, a construction is required to do expansion of secrets
  591. ]  into blocks of data for the purposes of key generation or
  592. ]  validation. This pseudo-random function (PRF) takes as input a
  593. |  secret, a seed, and an identifying label and produces an output of
  594. |  arbitrary length.
  595.  
  596. ]  In order to make the PRF as secure as possible, it uses two hash
  597. ]  algorithms in a way which should guarantee its security if either
  598. ]  algorithm remains secure.
  599.  
  600. ]  First, we define a data expansion function, P_hash(secret, data)
  601. ]  which uses a single hash function to expand a secret and seed into
  602. ]  an arbitrary quantity of output:
  603.  
  604. ]      P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) +
  605. ]                             HMAC_hash(secret, A(2) + seed) +
  606. ]                             HMAC_hash(secret, A(3) + seed) + ...
  607.  
  608. ]  Where + indicates concatenation.
  609.  
  610. ]  A() is defined as:
  611. ]      A(0) = seed
  612. ]      A(i) = HMAC_hash(secret, A(i-1))
  613.  
  614.  
  615.  
  616.  
  617. Dierks, T.                  Expires September, 1997            [Page 11]
  618. INTERNET-DRAFT                     TLS 1.0                    March 1997
  619.  
  620. ]  P_hash can be iterated as many times as is necessary to produce the
  621. ]  required quantity of data. For example, if P_SHA-1 was being used to
  622. ]  create 64 bytes of data, it would have to be iterated 4 times
  623. ]  (through A(4)), creating 80 bytes of output data; the last 16 bytes
  624. ]  of the final iteration would then be discarded, leaving 64 bytes of
  625. ]  output data.
  626.  
  627. ]  TLS's PRF is created by splitting the secret into two halves and
  628. ]  using one half to generate data with P_MD5 and the other half to
  629. ]  generate data with P_SHA1, then exclusive-or'ing the outputs of
  630. ]  these two expansion functions together.
  631.  
  632. ]  S1 and S2 are the two halves of the secret and each is the same
  633. ]  length. S1 is taken from the first half of the secret, S2 from the
  634. ]  second half. Their length is created by rounding up the length of
  635. ]  the overall secret divided by two; thus, if the original secret is
  636. ]  an odd number of bytes long, the last byte of S1 will be the same as
  637. ]  the first byte of S2.
  638.  
  639. ]      L_S = length in bytes of secret;
  640. ]      L_S1 = L_S2 = ceil(L_S / 2);
  641.  
  642. ]  The secret is partitioned into two halves (with the possibility of
  643. ]  one shared byte) as described above, S1 taking the first L_S1 bytes
  644. ]  and S2 the last L_S2 bytes.
  645.  
  646. ]  The PRF is then defined as the result of mixing the two pseudorandom
  647. ]  streams by exclusive-or'ing them together.
  648.  
  649. |      PRF(secret, label, seed) = P_MD5(S1, label + seed) XOR
  650. |                                 P_SHA-1(S2, label + seed);
  651.  
  652. ]  Note that because MD5 produces 16 byte outputs and SHA-1 produces 20
  653. ]  byte outputs, the boundaries of their internal iterations will not
  654. ]  be aligned; to generate a 80 byte output will involve P_MD5 being
  655. ]  iterated through A(5), while P_SHA-1 will only iterate through A(4).
  656.  
  657. 6. The TLS Record Protocol
  658.  
  659.    The TLS Record Protocol is a layered protocol. At each layer,
  660.    messages may include fields for length, description, and content.
  661.    The Record Protocol takes messages to be transmitted, fragments the
  662.    data into manageable blocks, optionally compresses the data, applies
  663.    a MAC, encrypts, and transmits the result. Received data is
  664.    decrypted, verified, decompressed, and reassembled, then delivered
  665.    to higher level clients.
  666.  
  667. ]  Four record protocol clients are described in this document: the
  668. ]  handshake protocol, the alert protocol, the change cipher spec
  669. ]  protocol, and the application data protocol. In order to allow
  670. ]  extension of the TLS protocol, additional record types can be
  671. ]  supported by the record protocol. Any new record types should
  672.  
  673. Dierks, T.                  Expires September, 1997            [Page 12]
  674. INTERNET-DRAFT                     TLS 1.0                    March 1997
  675.  
  676. ]  allocate type values immediately beyond the ContentType values for
  677. ]  the four record types described here (see Appendix A.2). If a TLS
  678. ]  implementation receives a record type it does not understand, it
  679. ]  should just ignore it. Any protocol designed for use over TLS must
  680. ]  be carefully designed to deal with all possible attacks against it.
  681. |  Note that because the type and length of a record are not protected
  682. |  by encryption, care should be take to minimize the value of traffic
  683. |  analysis of these values.
  684.  
  685. 6.1. Connection states
  686.  
  687.    A TLS connection state is the operating environment of the TLS
  688.    Record Protocol. It specifies a compression algorithm, encryption
  689.    algorithm, and MAC algorithm. In addition, the parameters for these
  690.    algorithms are known: the MAC secret and the bulk encryption keys
  691.    and IVs for the connection in both the read and the write
  692.    directions. Logically, there are always four connection states
  693.    outstanding: the current read and write states, and the pending read
  694.    and write states. All records are processed under the current read
  695.    and write states. The security parameters for the pending states can
  696.    be set by the TLS Handshake Protocol, and the Handshake Protocol can
  697.    selectively make either of the pending states current, in which case
  698.    the appropriate current state is disposed of and replaced with the
  699.    pending state; the pending state is then reinitialized to an empty
  700.    state. It is illegal to make a state which has not been initialized
  701. |  with security parameters a current state. The initial current state
  702. |  always specifies that no encryption, compression, or MAC will be
  703. |  used.
  704.  
  705.    The security parameters for a TLS Connection read and write state
  706.    are set by providing the following values:
  707.  
  708.    connection end
  709.        Whether this entity is considered the "client" or the "server"
  710.        in this connection.
  711.  
  712.    bulk encryption algorithm
  713.        An algorithm to be used for bulk encryption. This specification
  714.        includes the key size of this algorithm, how much of that key is
  715.        secret, whether it is a block or stream cipher, the block size
  716.        of the cipher (if appropriate), and whether it is considered an
  717.        "export" cipher.
  718.  
  719.    MAC algorithm
  720.        An algorithm to be used for message authentication. This
  721.        specification includes the size of the hash which is returned by
  722.        the MAC algorithm.
  723.  
  724.    compression algorithm
  725.        An algorithm to be used for data compression. This specification
  726.        must include all information the algorithm requires to do
  727.        compression.
  728.  
  729. Dierks, T.                  Expires September, 1997            [Page 13]
  730. INTERNET-DRAFT                     TLS 1.0                    March 1997
  731.  
  732.    master secret
  733.        A 48 byte secret shared between the two peers in the connection.
  734.  
  735.    client random
  736.        A 32 byte value provided by the client.
  737.  
  738.    server random
  739.        A 32 byte value provided by the server.
  740.  
  741.    These parameters are defined in the presentation language as:
  742.  
  743.        enum { server, client } ConnectionEnd;
  744.  
  745.        enum { null, rc4, rc2, des, 3des, des40 } BulkCipherAlgorithm;
  746.  
  747.        enum { stream, block } CipherType;
  748.  
  749.        enum { true, false } IsExportable;
  750.  
  751.        enum { null, md5, sha } MACAlgorithm;
  752.  
  753.        enum { null(0), (255) } CompressionMethod;
  754.  
  755.        /* The algorithms specified in CompressionMethod,
  756.           BulkCipherAlgorithm, and MACAlgorithm may be added to. */
  757.  
  758.        struct {
  759.            ConnectionEnd          entity;
  760.            BulkCipherAlgorithm    bulk_cipher_algorithm;
  761.            CipherType             cipher_type;
  762.            uint8                  key_size;
  763.            uint8                  key_material_length;
  764.            IsExportable           is_exportable;
  765.            MACAlgorithm           mac_algorithm;
  766.            uint8                  hash_size;
  767.            CompressionMethod      compression_algorithm;
  768.            opaque                 master_secret[48];
  769.            opaque                 client_random[32];
  770.            opaque                 server_random[32];
  771.        } SecurityParameters;
  772.  
  773.    The record layer will use the security parameters to generate the
  774.    following six items:
  775.  
  776.        client write MAC secret
  777.        server write MAC secret
  778.        client write key
  779.        server write key
  780.        client write IV (for block ciphers only)
  781.        server write IV (for block ciphers only)
  782.  
  783.  
  784.  
  785. Dierks, T.                  Expires September, 1997            [Page 14]
  786. INTERNET-DRAFT                     TLS 1.0                    March 1997
  787.  
  788.    The client write parameters are used by the server when receiving
  789.    and processing records and vice-versa. The algorithm used for
  790.    generating these items from the security parameters is described in
  791.    section 6.3.
  792.  
  793.    Once the security parameters have been set and the keys have been
  794.    generated, the connection states can be instantiated by making them
  795.    the current states. These current states must be updated for each
  796.    record processed. Each connection state includes the following
  797.    elements:
  798.  
  799.    compression state
  800.        The current state of the compression algorithm.
  801.  
  802.    cipher state
  803.        The current state of the encryption algorithm. This will consist
  804.        of the scheduled key for that connection. In addition, for block
  805. |      ciphers running in CBC mode (the only mode specified for TLS),
  806. |      this will initially contain the IV for that connection state and
  807. |      be updated to contain the ciphertext of the last block encrypted
  808. |      or decrypted as records are processed. For stream ciphers, this
  809. |      will contain whatever the necessary state information is to
  810. |      allow the stream to continue to encrypt or decrypt data.
  811.  
  812.    MAC secret
  813.        The MAC secret for this connection as generated above.
  814.  
  815.    sequence number
  816.        Each connection state contains a sequence number, which is
  817.        maintained separately for read and write states. The sequence
  818.        number must be set to zero whenever a connection state is made
  819.        the active state. Sequence numbers are of type uint64 and may
  820.        not exceed 2^64-1. A sequence number is incremented after each
  821.        record: specifically, the first record which is transmitted
  822.        under a particular connection state should use sequence number
  823.        0.
  824.  
  825. 6.2. Record layer
  826.  
  827.    The TLS Record Layer receives uninterpreted data from higher layers
  828.    in non-empty blocks of arbitrary size.
  829.  
  830. 6.2.1. Fragmentation
  831.  
  832.    The record layer fragments information blocks into TLSPlaintext
  833.    records of 2^14 bytes or less. Client message boundaries are not
  834.    preserved in the record layer (i.e., multiple client messages of the
  835.    same ContentType may be coalesced into a single TLSPlaintext record,
  836.    or a single message may be fragmented across several records).
  837.  
  838.  
  839.  
  840.  
  841. Dierks, T.                  Expires September, 1997            [Page 15]
  842. INTERNET-DRAFT                     TLS 1.0                    March 1997
  843.  
  844.        struct {
  845.            uint8 major, minor;
  846.        } ProtocolVersion;
  847.  
  848.        enum {
  849.            change_cipher_spec(20), alert(21), handshake(22),
  850.            application_data(23), (255)
  851.        } ContentType;
  852.  
  853.        struct {
  854.            ContentType type;
  855.            ProtocolVersion version;
  856.            uint16 length;
  857.            opaque fragment[TLSPlaintext.length];
  858.        } TLSPlaintext;
  859.  
  860.    type
  861.        The higher level protocol used to process the enclosed fragment.
  862.  
  863.    version
  864.        The version of the protocol being employed. This document
  865. ]      describes TLS Version 1.0, which uses the version { 3, 1 }. The
  866. ]      version value 3.1 is historical: TLS version 1.0 is a minor
  867. ]      modification to the SSL 3.0 protocol, which bears the version
  868. ]      value 3.0. (See Appendix A.1.1).
  869.  
  870.    length
  871.        The length (in bytes) of the following TLSPlaintext.fragment.
  872.        The length should not exceed 2^14.
  873.  
  874.    fragment
  875.        The application data. This data is transparent and treated as an
  876.        independent block to be dealt with by the higher level protocol
  877.        specified by the type field.
  878.  
  879.  Note: Data of different TLS Record layer content types may be
  880.        interleaved. Application data is generally of lower precedence
  881.        for transmission than other content types.
  882.  
  883. 6.2.2. Record compression and decompression
  884.  
  885.    All records are compressed using the compression algorithm defined
  886.    in the current session state. There is always an active compression
  887.    algorithm; however, initially it is defined as
  888.    CompressionMethod.null. The compression algorithm translates a
  889.    TLSPlaintext structure into a TLSCompressed structure. Compression
  890.    functions are initialized with default state information whenever a
  891.    connection state is made active.
  892.  
  893.    Compression must be lossless and may not increase the content length
  894.    by more than 1024 bytes. If the decompression function encounters a
  895.    TLSCompressed.fragment that would decompress to a length in excess
  896.  
  897. Dierks, T.                  Expires September, 1997            [Page 16]
  898. INTERNET-DRAFT                     TLS 1.0                    March 1997
  899.  
  900.    of 2^14 bytes, it should report a fatal decompression failure error.
  901.  
  902.        struct {
  903.            ContentType type;       /* same as TLSPlaintext.type */
  904.            ProtocolVersion version;/* same as TLSPlaintext.version */
  905.            uint16 length;
  906.            opaque fragment[TLSCompressed.length];
  907.        } TLSCompressed;
  908.  
  909.    length
  910.        The length (in bytes) of the following TLSCompressed.fragment.
  911.        The length should not exceed 2^14 + 1024.
  912.  
  913.    fragment
  914.        The compressed form of TLSPlaintext.fragment.
  915.  
  916.  Note: A CompressionMethod.null operation is an identity operation; no
  917.        fields are altered.
  918.  
  919.    Implementation note:
  920.        Decompression functions are responsible for ensuring that
  921.        messages cannot cause internal buffer overflows.
  922.  
  923. 6.2.3. Record payload protection
  924.  
  925.    The encryption and MAC functions translate a TLSCompressed structure
  926.    into a TLSCiphertext. The decryption functions reverse the process.
  927. |  Transmissions also include a sequence number so that missing, extra
  928. |  or repeated messages are detectable.
  929.  
  930.        struct {
  931.            ContentType type;
  932.            ProtocolVersion version;
  933.            uint16 length;
  934.            select (CipherSpec.cipher_type) {
  935.                case stream: GenericStreamCipher;
  936.                case block: GenericBlockCipher;
  937.            } fragment;
  938.        } TLSCiphertext;
  939.  
  940.    type
  941.        The type field is identical to TLSCompressed.type.
  942.  
  943.    version
  944.        The version field is identical to TLSCompressed.version.
  945.  
  946.    length
  947.        The length (in bytes) of the following TLSCiphertext.fragment.
  948.        The length may not exceed 2^14 + 2048.
  949.  
  950.  
  951.  
  952.  
  953. Dierks, T.                  Expires September, 1997            [Page 17]
  954. INTERNET-DRAFT                     TLS 1.0                    March 1997
  955.  
  956.    fragment
  957.        The encrypted form of TLSCompressed.fragment, with the MAC.
  958.  
  959. 6.2.3.1. Null or standard stream cipher
  960.  
  961.    Stream ciphers (including BulkCipherAlgorithm.null - see Appendix
  962.    A.7) convert TLSCompressed.fragment structures to and from stream
  963.    TLSCiphertext.fragment structures.
  964.  
  965.        stream-ciphered struct {
  966.            opaque content[TLSCompressed.length];
  967.            opaque MAC[CipherSpec.hash_size];
  968.        } GenericStreamCipher;
  969.  
  970.    The MAC is generated as:
  971.  
  972. |      HMAC_hash(MAC_write_secret, seq_num + TLSCompressed.type +
  973. |                    TLSCompressed.version + TLSCompressed.length +
  974.                      TLSCompressed.fragment));
  975.  
  976.    where "+" denotes concatenation.
  977.  
  978.    seq_num
  979.        The sequence number for this record.
  980.  
  981.    hash
  982.        The hashing algorithm specified by
  983.        SecurityParameters.mac_algorithm.
  984.  
  985.    Note that the MAC is computed before encryption. The stream cipher
  986.    encrypts the entire block, including the MAC. For stream ciphers
  987.    that do not use a synchronization vector (such as RC4), the stream
  988.    cipher state from the end of one record is simply used on the
  989.    subsequent packet. If the CipherSuite is TLS_NULL_WITH_NULL_NULL,
  990.    encryption consists of the identity operation (i.e., the data is not
  991.    encrypted and the MAC size is zero implying that no MAC is used).
  992.    TLSCiphertext.length is TLSCompressed.length plus
  993.    CipherSpec.hash_size.
  994.  
  995. 6.2.3.2. CBC block cipher
  996.  
  997.    For block ciphers (such as RC2 or DES), the encryption and MAC
  998.    functions convert TLSCompressed.fragment structures to and from
  999.    block TLSCiphertext.fragment structures.
  1000.  
  1001.        block-ciphered struct {
  1002.            opaque content[TLSCompressed.length];
  1003.            opaque MAC[CipherSpec.hash_size];
  1004.            uint8 padding[GenericBlockCipher.padding_length];
  1005.            uint8 padding_length;
  1006.        } GenericBlockCipher;
  1007.  
  1008.  
  1009. Dierks, T.                  Expires September, 1997            [Page 18]
  1010. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1011.  
  1012.    The MAC is generated as described in Section 6.2.3.1.
  1013.  
  1014.    padding
  1015.        Padding that is added to force the length of the plaintext to be
  1016. ]      an even multiple of the block cipher's block length. The padding
  1017. ]      may be any length up to 255 bytes long, as long as it results in
  1018. ]      the TLSCiphertext.length being an even multiple of the block
  1019. ]      length. Lengths longer than necessary might be desirable to
  1020. ]      frustrate attacks on a protocol based on analysis of the lengths
  1021. |      of exchanged messages. Each uint8 in the padding data vector
  1022. |      must be filled with the padding length value.
  1023.  
  1024.    padding_length
  1025. |      The padding length should be such that the total size of the
  1026. |      GenericBlockCipher structure is a multiple of the cipher's block
  1027. |      length. Legal values range from zero to 255, inclusive.
  1028.  
  1029.    The encrypted data length (TLSCiphertext.length) is one more than
  1030.    the sum of TLSCompressed.length, CipherSpec.hash_size, and
  1031.    padding_length.
  1032.  
  1033. Example: If the block length is 8 bytes, the content length
  1034. ]        (TLSCompressed.length) is 61 bytes, and the MAC length is 20
  1035. ]        bytes, the length before padding is 82 bytes. Thus, the
  1036. ]        padding length modulo 8 must be equal to 6 in order to make
  1037. ]        the total length an even multiple of 8 bytes (the block
  1038. ]        length). The padding length can be 6, 14, 22, and so on,
  1039. ]        through 254. If the padding length were the minimum necessary,
  1040. ]        6, the padding would be 6 bytes, each containing the value 6.
  1041.  
  1042.  Note: With block ciphers in CBC mode (Cipher Block Chaining) the
  1043.        initialization vector (IV) for the first record is generated
  1044.        with the other keys and secrets when the security parameters are
  1045.        set. The IV for subsequent records is the last ciphertext block
  1046.        from the previous record.
  1047.  
  1048. 6.3. Key calculation
  1049.  
  1050.    The Record Protocol requires an algorithm to generate keys, IVs, and
  1051.    MAC secrets from the security parameters provided by the handshake
  1052.    protocol.
  1053.  
  1054.    The master secret is hashed into a sequence of secure bytes, which
  1055.    are assigned to the MAC secrets, keys, and non-export IVs required
  1056.    by the current connection state (see Appendix A.7). CipherSpecs
  1057.    require a client write MAC secret, a server write MAC secret, a
  1058.    client write key, a server write key, a client write IV, and a
  1059.    server write IV, which are generated from the master secret in that
  1060.    order. Unused values are empty.
  1061.  
  1062.  
  1063.  
  1064.  
  1065. Dierks, T.                  Expires September, 1997            [Page 19]
  1066. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1067.  
  1068.    When generating keys and MAC secrets, the master secret is used as
  1069.    an entropy source, and the random values provide unencrypted salt
  1070.    material and IVs for exportable ciphers.
  1071.  
  1072.    To generate the key material, compute
  1073.  
  1074. ]      key_block = PRF(SecurityParameters.master_secret,
  1075. |                         "key expansion",
  1076. ]                         SecurityParameters.server_random +
  1077. ]                         SecurityParameters.client_random);
  1078.  
  1079.    until enough output has been generated. Then the key_block is
  1080.    partitioned as follows:
  1081.  
  1082.        client_write_MAC_secret[SecurityParameters.hash_size]
  1083.        server_write_MAC_secret[SecurityParameters.hash_size]
  1084.        client_write_key[SecurityParameters.key_material]
  1085.        server_write_key[SecurityParameters.key_material]
  1086.        client_write_IV[SecurityParameters.IV_size]
  1087.        server_write_IV[SecurityParameters.IV_size]
  1088.  
  1089.    The client_write_IV and server_write_IV are only generated for
  1090.    non-export block ciphers. For exportable block ciphers, the
  1091.    initialization vectors are generated later, as described below. Any
  1092.    extra key_block material is discarded.
  1093.  
  1094.    Implementation note:
  1095.        The cipher spec which is defined in this document which requires
  1096.        the most material is 3DES_EDE_CBC_SHA: it requires 2 x 24 byte
  1097.        keys, 2 x 20 byte MAC secrets, and 2 x 8 byte IVs, for a total
  1098. |      of 104 bytes of key material.
  1099.  
  1100.    Exportable encryption algorithms (for which CipherSpec.is_exportable
  1101.    is true) require additional processing as follows to derive their
  1102.    final write keys:
  1103.  
  1104. ]      final_client_write_key =
  1105. ]      PRF(SecurityParameters.client_write_key,
  1106. |                                 "client write key",
  1107. ]                                 SecurityParameters.client_random +
  1108. ]                                 SecurityParameters.server_random);
  1109. ]      final_server_write_key =
  1110. ]      PRF(SecurityParameters.server_write_key,
  1111. |                                 "server write key",
  1112. ]                                 SecurityParameters.client_random +
  1113. ]                                 SecurityParameters.server_random);
  1114.  
  1115. ]  Exportable encryption algorithms derive their IVs solely from the
  1116. ]  random values from the hello messages:
  1117.  
  1118.  
  1119.  
  1120.  
  1121. Dierks, T.                  Expires September, 1997            [Page 20]
  1122. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1123.  
  1124. |      iv_block = PRF("", "IV block", SecurityParameters.client_random
  1125. ]                    + SecurityParameters.server_random);
  1126.  
  1127. ]  The iv_block is partitioned into two initialization vectors as the
  1128. ]  key_block was above:
  1129.  
  1130. ]      client_write_IV[SecurityParameters.IV_size]
  1131. ]      server_write_IV[SecurityParameters.IV_size]
  1132.  
  1133. ]  Note that the PRF is used without a secret in this case: this just
  1134. ]  means that the secret has a length of zero bytes and contributes
  1135. ]  nothing to the hashing in the PRF.
  1136.  
  1137. 6.3.1. Export key generation example
  1138.  
  1139.    TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 requires five random bytes for
  1140.    each of the two encryption keys and 16 bytes for each of the MAC
  1141. |  keys, for a total of 42 bytes of key material. The PRF output is
  1142. |  stored in the key_block. The key_block is partitioned, and the write
  1143. |  keys are salted because this is an exportable encryption algorithm.
  1144.  
  1145. ]      key_block               = PRF(master_secret,
  1146. |                                    "key expansion",
  1147. ]                                    master_secret +
  1148. ]                                    server_random +
  1149. ]                                    client_random)[0..41]
  1150.        client_write_MAC_secret = key_block[0..15]
  1151.        server_write_MAC_secret = key_block[16..31]
  1152.        client_write_key        = key_block[32..36]
  1153.        server_write_key        = key_block[37..41]
  1154. ]      final_client_write_key  = PRF(client_write_key,
  1155. |                                    "client write key",
  1156. ]                                    client_random +
  1157. ]                                    server_random)[0..15]
  1158. ]      final_server_write_key  = PRF(server_write_key,
  1159. |                                    "server write key",
  1160. ]                                    client_random +
  1161. ]                                    server_random)[0..15]
  1162. |      iv_block                = PRF("", "IV block", client_random +
  1163. ]                                    server_random)[0..15]
  1164. ]      client_write_IV = iv_block[0..7]
  1165. ]      server_write_IV = iv_block[8..15]
  1166.  
  1167. 7. The TLS Handshake Protocol
  1168.  
  1169.    The TLS Handshake Protocol consists of a suite of three
  1170.    sub-protocols which are used to allow peers to agree upon security
  1171.    parameters for the record layer, authenticate themselves,
  1172.    instantiate negotiated security parameters, and report error
  1173.    conditions to each other.
  1174.  
  1175.  
  1176.  
  1177. Dierks, T.                  Expires September, 1997            [Page 21]
  1178. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1179.  
  1180.    The Handshake Protocol is responsible for negotiating a session,
  1181.    which consists of the following items:
  1182.  
  1183.    session identifier
  1184.        An arbitrary byte sequence chosen by the server to identify an
  1185.        active or resumable session state.
  1186.  
  1187.    peer certificate
  1188.        X509v3[X509] certificate of the peer. This element of the state
  1189.        may be null.
  1190.  
  1191.    compression method
  1192.        The algorithm used to compress data prior to encryption.
  1193.  
  1194.    cipher spec
  1195.        Specifies the bulk data encryption algorithm (such as null, DES,
  1196.        etc.) and a MAC algorithm (such as MD5 or SHA). It also defines
  1197.        cryptographic attributes such as the hash_size. (See Appendix
  1198.        A.7 for formal definition)
  1199.  
  1200.    master secret
  1201.        48-byte secret shared between the client and server.
  1202.  
  1203.    is resumable
  1204.        A flag indicating whether the session can be used to initiate
  1205.        new connections.
  1206.  
  1207.    These items are then used to create security parameters for use by
  1208.    the Record Layer when protecting application data. Many connections
  1209.    can be instantiated using the same session through the resumption
  1210.    feature of the TLS Handshake Protocol.
  1211.  
  1212. 7.1. Change cipher spec protocol
  1213.  
  1214.    The change cipher spec protocol exists to signal transitions in
  1215.    ciphering strategies. The protocol consists of a single message,
  1216.    which is encrypted and compressed under the current (not the
  1217.    pending) connection state. The message consists of a single byte of
  1218.    value 1.
  1219.  
  1220.        struct {
  1221.            enum { change_cipher_spec(1), (255) } type;
  1222.        } ChangeCipherSpec;
  1223.  
  1224.    The change cipher spec message is sent by both the client and server
  1225.    to notify the receiving party that subsequent records will be
  1226.    protected under the newly negotiated CipherSpec and keys. Reception
  1227.    of this message causes the receiver to instruct the Record Layer to
  1228.    immediately copy the read pending state into the read current state.
  1229.    Immediately after sending this message, the sender should instruct
  1230.    the record layer to make the write pending state the write active
  1231.    state. (See section 6.1.) The change cipher spec message is sent
  1232.  
  1233. Dierks, T.                  Expires September, 1997            [Page 22]
  1234. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1235.  
  1236.    during the handshake after the security parameters have been agreed
  1237.    upon, but before the verifying finished message is sent (see section
  1238.    7.4.9).
  1239.  
  1240. 7.2. Alert protocol
  1241.  
  1242.    One of the content types supported by the TLS Record layer is the
  1243.    alert type. Alert messages convey the severity of the message and a
  1244.    description of the alert. Alert messages with a level of fatal
  1245.    result in the immediate termination of the connection. In this case,
  1246.    other connections corresponding to the session may continue, but the
  1247.    session identifier must be invalidated, preventing the failed
  1248.    session from being used to establish new connections. Like other
  1249.    messages, alert messages are encrypted and compressed, as specified
  1250.    by the current connection state.
  1251.  
  1252.        enum { warning(1), fatal(2), (255) } AlertLevel;
  1253.  
  1254.        enum {
  1255.            close_notify(0),
  1256.            unexpected_message(10),
  1257.            bad_record_mac(20),
  1258. ]          decryption_failed(21),
  1259. ]          record_overflow(22),
  1260.            decompression_failure(30),
  1261.            handshake_failure(40),
  1262.            bad_certificate(42),
  1263.            unsupported_certificate(43),
  1264.            certificate_revoked(44),
  1265.            certificate_expired(45),
  1266.            certificate_unknown(46),
  1267.            illegal_parameter(47),
  1268. ]          unknown_ca(48),
  1269. ]          access_denied(49),
  1270. ]          decode_error(50),
  1271. ]          decrypt_error(51),
  1272. ]          export_restriction(60),
  1273. ]          protocol_version(70),
  1274. ]          insufficient_security(71),
  1275. ]          internal_error(80),
  1276. ]          user_canceled(90),
  1277. ]          no_renegotiation(100),
  1278.            (255)
  1279.        } AlertDescription;
  1280.  
  1281.        struct {
  1282.            AlertLevel level;
  1283.            AlertDescription description;
  1284.        } Alert;
  1285.  
  1286.  
  1287.  
  1288.  
  1289. Dierks, T.                  Expires September, 1997            [Page 23]
  1290. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1291.  
  1292. 7.2.1. Closure alerts
  1293.  
  1294.    The client and the server must share knowledge that the connection
  1295.    is ending in order to avoid a truncation attack. Either party may
  1296.    initiate the exchange of closing messages.
  1297.  
  1298.    close_notify
  1299.        This message notifies the recipient that the sender will not
  1300.        send any more messages on this connection. The session becomes
  1301.        unresumable if any connection is terminated without proper
  1302.        close_notify messages with level equal to warning.
  1303.  
  1304.    Either party may initiate a close by sending a close_notify alert.
  1305.    Any data received after a closure alert is ignored.
  1306.  
  1307.    Each party is required to send a close_notify alert before closing
  1308.    the write side of the connection. It is required that the other
  1309.    party respond with a close_notify alert of its own and close down
  1310.    the connection immediately, discarding any pending writes. It is not
  1311.    required for the initiator of the close to wait for the responding
  1312.    close_notify alert before closing the read side of the connection.
  1313.  
  1314.    NB: It is assumed that closing a connection reliably delivers
  1315.        pending data before destroying the transport.
  1316.  
  1317. 7.2.2. Error alerts
  1318.  
  1319.    Error handling in the TLS Handshake protocol is very simple. When an
  1320.    error is detected, the detecting party sends a message to the other
  1321.    party. Upon transmission or receipt of an fatal alert message, both
  1322.    parties immediately close the connection. Servers and clients are
  1323.    required to forget any session-identifiers, keys, and secrets
  1324.    associated with a failed connection. The following error alerts are
  1325.    defined:
  1326.  
  1327.    unexpected_message
  1328.        An inappropriate message was received. This alert is always
  1329.        fatal and should never be observed in communication between
  1330.        proper implementations.
  1331.  
  1332.    bad_record_mac
  1333.        This alert is returned if a record is received with an incorrect
  1334.        MAC. This message is always fatal.
  1335.  
  1336. ]  decryption_failed
  1337. ]      A TLSCiphertext decrypted in an invalid way: either it wasn`t an
  1338. ]      even multiple of the block length or its padding values, when
  1339. ]      checked, weren`t correct. This message is always fatal.
  1340.  
  1341. ]  record_overflow
  1342. ]      A TLSCiphertext record was received which had a length more than
  1343. ]      2^14+2048 bytes, or a record decrypted to a TLSCompressed record
  1344.  
  1345. Dierks, T.                  Expires September, 1997            [Page 24]
  1346. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1347.  
  1348. ]      with more than 2^14+1024 bytes. This message is always fatal.
  1349.  
  1350.    decompression_failure
  1351.        The decompression function received improper input (e.g. data
  1352.        that would expand to excessive length). This message is always
  1353.        fatal.
  1354.  
  1355.    handshake_failure
  1356.        Reception of a handshake_failure alert message indicates that
  1357.        the sender was unable to negotiate an acceptable set of security
  1358.        parameters given the options available. This is a fatal error.
  1359.  
  1360.    bad_certificate
  1361.        A certificate was corrupt, contained signatures that did not
  1362.        verify correctly, etc.
  1363.  
  1364.    unsupported_certificate
  1365.        A certificate was of an unsupported type.
  1366.  
  1367.    certificate_revoked
  1368.        A certificate was revoked by its signer.
  1369.  
  1370.    certificate_expired
  1371.        A certificate has expired or is not currently valid.
  1372.  
  1373.    certificate_unknown
  1374.        Some other (unspecified) issue arose in processing the
  1375.        certificate, rendering it unacceptable.
  1376.  
  1377.    illegal_parameter
  1378.        A field in the handshake was out of range or inconsistent with
  1379.        other fields. This is always fatal.
  1380.  
  1381. ]  unknown_ca
  1382. ]      A valid certificate chain or partial chain was received, but the
  1383. ]      certificate was not accepted because the CA certificate could
  1384. ]      not be located or couldn`t be matched with a known, trusted CA.
  1385. ]      This message is always fatal.
  1386.  
  1387. ]  access_denied
  1388. ]      A valid certificate was received, but when access control was
  1389. ]      applied, the sender decided not to proceed with negotiation.
  1390. ]      This message is always fatal.
  1391.  
  1392. ]  decode_error
  1393. ]      A message could not be decoded because some field was out of the
  1394. ]      specified range or the length of the message was incorrect. This
  1395. ]      message is always fatal.
  1396.  
  1397. |  decrypt_error
  1398. |      A handshake cryptographic operation failed, including being
  1399. |      unable to correctly verify a signature, decrypt a key exchange,
  1400.  
  1401. Dierks, T.                  Expires September, 1997            [Page 25]
  1402. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1403.  
  1404. |      or validate a finished message.
  1405.  
  1406. ]  export_restriction
  1407. ]      A negotiation not in compliance with export restrictions was
  1408. ]      detected; for example, attempting to transfer a 1024 bit
  1409. ]      ephemeral RSA key for the RSA_EXPORT handshake method. This
  1410. ]      message is always fatal.
  1411.  
  1412. ]  protocol_version
  1413. ]      The protocol version the client has attempted to negotiate is
  1414. ]      recognized, but not supported. (For example, old protocol
  1415. ]      versions might be avoided for security reasons). This message is
  1416. ]      always fatal.
  1417.  
  1418. ]  insufficient_security
  1419. ]      Returned instead of handshake_failure when a negotiation has
  1420. ]      failed specifically because the server requires ciphers more
  1421. ]      secure than those supported by the client. This message is
  1422. ]      always fatal.
  1423.  
  1424. ]  internal_error
  1425. ]      An internal error unrelated to the peer or the correctness of
  1426. ]      the protocol makes it impossible to continue (such as a memory
  1427. ]      allocation failure). This message is always fatal.
  1428.  
  1429. ]  user_canceled
  1430. ]      This handshake is being canceled for some reason unrelated to a
  1431. ]      protocol failure. If the user cancels an operation after the
  1432. ]      handshake is complete, just closing the connection by sending a
  1433. ]      close_notify is more appropriate. This alert should be followed
  1434. ]      by a close_notify. This message is generally a warning.
  1435.  
  1436. ]  no_renegotiation
  1437. ]      Sent by the client in response to a hello request or by the
  1438. ]      server in response to a client hello after initial handshaking.
  1439. ]      Either of these would normally lead to renegotiation; when that
  1440. ]      is not appropriate, the recipient should respond with this
  1441. ]      alert; at that point, the original requester can decide whether
  1442. ]      to proceed with the connection. One case where this would be
  1443. ]      appropriate would be where a server has spawned a process to
  1444. ]      satisfy a request; the process might receive security parameters
  1445. ]      (key length, authentication, etc.) at startup and it might be
  1446. ]      difficult to communicate changes to these parameters after that
  1447. ]      point. This message is always a warning.
  1448.  
  1449.    For all errors where an alert level is not explicitly specified, the
  1450.    sending party may determine at its discretion whether this is a
  1451.    fatal error or not; if an alert with a level of warning is received,
  1452.    the receiving party may decide at its discretion whether to treat
  1453.    this as a fatal error or not. However, all messages which are
  1454.    transmitted with a level of fatal must be treated as fatal messages.
  1455.  
  1456.  
  1457. Dierks, T.                  Expires September, 1997            [Page 26]
  1458. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1459.  
  1460. 7.3. Handshake Protocol overview
  1461.  
  1462.    The cryptographic parameters of the session state are produced by
  1463.    the TLS Handshake Protocol, which operates on top of the TLS Record
  1464.    Layer. When a TLS client and server first start communicating, they
  1465.    agree on a protocol version, select cryptographic algorithms,
  1466.    optionally authenticate each other, and use public-key encryption
  1467.    techniques to generate shared secrets.
  1468.  
  1469. |  The TLS Handshake Protocol involves the following steps:
  1470.  
  1471.      - Exchange hello messages to agree on algorithms, exchange random
  1472.        values, and check for session resumption.
  1473.  
  1474.      - Exchange the necessary cryptographic parameters to allow the
  1475.        client and server to agree on a premaster secret.
  1476.  
  1477.      - Exchange certificates and cryptographic information to allow the
  1478.        client and server to authenticate themselves.
  1479.  
  1480.      - Generate a master secret from the premaster secret and exchanged
  1481.        random values.
  1482.  
  1483.      - Provide security parameters to the record layer.
  1484.  
  1485.      - Allow the client and server to verify that their peer has
  1486.        calculated the same security parameters and that the handshake
  1487.        occurred without tampering by an attacker.
  1488.  
  1489. ]  Note that higher layers should not be overly reliant on TLS always
  1490. ]  negotiating the strongest possible connection between two peers:
  1491. ]  there are a number of ways a man in the middle attacker can attempt
  1492. ]  to make two entities drop down to the least secure method they
  1493. ]  support. The protocol has been designed to minimize this risk, but
  1494. ]  there are still attacks available: for example, an attacker could
  1495. ]  block access to the port a secure service runs on, or attempt to get
  1496. ]  the peers to negotiate an unauthenticated connection. The
  1497. ]  fundamental rule is that higher levels must be cognizant of what
  1498. ]  their security requirements are and never transmit information over
  1499. ]  a channel less secure than what they require. The TLS protocol is
  1500. ]  secure, in that any cipher suite offers its promised level of
  1501. ]  security: if you negotiate 3DES with a 1024 bit RSA key exchange
  1502. ]  with a host whose certificate you have verified, you can expect to
  1503. ]  be that secure. However, you should never send data over a link
  1504. ]  encrypted with 40 bit security unless you feel that data is worth no
  1505. ]  more than the effort required to break that encryption.
  1506.  
  1507.    These goals are achieved by the handshake protocol, which can be
  1508.    summarized as follows: The client sends a client hello message to
  1509.    which the server must respond with a server hello message, or else a
  1510.    fatal error will occur and the connection will fail. The client
  1511.    hello and server hello are used to establish security enhancement
  1512.  
  1513. Dierks, T.                  Expires September, 1997            [Page 27]
  1514. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1515.  
  1516.    capabilities between client and server. The client hello and server
  1517.    hello establish the following attributes: Protocol Version, Session
  1518.    ID, Cipher Suite, and Compression Method. Additionally, two random
  1519.    values are generated and exchanged: ClientHello.random and
  1520.    ServerHello.random.
  1521.  
  1522.    The actual key exchange uses up to four messages: the server
  1523.    certificate, the server key exchange, the client certificate, and
  1524.    the client key exchange. New key exchange methods can be created by
  1525.    specifying a format for these messages and defining the use of the
  1526.    messages to allow the client and server to agree upon a shared
  1527.    secret. This secret should be quite long; currently defined key
  1528.    exchange methods exchange secrets which range from 48 to 128 bytes
  1529.    in length.
  1530.  
  1531.    Following the hello messages, the server will send its certificate,
  1532.    if it is to be authenticated. Additionally, a server key exchange
  1533.    message may be sent, if it is required (e.g. if their server has no
  1534.    certificate, or if its certificate is for signing only). If the
  1535.    server is authenticated, it may request a certificate from the
  1536.    client, if that is appropriate to the cipher suite selected. Now the
  1537.    server will send the server hello done message, indicating that the
  1538.    hello-message phase of the handshake is complete. The server will
  1539.    then wait for a client response. If the server has sent a
  1540. |  certificate request message, the client must send the certificate
  1541. |  message. The client key exchange message is now sent, and the
  1542.    content of that message will depend on the public key algorithm
  1543.    selected between the client hello and the server hello. If the
  1544.    client has sent a certificate with signing ability, a
  1545.    digitally-signed certificate verify message is sent to explicitly
  1546.    verify the certificate.
  1547.  
  1548.    At this point, a change cipher spec message is sent by the client,
  1549.    and the client copies the pending Cipher Spec into the current
  1550.    Cipher Spec. The client then immediately sends the finished message
  1551.    under the new algorithms, keys, and secrets. In response, the server
  1552.    will send its own change cipher spec message, transfer the pending
  1553.    to the current Cipher Spec, and send its finished message under the
  1554.    new Cipher Spec. At this point, the handshake is complete and the
  1555.    client and server may begin to exchange application layer data. (See
  1556.    flow chart below.)
  1557.  
  1558.       Client                                               Server
  1559.  
  1560.       ClientHello                  -------->
  1561.                                                       ServerHello
  1562.                                                      Certificate*
  1563.                                                ServerKeyExchange*
  1564.                                               CertificateRequest*
  1565.                                    <--------      ServerHelloDone
  1566.       Certificate*
  1567.       ClientKeyExchange
  1568.  
  1569. Dierks, T.                  Expires September, 1997            [Page 28]
  1570. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1571.  
  1572.       CertificateVerify*
  1573.       [ChangeCipherSpec]
  1574.       Finished                     -------->
  1575.                                                [ChangeCipherSpec]
  1576.                                    <--------             Finished
  1577.       Application Data             <------->     Application Data
  1578.  
  1579. |            Fig. 1 - Message flow for a full handshake
  1580.  
  1581.    * Indicates optional or situation-dependent messages that are not
  1582.    always sent.
  1583.  
  1584.  Note: To help avoid pipeline stalls, ChangeCipherSpec is an
  1585.        independent TLS Protocol content type, and is not actually a TLS
  1586.        handshake message.
  1587.  
  1588.    When the client and server decide to resume a previous session or
  1589.    duplicate an existing session (instead of negotiating new security
  1590.    parameters) the message flow is as follows:
  1591.  
  1592.    The client sends a ClientHello using the Session ID of the session
  1593.    to be resumed. The server then checks its session cache for a match.
  1594.    If a match is found, and the server is willing to re-establish the
  1595.    connection under the specified session state, it will send a
  1596.    ServerHello with the same Session ID value. At this point, both
  1597.    client and server must send change cipher spec messages and proceed
  1598.    directly to finished messages. Once the re-establishment is
  1599.    complete, the client and server may begin to exchange application
  1600.    layer data. (See flow chart below.) If a Session ID match is not
  1601.    found, the server generates a new session ID and the TLS client and
  1602.    server perform a full handshake.
  1603.  
  1604.       Client                                                Server
  1605.  
  1606.       ClientHello                   -------->
  1607.                                                        ServerHello
  1608.                                                 [ChangeCipherSpec]
  1609.                                     <--------             Finished
  1610.       [ChangeCipherSpec]
  1611.       Finished                      -------->
  1612.       Application Data              <------->     Application Data
  1613.  
  1614. |         Fig. 2 - Message flow for an abbreviated handshake
  1615.  
  1616.    The contents and significance of each message will be presented in
  1617.    detail in the following sections.
  1618.  
  1619. 7.4. Handshake protocol
  1620.  
  1621.    The TLS Handshake Protocol is one of the defined higher level
  1622.    clients of the TLS Record Protocol. This protocol is used to
  1623.    negotiate the secure attributes of a session. Handshake messages are
  1624.  
  1625. Dierks, T.                  Expires September, 1997            [Page 29]
  1626. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1627.  
  1628.    supplied to the TLS Record Layer, where they are encapsulated within
  1629.    one or more TLSPlaintext structures, which are processed and
  1630.    transmitted as specified by the current active session state.
  1631.  
  1632.        enum {
  1633.            hello_request(0), client_hello(1), server_hello(2),
  1634.            certificate(11), server_key_exchange (12),
  1635.            certificate_request(13), server_hello_done(14),
  1636.            certificate_verify(15), client_key_exchange(16),
  1637.            finished(20), (255)
  1638.        } HandshakeType;
  1639.  
  1640.        struct {
  1641.            HandshakeType msg_type;    /* handshake type */
  1642.            uint24 length;             /* bytes in message */
  1643.            select (HandshakeType) {
  1644.                case hello_request:       HelloRequest;
  1645.                case client_hello:        ClientHello;
  1646.                case server_hello:        ServerHello;
  1647.                case certificate:         Certificate;
  1648.                case server_key_exchange: ServerKeyExchange;
  1649.                case certificate_request: CertificateRequest;
  1650.                case server_hello_done:   ServerHelloDone;
  1651.                case certificate_verify:  CertificateVerify;
  1652.                case client_key_exchange: ClientKeyExchange;
  1653.                case finished:            Finished;
  1654.            } body;
  1655.        } Handshake;
  1656.  
  1657.    The handshake protocol messages are presented below in the order
  1658.    they must be sent; sending handshake messages in an unexpected order
  1659.    results in a fatal error. Unneeded handshake messages can be
  1660. |  omitted, however. Note one exception to the ordering: the
  1661. |  Certificate message is used twice in the handshake (from server to
  1662. |  client, then from client to server), but described only in its first
  1663. |  position. The one message which is not bound by these ordering rules
  1664. |  in the Hello Request message, which can be sent at any time, but
  1665. |  which should be ignored by the client if it arrives in the middle of
  1666. |  a handshake.
  1667.  
  1668. 7.4.1. Hello messages
  1669.  
  1670.    The hello phase messages are used to exchange security enhancement
  1671.    capabilities between the client and server. When a new session
  1672.    begins, the Record Layer's connection state encryption, hash, and
  1673.    compression algorithms are initialized to null. The current
  1674.    connection state is used for renegotiation messages.
  1675.  
  1676. 7.4.1.1. Hello request
  1677.  
  1678.    When this message will be sent:
  1679.        The hello request message may be sent by the server at any time.
  1680.  
  1681. Dierks, T.                  Expires September, 1997            [Page 30]
  1682. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1683.  
  1684.    Meaning of this message:
  1685.        Hello request is a simple notification that the client should
  1686.        begin the negotiation process anew by sending a client hello
  1687.        message when convenient. This message will be ignored by the
  1688.        client if the client is currently negotiating a session. This
  1689.        message may be ignored by the client if it does not wish to
  1690. |      renegotiate a session, or the client may, if it wishes, respond
  1691. |      with a no_renegotiation alert. Since handshake messages are
  1692.        intended to have transmission precedence over application data,
  1693.        it is expected that the negotiation will begin before no more
  1694.        than a few records are received from the client. If the server
  1695.        sends a hello request but does not receive a client hello in
  1696.        response, it may close the connection with a fatal alert.
  1697.  
  1698.    After sending a hello request, servers should not repeat the request
  1699.    until the subsequent handshake negotiation is complete.
  1700.  
  1701.    Structure of this message:
  1702.        struct { } HelloRequest;
  1703.  
  1704.  Note: This message should never be included in the message hashes
  1705.        which are maintained throughout the handshake and used in the
  1706.        finished messages and the certificate verify message.
  1707.  
  1708. 7.4.1.2. Client hello
  1709.  
  1710.    When this message will be sent:
  1711.        When a client first connects to a server it is required to send
  1712.        the client hello as its first message. The client can also send
  1713.        a client hello in response to a hello request or on its own
  1714.        initiative in order to renegotiate the security parameters in an
  1715.        existing connection.
  1716.  
  1717.    Structure of this message:
  1718.        The client hello message includes a random structure, which is
  1719.        used later in the protocol.
  1720.  
  1721.        struct {
  1722.           uint32 gmt_unix_time;
  1723.           opaque random_bytes[28];
  1724.        } Random;
  1725.  
  1726.    gmt_unix_time
  1727.        The current time and date in standard UNIX 32-bit format
  1728. |      (seconds since the midnight starting Jan 1, 1970, GMT) according
  1729.        to the sender's internal clock. Clocks are not required to be
  1730.        set correctly by the basic TLS Protocol; higher level or
  1731.        application protocols may define additional requirements.
  1732.  
  1733.    random_bytes
  1734.        28 bytes generated by a secure random number generator.
  1735.  
  1736.  
  1737. Dierks, T.                  Expires September, 1997            [Page 31]
  1738. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1739.  
  1740.    The client hello message includes a variable length session
  1741.    identifier. If not empty, the value identifies a session between the
  1742.    same client and server whose security parameters the client wishes
  1743.    to reuse. The session identifier may be from an earlier connection,
  1744.    this connection, or another currently active connection. The second
  1745.    option is useful if the client only wishes to update the random
  1746.    structures and derived values of a connection, while the third
  1747.    option makes it possible to establish several independent secure
  1748.    connections without repeating the full handshake protocol. These
  1749. ]  independent connections may occur sequentially or simultaneously; a
  1750. ]  SessionID becomes valid when the handshake negotiating it completes
  1751. ]  with the exchange of Finished messages and persists until removed
  1752. ]  due to aging or because a fatal error was encountered on a
  1753. ]  connection associated with the session. The actual contents of the
  1754.    SessionID are defined by the server.
  1755.  
  1756.        opaque SessionID<0..32>;
  1757.  
  1758.    Warning:
  1759. ]      Because the SessionID is transmitted without encryption or
  1760. ]      immediate MAC protection, servers must not place confidential
  1761. ]      information in session identifiers or let the contents of fake
  1762. ]      session identifiers cause any breach of security. (Note that the
  1763. ]      content of the handshake as a whole, including the SessionID, is
  1764. ]      protected by the Finished messages exchanged at the end of the
  1765. ]      handshake.)
  1766.  
  1767.    The CipherSuite list, passed from the client to the server in the
  1768.    client hello message, contains the combinations of cryptographic
  1769.    algorithms supported by the client in order of the client's
  1770.    preference (favorite choice first). Each CipherSuite defines a key
  1771.    exchange algorithm, a bulk encryption algorithm (including secret
  1772.    key length) and a MAC algorithm. The server will select a cipher
  1773.    suite or, if no acceptable choices are presented, return a handshake
  1774.    failure alert and close the connection.
  1775.  
  1776.        uint8 CipherSuite[2];    /* Cryptographic suite selector */
  1777.  
  1778.    The client hello includes a list of compression algorithms supported
  1779.    by the client, ordered according to the client's preference.
  1780.  
  1781.        enum { null(0), (255) } CompressionMethod;
  1782.  
  1783.        struct {
  1784.            ProtocolVersion client_version;
  1785.            Random random;
  1786.            SessionID session_id;
  1787.            CipherSuite cipher_suites<2..2^16-1>;
  1788.            CompressionMethod compression_methods<1..2^8-1>;
  1789.        } ClientHello;
  1790.  
  1791.  
  1792.  
  1793. Dierks, T.                  Expires September, 1997            [Page 32]
  1794. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1795.  
  1796.    client_version
  1797.        The version of the TLS protocol by which the client wishes to
  1798.        communicate during this session. This should be the latest
  1799.        (highest valued) version supported by the client. For this
  1800. ]      version of the specification, the version will be 3.1 (See
  1801.        Appendix E for details about backward compatibility).
  1802.  
  1803.    random
  1804.        A client-generated random structure.
  1805.  
  1806.    session_id
  1807.        The ID of a session the client wishes to use for this
  1808.        connection. This field should be empty if no session_id is
  1809.        available or the client wishes to generate new security
  1810.        parameters.
  1811.  
  1812.    cipher_suites
  1813.        This is a list of the cryptographic options supported by the
  1814.        client, with the client's first preference first. If the
  1815.        session_id field is not empty (implying a session resumption
  1816.        request) this vector must include at least the cipher_suite from
  1817.        that session. Values are defined in Appendix A.6.
  1818.  
  1819.    compression_methods
  1820.        This is a list of the compression methods supported by the
  1821.        client, sorted by client preference. If the session_id field is
  1822.        not empty (implying a session resumption request) it must
  1823.        include the compression_method from that session. This vector
  1824.        must contain, and all implementations must support,
  1825.        CompressionMethod.null. Thus, a client and server will always be
  1826.        able to agree on a compression method.
  1827.  
  1828.    After sending the client hello message, the client waits for a
  1829.    server hello message. Any other handshake message returned by the
  1830.    server except for a hello request is treated as a fatal error.
  1831.  
  1832.    Forward compatibility note:
  1833.        In the interests of forward compatibility, it is permitted for a
  1834.        client hello message to include extra data after the compression
  1835.        methods. This data must be included in the handshake hashes, but
  1836.        must otherwise be ignored. This is the only handshake message
  1837.        for which this is legal; for all other messages, the amount of
  1838.        data in the message must match the description of the message
  1839.        precisely.
  1840.  
  1841. 7.4.1.3. Server hello
  1842.  
  1843.    When this message will be sent:
  1844.        The server will send this message in response to a client hello
  1845.        message when it was able to find an acceptable set of
  1846.        algorithms. If it cannot find such a match, it will respond with
  1847.        a handshake failure alert.
  1848.  
  1849. Dierks, T.                  Expires September, 1997            [Page 33]
  1850. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1851.  
  1852.    Structure of this message:
  1853.        struct {
  1854.            ProtocolVersion server_version;
  1855.            Random random;
  1856.            SessionID session_id;
  1857.            CipherSuite cipher_suite;
  1858.            CompressionMethod compression_method;
  1859.        } ServerHello;
  1860.  
  1861.    server_version
  1862.        This field will contain the lower of that suggested by the
  1863.        client in the client hello and the highest supported by the
  1864. ]      server. For this version of the specification, the version is
  1865. ]      3.1 (See Appendix E for details about backward compatibility).
  1866.  
  1867.    random
  1868.        This structure is generated by the server and must be different
  1869.        from (and independent of) ClientHello.random.
  1870.  
  1871.    session_id
  1872.        This is the identity of the session corresponding to this
  1873.        connection. If the ClientHello.session_id was non-empty, the
  1874.        server will look in its session cache for a match. If a match is
  1875.        found and the server is willing to establish the new connection
  1876.        using the specified session state, the server will respond with
  1877.        the same value as was supplied by the client. This indicates a
  1878.        resumed session and dictates that the parties must proceed
  1879.        directly to the finished messages. Otherwise this field will
  1880.        contain a different value identifying the new session. The
  1881.        server may return an empty session_id to indicate that the
  1882. ]      session will not be cached and therefore cannot be resumed. If a
  1883. ]      session is resumed, it must be resumed using the same cipher
  1884. ]      suite it was originally negotiated with.
  1885.  
  1886.    cipher_suite
  1887.        The single cipher suite selected by the server from the list in
  1888.        ClientHello.cipher_suites. For resumed sessions this field is
  1889.        the value from the state of the session being resumed.
  1890.  
  1891.    compression_method
  1892.        The single compression algorithm selected by the server from the
  1893.        list in ClientHello.compression_methods. For resumed sessions
  1894.        this field is the value from the resumed session state.
  1895.  
  1896. 7.4.2. Server certificate
  1897.  
  1898.    When this message will be sent:
  1899.        The server must send a certificate whenever the agreed-upon key
  1900.        exchange method is not an anonymous one. This message will
  1901.        always immediately follow the server hello message.
  1902.  
  1903.  
  1904.  
  1905. Dierks, T.                  Expires September, 1997            [Page 34]
  1906. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1907.  
  1908.    Meaning of this message:
  1909.        The certificate type must be appropriate for the selected cipher
  1910.        suite's key exchange algorithm, and is generally an X.509v3
  1911.        certificate. It must contain a key which matches the key
  1912.        exchange method, as follows. Unless otherwise specified, the
  1913.        signing algorithm for the certificate must be the same as the
  1914.        algorithm for the certificate key. Unless otherwise specified,
  1915.        the public key may be of any length.
  1916.  
  1917.        Key Exchange Algorithm  Certificate Key Type
  1918.  
  1919.        RSA                     RSA public key; the certificate must
  1920.                                allow the key to be used for encryption.
  1921.  
  1922.        RSA_EXPORT              RSA public key of length greater than
  1923.                                512 bits which can be used for signing,
  1924.                                or a key of 512 bits or shorter which
  1925.                                can be used for either encryption or
  1926.                                signing.
  1927.  
  1928.        DHE_DSS                 DSS public key.
  1929.  
  1930.        DHE_DSS_EXPORT          DSS public key.
  1931.  
  1932.        DHE_RSA                 RSA public key which can be used for
  1933.                                signing.
  1934.  
  1935.        DHE_RSA_EXPORT          RSA public key which can be used for
  1936.                                signing.
  1937.  
  1938.        DH_DSS                  Diffie-Hellman key. The algorithm used
  1939.                                to sign the certificate should be DSS.
  1940.  
  1941.        DH_RSA                  Diffie-Hellman key. The algorithm used
  1942.                                to sign the certificate should be RSA.
  1943.  
  1944. ]  All certificate profiles, key and cryptographic formats are defined
  1945. |  by the IETF PKIX working group [PKIX]. When a key usage extension is
  1946. |  present, the digitalSignature bit must be set for the key to be
  1947. |  eligible for signing, as described above, and the keyEncipherment
  1948. |  bit must be present to allow encryption, as described above. The
  1949. |  keyAgreement bit must be set on Diffie-Hellman certificates.
  1950.  
  1951.    As CipherSuites which specify new key exchange methods are specified
  1952.    for the TLS Protocol, they will imply certificate format and the
  1953.    required encoded keying information.
  1954.  
  1955.    Structure of this message:
  1956.        opaque ASN.1Cert<1..2^24-1>;
  1957.  
  1958.  
  1959.  
  1960.  
  1961. Dierks, T.                  Expires September, 1997            [Page 35]
  1962. INTERNET-DRAFT                     TLS 1.0                    March 1997
  1963.  
  1964.        struct {
  1965.            ASN.1Cert certificate_list<0..2^24-1>;
  1966.        } Certificate;
  1967.  
  1968.    certificate_list
  1969. ]      This is a sequence (chain) of X.509v3 certificates. The sender's
  1970. ]      certificate must come first in the list. Each following
  1971. ]      certificate must directly certify the one preceding it. Because
  1972. ]      certificate validation requires that root keys be distributed
  1973. ]      independently, the self-signed certificate which specifies the
  1974. ]      root certificate authority may optionally be omitted from the
  1975. ]      chain, under the assumption that the remote end must already
  1976. ]      possess it in order to validate it in any case.
  1977.  
  1978.    The same message type and structure will be used for the client's
  1979. ]  response to a certificate request message. Note that a client may
  1980. ]  send no certificates if it does not have an appropriate certificate
  1981. ]  to send in response to the server's authentication request.
  1982.  
  1983.  Note: PKCS #7 [PKCS7] is not used as the format for the certificate
  1984.        vector because PKCS #6 [PKCS6] extended certificates are not
  1985.        used. Also PKCS #7 defines a SET rather than a SEQUENCE, making
  1986.        the task of parsing the list more difficult.
  1987.  
  1988. 7.4.3. Server key exchange message
  1989.  
  1990. ]  When this message will be sent:
  1991. ]      This message will be sent immediately after the server
  1992. ]      certificate message (or the server hello message, if this is an
  1993. ]      anonymous negotiation).
  1994.  
  1995.        The server key exchange message is sent by the server only when
  1996.        the server certificate message (if sent) does not contain enough
  1997.        data to allow the client to exchange a premaster secret. This is
  1998.        true for the following key exchange methods:
  1999.  
  2000.            RSA_EXPORT (if the public key in the server certificate is
  2001.            longer than 512 bits)
  2002.            DHE_DSS
  2003.            DHE_DSS_EXPORT
  2004.            DHE_RSA
  2005.            DHE_RSA_EXPORT
  2006.            DH_anon
  2007.  
  2008.        It is not legal to send the server key exchange message for the
  2009.        following key exchange methods:
  2010.  
  2011.            RSA
  2012.            RSA_EXPORT (when the public key in the server certificate is
  2013.            less than or equal to 512 bits in length)
  2014.            DH_DSS
  2015.            DH_RSA
  2016.  
  2017. Dierks, T.                  Expires September, 1997            [Page 36]
  2018. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2019.  
  2020.    Meaning of this message:
  2021.        This message conveys cryptographic information to allow the
  2022.        client to communicate the premaster secret: either an RSA public
  2023.        key to encrypt the premaster secret with, or a Diffie-Hellman
  2024.        public key with which the client can complete a key exchange
  2025.        (with the result being the premaster secret.)
  2026.  
  2027.    As additional CipherSuites are defined for TLS which include new key
  2028.    exchange algorithms, the server key exchange message will be sent if
  2029.    and only if the certificate type associated with the key exchange
  2030.    algorithm does not provide enough information for the client to
  2031.    exchange a premaster secret.
  2032.  
  2033.  Note: According to current US export law, RSA moduli larger than 512
  2034.        bits may not be used for key exchange in software exported from
  2035.        the US. With this message, the larger RSA keys encoded in
  2036.        certificates may be used to sign temporary shorter RSA keys for
  2037.        the RSA_EXPORT key exchange method.
  2038.  
  2039.    Structure of this message:
  2040.        enum { rsa, diffie_hellman } KeyExchangeAlgorithm;
  2041.  
  2042.        struct {
  2043.            opaque rsa_modulus<1..2^16-1>;
  2044.            opaque rsa_exponent<1..2^16-1>;
  2045.        } ServerRSAParams;
  2046.  
  2047.        rsa_modulus
  2048.            The modulus of the server's temporary RSA key.
  2049.  
  2050.        rsa_exponent
  2051.            The public exponent of the server's temporary RSA key.
  2052.  
  2053.        struct {
  2054.            opaque dh_p<1..2^16-1>;
  2055.            opaque dh_g<1..2^16-1>;
  2056.            opaque dh_Ys<1..2^16-1>;
  2057.        } ServerDHParams;     /* Ephemeral DH parameters */
  2058.  
  2059.        dh_p
  2060.            The prime modulus used for the Diffie-Hellman operation.
  2061.  
  2062.        dh_g
  2063.            The generator used for the Diffie-Hellman operation.
  2064.  
  2065.        dh_Ys
  2066.            The server's Diffie-Hellman public value (g^X mod p).
  2067.  
  2068.        struct {
  2069.            select (KeyExchangeAlgorithm) {
  2070.                case diffie_hellman:
  2071.                    ServerDHParams params;
  2072.  
  2073. Dierks, T.                  Expires September, 1997            [Page 37]
  2074. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2075.  
  2076.                    Signature signed_params;
  2077.                case rsa:
  2078.                    ServerRSAParams params;
  2079.                    Signature signed_params;
  2080.            };
  2081.        } ServerKeyExchange;
  2082.  
  2083.        params
  2084.            The server's key exchange parameters.
  2085.  
  2086.        signed_params
  2087.            For non-anonymous key exchanges, a hash of the corresponding
  2088.            params value, with the signature appropriate to that hash
  2089.            applied.
  2090.  
  2091.        md5_hash
  2092.            MD5(ClientHello.random + ServerHello.random + ServerParams);
  2093.  
  2094.        sha_hash
  2095.            SHA(ClientHello.random + ServerHello.random + ServerParams);
  2096.  
  2097.        enum { anonymous, rsa, dsa } SignatureAlgorithm;
  2098.  
  2099.        select (SignatureAlgorithm)
  2100.        {   case anonymous: struct { };
  2101.            case rsa:
  2102.                digitally-signed struct {
  2103.                    opaque md5_hash[16];
  2104.                    opaque sha_hash[20];
  2105.                };
  2106.            case dsa:
  2107.                digitally-signed struct {
  2108.                    opaque sha_hash[20];
  2109.                };
  2110.        } Signature;
  2111.  
  2112. 7.4.4. Certificate request
  2113.  
  2114.    When this message will be sent:
  2115.        A non-anonymous server can optionally request a certificate from
  2116. ]      the client, if appropriate for the selected cipher suite. This
  2117. ]      message, if sent, will immediately follow the Server Key
  2118. ]      Exchange message (if it is sent; otherwise, the Server
  2119. ]      Certificate message).
  2120.  
  2121.    Structure of this message:
  2122.        enum {
  2123.            rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4),
  2124.            (255)
  2125.        } ClientCertificateType;
  2126.  
  2127.  
  2128.  
  2129. Dierks, T.                  Expires September, 1997            [Page 38]
  2130. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2131.  
  2132.        opaque DistinguishedName<1..2^16-1>;
  2133.  
  2134.        struct {
  2135.            ClientCertificateType certificate_types<1..2^8-1>;
  2136.            DistinguishedName certificate_authorities<3..2^16-1>;
  2137.        } CertificateRequest;
  2138.  
  2139.        certificate_types
  2140.            This field is a list of the types of certificates requested,
  2141.            sorted in order of the server's preference.
  2142.  
  2143.        certificate_authorities
  2144.            A list of the distinguished names of acceptable certificate
  2145. ]          authorities. These distinguished names may specify a desired
  2146. ]          distinguished name for a root CA or for a subordinate CA;
  2147. ]          thus, this message can be used both to describe known roots
  2148. ]          and a desired authorization space.
  2149.  
  2150.  Note: DistinguishedName is derived from [X509].
  2151.  
  2152.  Note: It is a fatal handshake_failure alert for an anonymous server to
  2153.        request client identification.
  2154.  
  2155. 7.4.5. Server hello done
  2156.  
  2157.    When this message will be sent:
  2158.        The server hello done message is sent by the server to indicate
  2159.        the end of the server hello and associated messages. After
  2160.        sending this message the server will wait for a client response.
  2161.  
  2162.    Meaning of this message:
  2163.        This message means that the server is done sending messages to
  2164.        support the key exchange, and the client can proceed with its
  2165.        phase of the key exchange.
  2166.  
  2167.        Upon receipt of the server hello done message the client should
  2168.        verify that the server provided a valid certificate if required
  2169.        and check that the server hello parameters are acceptable.
  2170.  
  2171.    Structure of this message:
  2172.        struct { } ServerHelloDone;
  2173.  
  2174. 7.4.6. Client certificate
  2175.  
  2176.    When this message will be sent:
  2177.        This is the first message the client can send after receiving a
  2178.        server hello done message. This message is only sent if the
  2179.        server requests a certificate. If no suitable certificate is
  2180. ]      available, the client should send a certificate message
  2181. ]      containing no certificates. If client authentication is required
  2182. ]      by the server for the handshake to continue, it may respond with
  2183. ]      a fatal handshake failure alert. Client certificates are sent
  2184.  
  2185. Dierks, T.                  Expires September, 1997            [Page 39]
  2186. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2187.  
  2188. ]      using the Certificate structure defined in Section 7.4.2.
  2189.  
  2190.  Note: When using a static Diffie-Hellman based key exchange method
  2191.        (DH_DSS or DH_RSA), if client authentication is requested, the
  2192.        Diffie-Hellman group and generator encoded in the client's
  2193.        certificate must match the server specified Diffie-Hellman
  2194.        parameters if the client's parameters are to be used for the key
  2195.        exchange.
  2196.  
  2197. 7.4.7. Client key exchange message
  2198.  
  2199.    When this message will be sent:
  2200.        This message is always sent by the client. It will immediately
  2201. ]      follow the client certificate message, if it is sent. Otherwise
  2202. ]      it will be the first message sent by the client after it
  2203. ]      receives the server hello done message.
  2204.  
  2205.    Meaning of this message:
  2206.        With this message, the premaster secret is set, either though
  2207.        direct transmission of the RSA-encrypted secret, or by the
  2208.        transmission of Diffie-Hellman parameters which will allow each
  2209.        side to agree upon the same premaster secret. When the key
  2210.        exchange method is DH_RSA or DH_DSS, client certification has
  2211.        been requested, and the client was able to respond with a
  2212.        certificate which contained a Diffie-Hellman public key whose
  2213.        parameters (group and generator) matched those specified by the
  2214.        server in its certificate, this message will not contain any
  2215.        data.
  2216.  
  2217.    Structure of this message:
  2218.        The choice of messages depends on which key exchange method has
  2219.        been selected. See Section 7.4.3 for the KeyExchangeAlgorithm
  2220.        definition.
  2221.  
  2222.        struct {
  2223.            select (KeyExchangeAlgorithm) {
  2224.                case rsa: EncryptedPreMasterSecret;
  2225.                case diffie_hellman: ClientDiffieHellmanPublic;
  2226.            } exchange_keys;
  2227.        } ClientKeyExchange;
  2228.  
  2229. 7.4.7.1. RSA encrypted premaster secret message
  2230.  
  2231.    Meaning of this message:
  2232.        If RSA is being used for key agreement and authentication, the
  2233.        client generates a 48-byte premaster secret, encrypts it using
  2234.        the public key from the server's certificate or the temporary
  2235.        RSA key provided in a server key exchange message, and sends the
  2236.        result in an encrypted premaster secret message. This structure
  2237.        is a variant of the client key exchange message, not a message
  2238.        in itself.
  2239.  
  2240.  
  2241. Dierks, T.                  Expires September, 1997            [Page 40]
  2242. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2243.  
  2244.    Structure of this message:
  2245.        struct {
  2246.            ProtocolVersion client_version;
  2247.            opaque random[46];
  2248.        } PreMasterSecret;
  2249.  
  2250.        client_version
  2251.            The latest (newest) version supported by the client. This is
  2252. ]          used to detect version roll-back attacks. Upon receiving the
  2253. ]          premaster secret, the server should check that this value
  2254. ]          matches the value transmitted by the client in the client
  2255. ]          hello message.
  2256.  
  2257.        random
  2258.            46 securely-generated random bytes.
  2259.  
  2260.        struct {
  2261.            public-key-encrypted PreMasterSecret pre_master_secret;
  2262.        } EncryptedPreMasterSecret;
  2263.  
  2264.        pre_master_secret
  2265.            This random value is generated by the client and is used to
  2266.            generate the master secret, as specified in Section 8.1.
  2267.  
  2268. 7.4.7.2. Client Diffie-Hellman public value
  2269.  
  2270.    Meaning of this message:
  2271.        This structure conveys the client's Diffie-Hellman public value
  2272.        (Yc) if it was not already included in the client's certificate.
  2273.        The encoding used for Yc is determined by the enumerated
  2274.        PublicValueEncoding. This structure is a variant of the client
  2275.        key exchange message, not a message in itself.
  2276.  
  2277.    Structure of this message:
  2278.        enum { implicit, explicit } PublicValueEncoding;
  2279.  
  2280.        implicit
  2281.            If the client certificate already contains a suitable
  2282.            Diffie-Hellman key, then Yc is implicit and does not need to
  2283. ]          be sent again. In this case, the Client Key Exchange message
  2284. ]          will be sent, but will be empty.
  2285.  
  2286.        explicit
  2287.            Yc needs to be sent.
  2288.  
  2289.        struct {
  2290.            select (PublicValueEncoding) {
  2291.                case implicit: struct { };
  2292.                case explicit: opaque dh_Yc<1..2^16-1>;
  2293.            } dh_public;
  2294.        } ClientDiffieHellmanPublic;
  2295.  
  2296.  
  2297. Dierks, T.                  Expires September, 1997            [Page 41]
  2298. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2299.  
  2300.        dh_Yc
  2301.            The client's Diffie-Hellman public value (Yc).
  2302.  
  2303. 7.4.8. Certificate verify
  2304.  
  2305.    When this message will be sent:
  2306.        This message is used to provide explicit verification of a
  2307.        client certificate. This message is only sent following a client
  2308.        certificate that has signing capability (i.e. all certificates
  2309.        except those containing fixed Diffie-Hellman parameters). When
  2310.        sent, it will immediately follow the client key exchange
  2311.        message.
  2312.  
  2313.    Structure of this message:
  2314.        struct {
  2315.             Signature signature;
  2316.        } CertificateVerify;
  2317.  
  2318.        The Signature type is defined in 6.4.3.
  2319.  
  2320.        CertificateVerify.signature.md5_hash
  2321. |          MD5(handshake_messages);
  2322.  
  2323.        Certificate.signature.sha_hash
  2324. |          SHA(handshake_messages);
  2325.  
  2326.    Here handshake_messages refers to all handshake messages sent or
  2327.    received starting at client hello up to but not including this
  2328.    message, including the type and length fields of the handshake
  2329.    messages. This is the concatenation of all the Handshake structures
  2330.    as defined in 7.4 exchanged thus far.
  2331.  
  2332. 7.4.9. Finished
  2333.  
  2334.    When this message will be sent:
  2335.        A finished message is always sent immediately after a change
  2336.        cipher spec message to verify that the key exchange and
  2337.        authentication processes were successful. It is essential that a
  2338.        change cipher spec message be received between the other
  2339.        handshake messages and the Finished message.
  2340.  
  2341.    Meaning of this message:
  2342.        The finished message is the first protected with the
  2343. ]      just-negotiated algorithms, keys, and secrets. Recipients of
  2344. ]      finished messages must verify that the contents are correct.
  2345. ]      Once a side has sent its Finished message and received and
  2346. ]      validated the Finished message from its peer, it may begin to
  2347. ]      send and receive application data over the connection.
  2348.  
  2349. |      struct {
  2350. |          opaque verify_data[12];
  2351. |      } Finished;
  2352.  
  2353. Dierks, T.                  Expires September, 1997            [Page 42]
  2354. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2355.  
  2356. |      verify_data
  2357. |          PRF(master_secret, finished_label, MD5(handshake_messages) +
  2358. |          SHA-1(handshake_messages)) [0..11];
  2359.  
  2360. |      finished_label
  2361. |          For Finished messages sent by the client, the string "client
  2362. |          finished". For Finished messages sent by the server, the
  2363. |          string "server finished".
  2364.  
  2365.        handshake_messages
  2366.            All of the data from all handshake messages up to but not
  2367.            including this message. This is only data visible at the
  2368.            handshake layer and does not include record layer headers.
  2369.            This is the concatenation of all the Handshake structures as
  2370.            defined in 7.4 exchanged thus far.
  2371.  
  2372.    It is a fatal error if a finished message is not preceded by a
  2373.    change cipher spec message at the appropriate point in the
  2374.    handshake.
  2375.  
  2376.    The hash contained in finished messages sent by the server
  2377.    incorporate Sender.server; those sent by the client incorporate
  2378.    Sender.client. The value handshake_messages includes all handshake
  2379.    messages starting at client hello up to, but not including, this
  2380.    finished message. This may be different from handshake_messages in
  2381.    Section 7.4.8 because it would include the certificate verify
  2382.    message (if sent). Also, the handshake_messages for the finished
  2383.    message sent by the client will be different from that for the
  2384.    finished message sent by the server, because the one which is sent
  2385.    second will include the prior one.
  2386.  
  2387. |Note: Change cipher spec messages, alerts and any other record types
  2388.        are not handshake messages and are not included in the hash
  2389. ]      computations. Also, Hello Request messages are omitted from
  2390. ]      handshake hashes.
  2391.  
  2392. 8. Cryptographic computations
  2393.  
  2394.    In order to begin connection protection, the TLS Record Protocol
  2395.    requires specification of a suite of algorithms, a master secret,
  2396.    and the client and server random values. The authentication,
  2397.    encryption, and MAC algorithms are determined by the cipher_suite
  2398.    selected by the server and revealed in the server hello message. The
  2399.    compression algorithm is negotiated in the hello messages, and the
  2400.    random values are exchanged in the hello messages. All that remains
  2401.    is to calculate the master secret.
  2402.  
  2403. 8.1. Computing the master secret
  2404.  
  2405.    For all key exchange methods, the same algorithm is used to convert
  2406.    the pre_master_secret into the master_secret. The pre_master_secret
  2407.    should be deleted from memory once the master_secret has been
  2408.  
  2409. Dierks, T.                  Expires September, 1997            [Page 43]
  2410. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2411.  
  2412.    computed.
  2413.  
  2414. |      master_secret = PRF(pre_master_secret, "master secret",
  2415. |                    ClientHello.random + ServerHello.random) [0..47];
  2416.  
  2417.    The master secret is always exactly 48 bytes in length. The length
  2418.    of the premaster secret will vary depending on key exchange method.
  2419.  
  2420. 8.1.1. RSA
  2421.  
  2422.    When RSA is used for server authentication and key exchange, a
  2423.    48-byte pre_master_secret is generated by the client, encrypted
  2424.    under the server's public key, and sent to the server. The server
  2425.    uses its private key to decrypt the pre_master_secret. Both parties
  2426.    then convert the pre_master_secret into the master_secret, as
  2427.    specified above.
  2428.  
  2429.    RSA digital signatures are performed using PKCS #1 [PKCS1] block
  2430.    type 1. RSA public key encryption is performed using PKCS #1 block
  2431.    type 2.
  2432.  
  2433. 8.1.2. Diffie-Hellman
  2434.  
  2435.    A conventional Diffie-Hellman computation is performed. The
  2436.    negotiated key (Z) is used as the pre_master_secret, and is
  2437.    converted into the master_secret, as specified above.
  2438.  
  2439.  Note: Diffie-Hellman parameters are specified by the server, and may
  2440.        be either ephemeral or contained within the server's
  2441.        certificate.
  2442.  
  2443. 9. Application data protocol
  2444.  
  2445.    Application data messages are carried by the Record Layer and are
  2446.    fragmented, compressed and encrypted based on the current connection
  2447.    state. The messages are treated as transparent data to the record
  2448.    layer.
  2449.  
  2450. A. Protocol constant values
  2451.  
  2452.    This section describes protocol types and constants.
  2453.  
  2454. A.1. Reserved port assignments
  2455.  
  2456.    At the present time TLS is implemented using TCP/IP as the base
  2457. ]  networking technology, although the protocol should be useful over
  2458. ]  any transport which can provide a reliable stream connection. The
  2459.    IANA reserved the following Internet Protocol [IP] port numbers for
  2460.    use in conjunction with the SSL 3.0 Protocol, which we presume will
  2461.    be used by TLS as well.
  2462.  
  2463.  
  2464.  
  2465. Dierks, T.                  Expires September, 1997            [Page 44]
  2466. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2467.  
  2468. |  While we describe these existing port assignments for completeness,
  2469. |  in general, protocol designers and implementors should be the ones
  2470. |  to decide on how security can be incorporated into their protocol
  2471. |  using TLS, including the mechanisms for negotiating to start TLS and
  2472. |  the requirements and meaning of that connection (such as
  2473. |  interpretation of exchanged certificates).
  2474.  
  2475.    443 Reserved for use by Hypertext Transfer Protocol with SSL (https)
  2476.  
  2477.    465 Reserved for use by Simple Mail Transfer Protocol with SSL
  2478.        (ssmtp).
  2479.  
  2480.    563 Reserved for use by Network News Transfer Protocol with SSL
  2481.        (snntp).
  2482.  
  2483.    636 Reserved for Light Directory Access Protocol with SSL (ssl-ldap)
  2484.  
  2485.    990 Reserved (pending) for File Transfer Protocol with SSL (ftps)
  2486.  
  2487.    995 Reserved for Post Office Protocol with SSL (spop3)
  2488.  
  2489. A.2. Record layer
  2490.  
  2491.     struct {
  2492.         uint8 major, minor;
  2493.     } ProtocolVersion;
  2494.  
  2495.     ProtocolVersion version = { 3, 1 };     /* TLS v1.0 */
  2496.  
  2497.     enum {
  2498.         change_cipher_spec(20), alert(21), handshake(22),
  2499.         application_data(23), (255)
  2500.     } ContentType;
  2501.  
  2502.     struct {
  2503.         ContentType type;
  2504.         ProtocolVersion version;
  2505.         uint16 length;
  2506.         opaque fragment[TLSPlaintext.length];
  2507.     } TLSPlaintext;
  2508.  
  2509.     struct {
  2510.         ContentType type;
  2511.         ProtocolVersion version;
  2512.         uint16 length;
  2513.         opaque fragment[TLSCompressed.length];
  2514.     } TLSCompressed;
  2515.  
  2516.     struct {
  2517.         ContentType type;
  2518.         ProtocolVersion version;
  2519.         uint16 length;
  2520.  
  2521. Dierks, T.                  Expires September, 1997            [Page 45]
  2522. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2523.  
  2524.         select (CipherSpec.cipher_type) {
  2525.             case stream: GenericStreamCipher;
  2526.             case block:  GenericBlockCipher;
  2527.         } fragment;
  2528.     } TLSCiphertext;
  2529.  
  2530.     stream-ciphered struct {
  2531.         opaque content[TLSCompressed.length];
  2532.         opaque MAC[CipherSpec.hash_size];
  2533.     } GenericStreamCipher;
  2534.  
  2535.     block-ciphered struct {
  2536.         opaque content[TLSCompressed.length];
  2537.         opaque MAC[CipherSpec.hash_size];
  2538.         uint8 padding[GenericBlockCipher.padding_length];
  2539.         uint8 padding_length;
  2540.     } GenericBlockCipher;
  2541.  
  2542. A.3. Change cipher specs message
  2543.  
  2544.     struct {
  2545.         enum { change_cipher_spec(1), (255) } type;
  2546.     } ChangeCipherSpec;
  2547.  
  2548. A.4. Alert messages
  2549.  
  2550.     enum { warning(1), fatal(2), (255) } AlertLevel;
  2551.  
  2552.         enum {
  2553.             close_notify(0),
  2554.             unexpected_message(10),
  2555.             bad_record_mac(20),
  2556. ]           decryption_failed(21),
  2557. ]           record_overflow(22),
  2558.             decompression_failure(30),
  2559.             handshake_failure(40),
  2560.             bad_certificate(42),
  2561.             unsupported_certificate(43),
  2562.             certificate_revoked(44),
  2563.             certificate_expired(45),
  2564.             certificate_unknown(46),
  2565.             illegal_parameter(47),
  2566. ]           unknown_ca(48),
  2567. ]           access_denied(49),
  2568. ]           decode_error(50),
  2569. ]           decrypt_error(51),
  2570. ]           export_restriction(60),
  2571. ]           protocol_version(70),
  2572. ]           insufficient_security(71),
  2573. ]           internal_error(80),
  2574. ]           user_canceled(90),
  2575. ]           no_renegotiation(100),
  2576.  
  2577. Dierks, T.                  Expires September, 1997            [Page 46]
  2578. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2579.  
  2580.             (255)
  2581.         } AlertDescription;
  2582.  
  2583.     struct {
  2584.         AlertLevel level;
  2585.         AlertDescription description;
  2586.     } Alert;
  2587.  
  2588. A.5. Handshake protocol
  2589.  
  2590.     enum {
  2591.         hello_request(0), client_hello(1), server_hello(2),
  2592.         certificate(11), server_key_exchange (12),
  2593.         certificate_request(13), server_hello_done(14),
  2594.         certificate_verify(15), client_key_exchange(16),
  2595.         finished(20), (255)
  2596.     } HandshakeType;
  2597.  
  2598.     struct {
  2599.         HandshakeType msg_type;
  2600.         uint24 length;
  2601.         select (HandshakeType) {
  2602.             case hello_request:       HelloRequest;
  2603.             case client_hello:        ClientHello;
  2604.             case server_hello:        ServerHello;
  2605.             case certificate:         Certificate;
  2606.             case server_key_exchange: ServerKeyExchange;
  2607.             case certificate_request: CertificateRequest;
  2608.             case server_hello_done:   ServerHelloDone;
  2609.             case certificate_verify:  CertificateVerify;
  2610.             case client_key_exchange: ClientKeyExchange;
  2611.             case finished:            Finished;
  2612.         } body;
  2613.     } Handshake;
  2614.  
  2615. A.5.1. Hello messages
  2616.  
  2617.     struct { } HelloRequest;
  2618.  
  2619.     struct {
  2620.         uint32 gmt_unix_time;
  2621.         opaque random_bytes[28];
  2622.     } Random;
  2623.  
  2624.     opaque SessionID<0..32>;
  2625.  
  2626.     uint8 CipherSuite[2];
  2627.  
  2628.     enum { null(0), (255) } CompressionMethod;
  2629.  
  2630.     struct {
  2631.         ProtocolVersion client_version;
  2632.  
  2633. Dierks, T.                  Expires September, 1997            [Page 47]
  2634. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2635.  
  2636.         Random random;
  2637.         SessionID session_id;
  2638.         CipherSuite cipher_suites<2..2^16-1>;
  2639.         CompressionMethod compression_methods<0..2^8-1>;
  2640.     } ClientHello;
  2641.  
  2642.     struct {
  2643.         ProtocolVersion server_version;
  2644.         Random random;
  2645.         SessionID session_id;
  2646.         CipherSuite cipher_suite;
  2647.         CompressionMethod compression_method;
  2648.     } ServerHello;
  2649.  
  2650. A.5.2. Server authentication and key exchange messages
  2651.  
  2652.     opaque ASN.1Cert<2^24-1>;
  2653.  
  2654.     struct {
  2655.         ASN.1Cert certificate_list<1..2^24-1>;
  2656.     } Certificate;
  2657.  
  2658.     enum { rsa, diffie_hellman } KeyExchangeAlgorithm;
  2659.  
  2660.     struct {
  2661.         opaque RSA_modulus<1..2^16-1>;
  2662.         opaque RSA_exponent<1..2^16-1>;
  2663.     } ServerRSAParams;
  2664.  
  2665.     struct {
  2666.         opaque DH_p<1..2^16-1>;
  2667.         opaque DH_g<1..2^16-1>;
  2668.         opaque DH_Ys<1..2^16-1>;
  2669.     } ServerDHParams;
  2670.  
  2671.     struct {
  2672.         select (KeyExchangeAlgorithm) {
  2673.             case diffie_hellman:
  2674.                 ServerDHParams params;
  2675.                 Signature signed_params;
  2676.             case rsa:
  2677.                 ServerRSAParams params;
  2678.                 Signature signed_params;
  2679.         };
  2680.     } ServerKeyExchange;
  2681.  
  2682.     enum { anonymous, rsa, dsa } SignatureAlgorithm;
  2683.  
  2684.     select (SignatureAlgorithm)
  2685.     {   case anonymous: struct { };
  2686.         case rsa:
  2687.             digitally-signed struct {
  2688.  
  2689. Dierks, T.                  Expires September, 1997            [Page 48]
  2690. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2691.  
  2692.                 opaque md5_hash[16];
  2693.                 opaque sha_hash[20];
  2694.             };
  2695.         case dsa:
  2696.             digitally-signed struct {
  2697.                 opaque sha_hash[20];
  2698.             };
  2699.     } Signature;
  2700.  
  2701.     enum {
  2702.         rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4),
  2703.         (255)
  2704.     } ClientCertificateType;
  2705.  
  2706.     opaque DistinguishedName<1..2^16-1>;
  2707.  
  2708.     struct {
  2709.         ClientCertificateType certificate_types<1..2^8-1>;
  2710.         DistinguishedName certificate_authorities<3..2^16-1>;
  2711.     } CertificateRequest;
  2712.  
  2713.     struct { } ServerHelloDone;
  2714.  
  2715. A.5.3. Client authentication and key exchange messages
  2716.  
  2717.     struct {
  2718.         select (KeyExchangeAlgorithm) {
  2719.             case rsa: EncryptedPreMasterSecret;
  2720.             case diffie_hellman: DiffieHellmanClientPublicValue;
  2721.         } exchange_keys;
  2722.     } ClientKeyExchange;
  2723.  
  2724.     struct {
  2725.         ProtocolVersion client_version;
  2726.         opaque random[46];
  2727.     } PreMasterSecret;
  2728.  
  2729.     struct {
  2730.         public-key-encrypted PreMasterSecret pre_master_secret;
  2731.     } EncryptedPreMasterSecret;
  2732.  
  2733.     enum { implicit, explicit } PublicValueEncoding;
  2734.  
  2735.     struct {
  2736.         select (PublicValueEncoding) {
  2737.             case implicit: struct {};
  2738.             case explicit: opaque DH_Yc<1..2^16-1>;
  2739.         } dh_public;
  2740.     } ClientDiffieHellmanPublic;
  2741.  
  2742.     struct {
  2743.         Signature signature;
  2744.  
  2745. Dierks, T.                  Expires September, 1997            [Page 49]
  2746. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2747.  
  2748.     } CertificateVerify;
  2749.  
  2750. A.5.4. Handshake finalization message
  2751.  
  2752.     struct {
  2753. |       opaque verify_data[12];
  2754.     } Finished;
  2755.  
  2756. A.6. The CipherSuite
  2757.  
  2758.    The following values define the CipherSuite codes used in the client
  2759.    hello and server hello messages.
  2760.  
  2761.    A CipherSuite defines a cipher specification supported in TLS
  2762.    Version 1.0.
  2763.  
  2764. |  TLS_NULL_WITH_NULL_NULL is specified and is the initial state of a
  2765. |  TLS connection during the first handshake on that channel, but
  2766. |  should not be negotiated, as it provides no more protection than an
  2767. |  unsecured connection.
  2768.  
  2769.     CipherSuite TLS_NULL_WITH_NULL_NULL                = { 0x00,0x00 };
  2770.  
  2771.    The following CipherSuite definitions require that the server
  2772.    provide an RSA certificate that can be used for key exchange. The
  2773.    server may request either an RSA or a DSS signature-capable
  2774.    certificate in the certificate request message.
  2775.  
  2776.     CipherSuite TLS_RSA_WITH_NULL_MD5                  = { 0x00,0x01 };
  2777.     CipherSuite TLS_RSA_WITH_NULL_SHA                  = { 0x00,0x02 };
  2778.     CipherSuite TLS_RSA_EXPORT_WITH_RC4_40_MD5         = { 0x00,0x03 };
  2779.     CipherSuite TLS_RSA_WITH_RC4_128_MD5               = { 0x00,0x04 };
  2780.     CipherSuite TLS_RSA_WITH_RC4_128_SHA               = { 0x00,0x05 };
  2781.     CipherSuite TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5     = { 0x00,0x06 };
  2782.     CipherSuite TLS_RSA_WITH_IDEA_CBC_SHA              = { 0x00,0x07 };
  2783.     CipherSuite TLS_RSA_EXPORT_WITH_DES40_CBC_SHA      = { 0x00,0x08 };
  2784.     CipherSuite TLS_RSA_WITH_DES_CBC_SHA               = { 0x00,0x09 };
  2785.     CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA          = { 0x00,0x0A };
  2786.  
  2787.    The following CipherSuite definitions are used for
  2788.    server-authenticated (and optionally client-authenticated)
  2789.    Diffie-Hellman. DH denotes cipher suites in which the server's
  2790.    certificate contains the Diffie-Hellman parameters signed by the
  2791.    certificate authority (CA). DHE denotes ephemeral Diffie-Hellman,
  2792.    where the Diffie-Hellman parameters are signed by a DSS or RSA
  2793.    certificate, which has been signed by the CA. The signing algorithm
  2794. ]  used is specified after the DH or DHE parameter. The server can
  2795. ]  request an RSA or DSS signature-capable certificate from the client
  2796. ]  for client authentication or it may request a Diffie-Hellman
  2797. ]  certificate. Any Diffie-Hellman certificate provided by the client
  2798. ]  must use the parameters (group and generator) described by the
  2799. ]  server.
  2800.  
  2801. Dierks, T.                  Expires September, 1997            [Page 50]
  2802. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2803.  
  2804.     CipherSuite TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA   = { 0x00,0x0B };
  2805.     CipherSuite TLS_DH_DSS_WITH_DES_CBC_SHA            = { 0x00,0x0C };
  2806.     CipherSuite TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA       = { 0x00,0x0D };
  2807.     CipherSuite TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA   = { 0x00,0x0E };
  2808.     CipherSuite TLS_DH_RSA_WITH_DES_CBC_SHA            = { 0x00,0x0F };
  2809.     CipherSuite TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA       = { 0x00,0x10 };
  2810.     CipherSuite TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA  = { 0x00,0x11 };
  2811.     CipherSuite TLS_DHE_DSS_WITH_DES_CBC_SHA           = { 0x00,0x12 };
  2812.     CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA      = { 0x00,0x13 };
  2813.     CipherSuite TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA  = { 0x00,0x14 };
  2814.     CipherSuite TLS_DHE_RSA_WITH_DES_CBC_SHA           = { 0x00,0x15 };
  2815.     CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA      = { 0x00,0x16 };
  2816.  
  2817.    The following cipher suites are used for completely anonymous
  2818.    Diffie-Hellman communications in which neither party is
  2819.    authenticated. Note that this mode is vulnerable to
  2820.    man-in-the-middle attacks and is therefore deprecated.
  2821.  
  2822.     CipherSuite TLS_DH_anon_EXPORT_WITH_RC4_40_MD5     = { 0x00,0x17 };
  2823.     CipherSuite TLS_DH_anon_WITH_RC4_128_MD5           = { 0x00,0x18 };
  2824.     CipherSuite TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA  = { 0x00,0x19 };
  2825.     CipherSuite TLS_DH_anon_WITH_DES_CBC_SHA           = { 0x00,0x1A };
  2826.     CipherSuite TLS_DH_anon_WITH_3DES_EDE_CBC_SHA      = { 0x00,0x1B };
  2827.  
  2828.  Note: All cipher suites whose first byte is 0xFF are considered
  2829.        private and can be used for defining local/experimental
  2830.        algorithms. Interoperability of such types is a local matter.
  2831.  
  2832.  Note: Additional cipher suites will be considered for implementation
  2833.        only with submission of notarized letters from two independent
  2834. ]      entities. Consensus Development Corp. will act as an interim
  2835.        registration office, until a public standards body assumes
  2836.        control of TLS cipher suites.
  2837.  
  2838. A.7. The Security Parameters
  2839.  
  2840.    These security parameters are determined by the TLS Handshake
  2841.    Protocol and provided as parameters to the TLS Record Layer in order
  2842.    to initialize a connection state. SecurityParameters includes:
  2843.  
  2844.        enum { null(0), (255) } CompressionMethod;
  2845.  
  2846.        enum { server, client } ConnectionEnd;
  2847.  
  2848.        enum { null, rc4, rc2, des, 3des, des40, idea }
  2849.        BulkCipherAlgorithm;
  2850.  
  2851.        enum { stream, block } CipherType;
  2852.  
  2853.        enum { true, false } IsExportable;
  2854.  
  2855.  
  2856.  
  2857. Dierks, T.                  Expires September, 1997            [Page 51]
  2858. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2859.  
  2860.        enum { null, md5, sha } MACAlgorithm;
  2861.  
  2862.    /* The algorithms specified in CompressionMethod,
  2863.    BulkCipherAlgorithm, and MACAlgorithm may be added to. */
  2864.  
  2865.        struct {
  2866.            ConnectionEnd entity;
  2867.            BulkCipherAlgorithm bulk_cipher_algorithm;
  2868.            CipherType cipher_type;
  2869.            uint8 key_size;
  2870.            uint8 key_material_length;
  2871.            IsExportable is_exportable;
  2872.            MACAlgorithm mac_algorithm;
  2873.            uint8 hash_size;
  2874.            CompressionMethod compression_algorithm;
  2875.            opaque master_secret[48];
  2876.            opaque client_random[32];
  2877.            opaque server_random[32];
  2878.        } SecurityParameters;
  2879.  
  2880. B. Glossary
  2881.  
  2882.    application protocol
  2883.        An application protocol is a protocol that normally layers
  2884.        directly on top of the transport layer (e.g., TCP/IP). Examples
  2885.        include HTTP, TELNET, FTP, and SMTP.
  2886.  
  2887.    asymmetric cipher
  2888.        See public key cryptography.
  2889.  
  2890.    authentication
  2891.        Authentication is the ability of one entity to determine the
  2892.        identity of another entity.
  2893.  
  2894.    block cipher
  2895.        A block cipher is an algorithm that operates on plaintext in
  2896.        groups of bits, called blocks. 64 bits is a common block size.
  2897.  
  2898.    bulk cipher
  2899.        A symmetric encryption algorithm used to encrypt large
  2900.        quantities of data.
  2901.  
  2902.    cipher block chaining (CBC)
  2903.        CBC is a mode in which every plaintext block encrypted with a
  2904.        block cipher is first exclusive-ORed with the previous
  2905.        ciphertext block (or, in the case of the first block, with the
  2906. ]      initialization vector). For decryption, every block is first
  2907. ]      decrypted, then exclusive-ORed with the previous ciphertext
  2908. ]      block (or IV).
  2909.  
  2910.  
  2911.  
  2912.  
  2913. Dierks, T.                  Expires September, 1997            [Page 52]
  2914. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2915.  
  2916.    certificate
  2917.        As part of the X.509 protocol (a.k.a. ISO Authentication
  2918.        framework), certificates are assigned by a trusted Certificate
  2919. |      Authority and provide a strong binding between a party's
  2920. |      identity or some other attributes and its public key.
  2921.  
  2922.    client
  2923. |      The application entity that initiates a TLS connection to a
  2924. |      server. This may or may not imply that the client initiated the
  2925. |      underlying transport connection. The primary operational
  2926. |      difference between the server and client is that the server is
  2927. |      generally authenticated, while the client is only optionally
  2928. |      authenticated.
  2929.  
  2930.    client write key
  2931.        The key used to encrypt data written by the client.
  2932.  
  2933.    client write MAC secret
  2934.        The secret data used to authenticate data written by the client.
  2935.  
  2936.    connection
  2937.        A connection is a transport (in the OSI layering model
  2938.        definition) that provides a suitable type of service. For TLS,
  2939.        such connections are peer to peer relationships. The connections
  2940.        are transient. Every connection is associated with one session.
  2941.  
  2942.    Data Encryption Standard
  2943.        DES is a very widely used symmetric encryption algorithm. DES is
  2944. ]      a block cipher with a 56 bit key and an 8 byte block size. Note
  2945. ]      that in TLS, for key generation purposes, DES is treated as
  2946. ]      having an 8 byte key length (64 bits), but it still only
  2947. ]      provides 56 bits of protection. DES can also be operated in a
  2948. ]      mode where three independent keys and three encryptions are used
  2949. ]      for each block of data; this uses 168 bits of key (24 bytes in
  2950. ]      the TLS key generation method) and provides the equivalent of
  2951. ]      112 bits of security. [DES], [3DES]
  2952.  
  2953.    Digital Signature Standard (DSS)
  2954.        A standard for digital signing, including the Digital Signing
  2955.        Algorithm, approved by the National Institute of Standards and
  2956.        Technology, defined in NIST FIPS PUB 186, "Digital Signature
  2957.        Standard," published May, 1994 by the U.S. Dept. of Commerce.
  2958.        [DSS]
  2959.  
  2960.    digital signatures
  2961.        Digital signatures utilize public key cryptography and one-way
  2962.        hash functions to produce a signature of the data that can be
  2963.        authenticated, and is difficult to forge or repudiate.
  2964.  
  2965.    handshake
  2966.        An initial negotiation between client and server that
  2967.        establishes the parameters of their transactions.
  2968.  
  2969. Dierks, T.                  Expires September, 1997            [Page 53]
  2970. INTERNET-DRAFT                     TLS 1.0                    March 1997
  2971.  
  2972.    Initialization Vector (IV)
  2973.        When a block cipher is used in CBC mode, the initialization
  2974.        vector is exclusive-ORed with the first plaintext block prior to
  2975.        encryption.
  2976.  
  2977.    IDEA
  2978.        A 64-bit block cipher designed by Xuejia Lai and James Massey.
  2979.        [IDEA]
  2980.  
  2981.    Message Authentication Code (MAC)
  2982.        A Message Authentication Code is a one-way hash computed from a
  2983. ]      message and some secret data. It is difficult to forge without
  2984. ]      knowing the secret data and it is difficult to find messages
  2985. ]      which hash to the same MAC. Its purpose is to detect if the
  2986.        message has been altered.
  2987.  
  2988.    master secret
  2989.        Secure secret data used for generating encryption keys, MAC
  2990.        secrets, and IVs.
  2991.  
  2992.    MD5
  2993.        MD5 is a secure hashing function that converts an arbitrarily
  2994.        long data stream into a digest of fixed size (16 bytes). [MD5]
  2995.  
  2996.    public key cryptography
  2997.        A class of cryptographic techniques employing two-key ciphers.
  2998.        Messages encrypted with the public key can only be decrypted
  2999.        with the associated private key. Conversely, messages signed
  3000.        with the private key can be verified with the public key.
  3001.  
  3002.    one-way hash function
  3003.        A one-way transformation that converts an arbitrary amount of
  3004.        data into a fixed-length hash. It is computationally hard to
  3005.        reverse the transformation or to find collisions. MD5 and SHA
  3006.        are examples of one-way hash functions.
  3007.  
  3008. |  RC2
  3009. |      A proprietary block cipher from RSA Data Security, Inc.
  3010. |      [RSADSI].
  3011.  
  3012. |  RC4
  3013. |      A stream cipher licensed by RSA Data Security [RSADSI]. A
  3014. |      compatible cipher is described in [RC4].
  3015.  
  3016.    RSA
  3017.        A very widely used public-key algorithm that can be used for
  3018.        either encryption or digital signing. [RSA]
  3019.  
  3020.    salt
  3021.        Non-secret random data used to make export encryption keys
  3022.        resist precomputation attacks.
  3023.  
  3024.  
  3025. Dierks, T.                  Expires September, 1997            [Page 54]
  3026. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3027.  
  3028.    server
  3029.        The server is the application entity that responds to requests
  3030.        for connections from clients. See also under client.
  3031.  
  3032.    session
  3033.        A TLS session is an association between a client and a server.
  3034.        Sessions are created by the handshake protocol. Sessions define
  3035.        a set of cryptographic security parameters, which can be shared
  3036.        among multiple connections. Sessions are used to avoid the
  3037.        expensive negotiation of new security parameters for each
  3038.        connection.
  3039.  
  3040.    session identifier
  3041.        A session identifier is a value generated by a server that
  3042.        identifies a particular session.
  3043.  
  3044.    server write key
  3045.        The key used to encrypt data written by the server.
  3046.  
  3047.    server write MAC secret
  3048.        The secret data used to authenticate data written by the server.
  3049.  
  3050.    SHA
  3051.        The Secure Hash Algorithm is defined in FIPS PUB 180-1. It
  3052. ]      produces a 20-byte output. Note that all references to SHA
  3053. ]      actually use the modified SHA-1 algorithm. [SHA]
  3054.  
  3055.    SSL
  3056.        Netscape's Secure Socket Layer protocol [SSL3]. TLS is based on
  3057.        SSL Version 3.0
  3058.  
  3059.    stream cipher
  3060.        An encryption algorithm that converts a key into a
  3061.        cryptographically-strong keystream, which is then exclusive-ORed
  3062.        with the plaintext.
  3063.  
  3064.    symmetric cipher
  3065.        See bulk cipher.
  3066.  
  3067. ]  Transport Layer Security (TLS)
  3068. ]      This protocol; also, the Transport Layer Security working group
  3069. ]      of the Internet Engineering Task Force (IETF). See "Comments" at
  3070. ]      the end of this document.
  3071.  
  3072. C. CipherSuite definitions
  3073.  
  3074. CipherSuite                      Is       Key          Cipher      Hash
  3075.                              Exportable Exchange
  3076.  
  3077. TLS_NULL_WITH_NULL_NULL               * NULL           NULL        NULL
  3078. TLS_RSA_WITH_NULL_MD5                 * RSA            NULL         MD5
  3079. TLS_RSA_WITH_NULL_SHA                 * RSA            NULL         SHA
  3080.  
  3081. Dierks, T.                  Expires September, 1997            [Page 55]
  3082. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3083.  
  3084. TLS_RSA_EXPORT_WITH_RC4_40_MD5        * RSA_EXPORT     RC4_40       MD5
  3085. TLS_RSA_WITH_RC4_128_MD5                RSA            RC4_128      MD5
  3086. TLS_RSA_WITH_RC4_128_SHA                RSA            RC4_128      SHA
  3087. TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5    * RSA_EXPORT     RC2_CBC_40   MD5
  3088. TLS_RSA_WITH_IDEA_CBC_SHA               RSA            IDEA_CBC     SHA
  3089. TLS_RSA_EXPORT_WITH_DES40_CBC_SHA     * RSA_EXPORT     DES40_CBC    SHA
  3090. TLS_RSA_WITH_DES_CBC_SHA                RSA            DES_CBC      SHA
  3091. TLS_RSA_WITH_3DES_EDE_CBC_SHA           RSA            3DES_EDE_CBC SHA
  3092. TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA  * DH_DSS_EXPORT  DES40_CBC    SHA
  3093. TLS_DH_DSS_WITH_DES_CBC_SHA             DH_DSS         DES_CBC      SHA
  3094. TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA        DH_DSS         3DES_EDE_CBC SHA
  3095. TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA  * DH_RSA_EXPORT  DES40_CBC    SHA
  3096. TLS_DH_RSA_WITH_DES_CBC_SHA             DH_RSA         DES_CBC      SHA
  3097. TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA        DH_RSA         3DES_EDE_CBC SHA
  3098. TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA * DHE_DSS_EXPORT DES40_CBC    SHA
  3099. TLS_DHE_DSS_WITH_DES_CBC_SHA            DHE_DSS        DES_CBC      SHA
  3100. TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA       DHE_DSS        3DES_EDE_CBC SHA
  3101. TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA * DHE_RSA_EXPORT DES40_CBC    SHA
  3102. TLS_DHE_RSA_WITH_DES_CBC_SHA            DHE_RSA        DES_CBC      SHA
  3103. TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA       DHE_RSA        3DES_EDE_CBC SHA
  3104. TLS_DH_anon_EXPORT_WITH_RC4_40_MD5    * DH_anon_EXPORT RC4_40       MD5
  3105. TLS_DH_anon_WITH_RC4_128_MD5            DH_anon        RC4_128      MD5
  3106. TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA   DH_anon        DES40_CBC    SHA
  3107. TLS_DH_anon_WITH_DES_CBC_SHA            DH_anon        DES_CBC      SHA
  3108. TLS_DH_anon_WITH_3DES_EDE_CBC_SHA       DH_anon        3DES_EDE_CBC SHA
  3109.  
  3110.    * Indicates IsExportable is True
  3111.  
  3112.       Key
  3113.       Exchange
  3114.       Algorithm       Description                        Key size limit
  3115.  
  3116.       DHE_DSS         Ephemeral DH with DSS signatures   None
  3117.       DHE_DSS_EXPORT  Ephemeral DH with DSS signatures   DH = 512 bits
  3118.       DHE_RSA         Ephemeral DH with RSA signatures   None
  3119.       DHE_RSA_EXPORT  Ephemeral DH with RSA signatures   DH = 512 bits,
  3120.                                                          RSA = none
  3121.       DH_anon         Anonymous DH, no signatures        None
  3122.       DH_anon_EXPORT  Anonymous DH, no signatures        DH = 512 bits
  3123.       DH_DSS          DH with DSS-based certificates     None
  3124.       DH_DSS_EXPORT   DH with DSS-based certificates     DH = 512 bits
  3125.       DH_RSA          DH with RSA-based certificates     None
  3126.       DH_RSA_EXPORT   DH with RSA-based certificates     DH = 512 bits,
  3127.                                                          RSA = none
  3128.       NULL            No key exchange                    N/A
  3129.       RSA             RSA key exchange                   None
  3130.       RSA_EXPORT      RSA key exchange                   RSA = 512 bits
  3131.  
  3132.    Key size limit
  3133.        The key size limit gives the size of the largest public key that
  3134.        can be legally used for encryption in cipher suites that are
  3135.        exportable.
  3136.  
  3137. Dierks, T.                  Expires September, 1997            [Page 56]
  3138. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3139.  
  3140.                          Key      Expanded   Effective   IV    Block
  3141.     Cipher       Type  Material Key Material  Key Bits  Size   Size
  3142.  
  3143.     NULL       * Stream   0          0           0        0     N/A
  3144.     IDEA_CBC     Block   16         16         128        8      8
  3145.     RC2_CBC_40 * Block    5         16          40        8      8
  3146.     RC4_40     * Stream   5         16          40        0     N/A
  3147.     RC4_128      Stream  16         16         128        0     N/A
  3148.     DES40_CBC  * Block    5          8          40        8      8
  3149.     DES_CBC      Block    8          8          56        8      8
  3150.     3DES_EDE_CBC Block   24         24         168        8      8
  3151.  
  3152.    * Indicates IsExportable is true.
  3153.  
  3154. |  Type
  3155. |      Indicates whether this is a stream cipher or a block cipher
  3156. |      running in CBC mode.
  3157.  
  3158.    Key Material
  3159.        The number of bytes from the key_block that are used for
  3160.        generating the write keys.
  3161.  
  3162.    Expanded Key Material
  3163.        The number of bytes actually fed into the encryption algorithm
  3164.  
  3165.    Effective Key Bits
  3166.        How much entropy material is in the key material being fed into
  3167.        the encryption routines.
  3168.  
  3169. |  IV Size
  3170. |      How much data needs to be generated for the initialization
  3171. |      vector. Zero for stream ciphers; equal to the block size for
  3172. |      block ciphers.
  3173.  
  3174. |  Block Size
  3175. |      The amount of data a block cipher enciphers in one chunk; a
  3176. |      block cipher running in CBC mode can only encrypt an even
  3177. |      multiple of its block size.
  3178.  
  3179.       Hash      Hash      Padding
  3180.     function    Size       Size
  3181.       NULL       0          0
  3182.       MD5        16         48
  3183.       SHA        20         40
  3184.  
  3185.    Appendix D
  3186.  
  3187. D. Implementation Notes
  3188.  
  3189.    The TLS protocol cannot prevent many common security mistakes. This
  3190.    section provides several recommendations to assist implementors.
  3191.  
  3192.  
  3193. Dierks, T.                  Expires September, 1997            [Page 57]
  3194. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3195.  
  3196. D.1. Temporary RSA keys
  3197.  
  3198.    US Export restrictions limit RSA keys used for encryption to 512
  3199.    bits, but do not place any limit on lengths of RSA keys used for
  3200.    signing operations. Certificates often need to be larger than 512
  3201.    bits, since 512-bit RSA keys are not secure enough for high-value
  3202.    transactions or for applications requiring long-term security. Some
  3203.    certificates are also designated signing-only, in which case they
  3204.    cannot be used for key exchange.
  3205.  
  3206.    When the public key in the certificate cannot be used for
  3207.    encryption, the server signs a temporary RSA key, which is then
  3208.    exchanged. In exportable applications, the temporary RSA key should
  3209.    be the maximum allowable length (i.e., 512 bits). Because 512-bit
  3210.    RSA keys are relatively insecure, they should be changed often. For
  3211.    typical electronic commerce applications, it is suggested that keys
  3212.    be changed daily or every 500 transactions, and more often if
  3213.    possible. Note that while it is acceptable to use the same temporary
  3214.    key for multiple transactions, it must be signed each time it is
  3215.    used.
  3216.  
  3217.    RSA key generation is a time-consuming process. In many cases, a
  3218.    low-priority process can be assigned the task of key generation.
  3219.  
  3220.    Whenever a new key is completed, the existing temporary key can be
  3221.    replaced with the new one.
  3222.  
  3223. D.2. Random Number Generation and Seeding
  3224.  
  3225.    TLS requires a cryptographically-secure pseudorandom number
  3226.    generator (PRNG). Care must be taken in designing and seeding PRNGs.
  3227.    PRNGs based on secure hash operations, most notably MD5 and/or SHA,
  3228.    are acceptable, but cannot provide more security than the size of
  3229.    the random number generator state. (For example, MD5-based PRNGs
  3230.    usually provide 128 bits of state.)
  3231.  
  3232.    To estimate the amount of seed material being produced, add the
  3233.    number of bits of unpredictable information in each seed byte. For
  3234.    example, keystroke timing values taken from a PC compatible's 18.2
  3235.    Hz timer provide 1 or 2 secure bits each, even though the total size
  3236.    of the counter value is 16 bits or more. To seed a 128-bit PRNG, one
  3237.    would thus require approximately 100 such timer values.
  3238.  
  3239. Warning: The seeding functions in RSAREF and versions of BSAFE prior to
  3240.          3.0 are order-independent. For example, if 1000 seed bits are
  3241.          supplied, one at a time, in 1000 separate calls to the seed
  3242.          function, the PRNG will end up in a state which depends only
  3243.          on the number of 0 or 1 seed bits in the seed data (i.e.,
  3244.          there are 1001 possible final states). Applications using
  3245.          BSAFE or RSAREF must take extra care to ensure proper seeding.
  3246. ]        This may be accomplished by accumulating seed bits into a
  3247. ]        buffer and processing them all at once or by processing an
  3248.  
  3249. Dierks, T.                  Expires September, 1997            [Page 58]
  3250. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3251.  
  3252. ]        incrementing counter with every seed bit; either method will
  3253. ]        reintroduce order dependence into the seeding process.
  3254.  
  3255. D.3. Certificates and authentication
  3256.  
  3257.    Implementations are responsible for verifying the integrity of
  3258.    certificates and should generally support certificate revocation
  3259.    messages. Certificates should always be verified to ensure proper
  3260.    signing by a trusted Certificate Authority (CA). The selection and
  3261.    addition of trusted CAs should be done very carefully. Users should
  3262.    be able to view information about the certificate and root CA.
  3263.  
  3264. D.4. CipherSuites
  3265.  
  3266.    TLS supports a range of key sizes and security levels, including
  3267.    some which provide no or minimal security. A proper implementation
  3268.    will probably not support many cipher suites. For example, 40-bit
  3269.    encryption is easily broken, so implementations requiring strong
  3270.    security should not allow 40-bit keys. Similarly, anonymous
  3271.    Diffie-Hellman is strongly discouraged because it cannot prevent
  3272.    man-in-the-middle attacks. Applications should also enforce minimum
  3273.    and maximum key sizes. For example, certificate chains containing
  3274.    512-bit RSA keys or signatures are not appropriate for high-security
  3275.    applications.
  3276.  
  3277. E. Backward Compatibility With SSL
  3278.  
  3279. ]  For historical reasons and in order to avoid a profligate
  3280. ]  consumption of reserved port numbers, application protocols which
  3281. ]  are secured by TLS 1.0, SSL 3.0, and SSL 2.0 all frequently share
  3282. ]  the same connection port: for example, the https protocol (HTTP
  3283. ]  secured by SSL or TLS) uses port 443 regardless of which security
  3284. ]  protocol it is using. Thus, some mechanism must be determined to
  3285. ]  distinguish and negotiate among the various protocols.
  3286.  
  3287. ]  TLS version 1.0 and SSL 3.0 are very similar; thus, supporting both
  3288. ]  is easy. TLS clients who wish to negotiate with SSL 3.0 servers
  3289. ]  should send client hello messages using the SSL 3.0 record format
  3290. ]  and client hello structure, sending {3, 1} for the version field to
  3291. ]  note that they support TLS 1.0. If the server supports only SSL 3.0,
  3292. ]  it will respond with an SSL 3.0 server hello; if it supports TLS,
  3293. ]  with a TLS server hello. The negotiation then proceeds as
  3294. ]  appropriate for the negotiated protocol.
  3295.  
  3296. ]  Similarly, a TLS server which wishes to interoperate with SSL 3.0
  3297. ]  clients should accept SSL 3.0 client hello messages and respond with
  3298. ]  an SSL 3.0 server hello if an SSL 3.0 client hello is received which
  3299. ]  has a version field of {3, 0}, denoting that this client does not
  3300. ]  support TLS.
  3301.  
  3302.  
  3303.  
  3304.  
  3305. Dierks, T.                  Expires September, 1997            [Page 59]
  3306. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3307.  
  3308. ]  Whenever a client already knows the highest protocol known to a
  3309. ]  server (for example, when resuming a session), it should initiate
  3310. ]  the connection in that native protocol.
  3311.  
  3312. ]  TLS 1.0 clients that support SSL Version 2.0 servers must send SSL
  3313. ]  Version 2.0 client hello messages [SSL2]. TLS servers should accept
  3314. ]  either client hello format if they wish to support SSL 2.0 clients
  3315. ]  on the same connection port. The only deviations from the Version
  3316. ]  2.0 specification are the ability to specify a version with a value
  3317. ]  of three and the support for more ciphering types in the CipherSpec.
  3318.  
  3319. Warning: The ability to send Version 2.0 client hello messages will be
  3320.          phased out with all due haste. Implementors should make every
  3321.          effort to move forward as quickly as possible. Version 3.0
  3322.          provides better mechanisms for moving to newer versions.
  3323.  
  3324.    The following cipher specifications are carryovers from SSL Version
  3325.    2.0. These are assumed to use RSA for key exchange and
  3326.    authentication.
  3327.  
  3328.        V2CipherSpec TLS_RC4_128_WITH_MD5          = { 0x01,0x00,0x80 };
  3329.        V2CipherSpec TLS_RC4_128_EXPORT40_WITH_MD5 = { 0x02,0x00,0x80 };
  3330.        V2CipherSpec TLS_RC2_CBC_128_CBC_WITH_MD5  = { 0x03,0x00,0x80 };
  3331.        V2CipherSpec TLS_RC2_CBC_128_CBC_EXPORT40_WITH_MD5
  3332.                                                   = { 0x04,0x00,0x80 };
  3333.        V2CipherSpec TLS_IDEA_128_CBC_WITH_MD5     = { 0x05,0x00,0x80 };
  3334.        V2CipherSpec TLS_DES_64_CBC_WITH_MD5       = { 0x06,0x00,0x40 };
  3335.        V2CipherSpec TLS_DES_192_EDE3_CBC_WITH_MD5 = { 0x07,0x00,0xC0 };
  3336.  
  3337.    Cipher specifications native to TLS can be included in Version 2.0
  3338.    client hello messages using the syntax below. Any V2CipherSpec
  3339.    element with its first byte equal to zero will be ignored by Version
  3340.    2.0 servers. Clients sending any of the above V2CipherSpecs should
  3341.    also include the TLS equivalent (see Appendix A.6):
  3342.  
  3343.        V2CipherSpec (see TLS name) = { 0x00, CipherSuite };
  3344.  
  3345. E.1. Version 2 client hello
  3346.  
  3347.    The Version 2.0 client hello message is presented below using this
  3348.    document's presentation model. The true definition is still assumed
  3349.    to be the SSL Version 2.0 specification.
  3350.  
  3351.        uint8 V2CipherSpec[3];
  3352.  
  3353.        struct {
  3354.            unit8 msg_type;
  3355.            Version version;
  3356.            uint16 cipher_spec_length;
  3357.            uint16 session_id_length;
  3358.            uint16 challenge_length;
  3359.            V2CipherSpec cipher_specs[V2ClientHello.cipher_spec_length];
  3360.  
  3361. Dierks, T.                  Expires September, 1997            [Page 60]
  3362. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3363.  
  3364.            opaque session_id[V2ClientHello.session_id_length];
  3365.            Random challenge;
  3366.        } V2ClientHello;
  3367.  
  3368.    msg_type
  3369.        This field, in conjunction with the version field, identifies a
  3370.        version 2 client hello message. The value should be one (1).
  3371.  
  3372.    version
  3373.        The highest version of the protocol supported by the client
  3374.        (equals ProtocolVersion.version, see Appendix A.1.1).
  3375.  
  3376.    cipher_spec_length
  3377.        This field is the total length of the field cipher_specs. It
  3378.        cannot be zero and must be a multiple of the V2CipherSpec length
  3379.        (3).
  3380.  
  3381.    session_id_length
  3382.        This field must have a value of either zero or 16. If zero, the
  3383.        client is creating a new session. If 16, the session_id field
  3384.        will contain the 16 bytes of session identification.
  3385.  
  3386.    challenge_length
  3387.        The length in bytes of the client's challenge to the server to
  3388.        authenticate itself. This value must be 32.
  3389.  
  3390.    cipher_specs
  3391.        This is a list of all CipherSpecs the client is willing and able
  3392.        to use. There must be at least one CipherSpec acceptable to the
  3393.        server.
  3394.  
  3395.    session_id
  3396.        If this field's length is not zero, it will contain the
  3397.        identification for a session that the client wishes to resume.
  3398.  
  3399.    challenge
  3400.        The client challenge to the server for the server to identify
  3401.        itself is a (nearly) arbitrary length random. The Version 3.0
  3402.        server will right justify the challenge data to become the
  3403.        ClientHello.random data (padded with leading zeroes, if
  3404.        necessary), as specified in this Version 3.0 protocol. If the
  3405.        length of the challenge is greater than 32 bytes, only the last
  3406.        32 bytes are used. It is legitimate (but not necessary) for a V3
  3407.        server to reject a V2 ClientHello that has fewer than 16 bytes
  3408.        of challenge data.
  3409.  
  3410.  Note: Requests to resume a TLS session should use a TLS client hello.
  3411.  
  3412. E.2. Avoiding man-in-the-middle version rollback
  3413.  
  3414.    When TLS clients fall back to Version 2.0 compatibility mode, they
  3415.    should use special PKCS #1 block formatting. This is done so that
  3416.  
  3417. Dierks, T.                  Expires September, 1997            [Page 61]
  3418. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3419.  
  3420.    TLS servers will reject Version 2.0 sessions with TLS-capable
  3421.    clients.
  3422.  
  3423.    When TLS clients are in Version 2.0 compatibility mode, they set the
  3424.    right-hand (least-significant) 8 random bytes of the PKCS padding
  3425.    (not including the terminal null of the padding) for the RSA
  3426.    encryption of the ENCRYPTED-KEY-DATA field of the CLIENT-MASTER-KEY
  3427.    to 0x03 (the other padding bytes are random). After decrypting the
  3428.    ENCRYPTED-KEY-DATA field, servers that support TLS should issue an
  3429.    error if these eight padding bytes are 0x03. Version 2.0 servers
  3430.    receiving blocks padded in this manner will proceed normally.
  3431.  
  3432.    Appendix F
  3433.  
  3434. F. Security analysis
  3435.  
  3436.    The TLS protocol is designed to establish a secure connection
  3437.    between a client and a server communicating over an insecure
  3438.    channel. This document makes several traditional assumptions,
  3439.    including that attackers have substantial computational resources
  3440.    and cannot obtain secret information from sources outside the
  3441.    protocol. Attackers are assumed to have the ability to capture,
  3442.    modify, delete, replay, and otherwise tamper with messages sent over
  3443.    the communication channel. This appendix outlines how TLS has been
  3444.    designed to resist a variety of attacks.
  3445.  
  3446. F.1. Handshake protocol
  3447.  
  3448.    The handshake protocol is responsible for selecting a CipherSpec and
  3449.    generating a Master Secret, which together comprise the primary
  3450.    cryptographic parameters associated with a secure session. The
  3451.    handshake protocol can also optionally authenticate parties who have
  3452.    certificates signed by a trusted certificate authority.
  3453.  
  3454. F.1.1. Authentication and key exchange
  3455.  
  3456.    TLS supports three authentication modes: authentication of both
  3457.    parties, server authentication with an unauthenticated client, and
  3458.    total anonymity. Whenever the server is authenticated, the channel
  3459.    should be secure against man-in-the-middle attacks, but completely
  3460.    anonymous sessions are inherently vulnerable to such attacks.
  3461. |  Anonymous servers cannot authenticate clients. If the server is
  3462.    authenticated, its certificate message must provide a valid
  3463.    certificate chain leading to an acceptable certificate authority.
  3464.    Similarly, authenticated clients must supply an acceptable
  3465.    certificate to the server. Each party is responsible for verifying
  3466.    that the other's certificate is valid and has not expired or been
  3467.    revoked.
  3468.  
  3469.    The general goal of the key exchange process is to create a
  3470.    pre_master_secret known to the communicating parties and not to
  3471.    attackers. The pre_master_secret will be used to generate the
  3472.  
  3473. Dierks, T.                  Expires September, 1997            [Page 62]
  3474. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3475.  
  3476.    master_secret (see Section 8.1). The master_secret is required to
  3477.    generate the certificate verify and finished messages, encryption
  3478.    keys, and MAC secrets (see Sections 7.4.8, 7.4.9 and 6.3). By
  3479.    sending a correct finished message, parties thus prove that they
  3480.    know the correct pre_master_secret.
  3481.  
  3482. F.1.1.1. Anonymous key exchange
  3483.  
  3484.    Completely anonymous sessions can be established using RSA or
  3485.    Diffie-Hellman for key exchange. With anonymous RSA, the client
  3486.    encrypts a pre_master_secret with the server's uncertified public
  3487.    key extracted from the server key exchange message. The result is
  3488.    sent in a client key exchange message. Since eavesdroppers do not
  3489.    know the server's private key, it will be infeasible for them to
  3490.    decode the pre_master_secret. (Note that no anonymous RSA Cipher
  3491.    Suites are defined in this document).
  3492.  
  3493.    With Diffie-Hellman, the server's public parameters are contained in
  3494.    the server key exchange message and the client's are sent in the
  3495.    client key exchange message. Eavesdroppers who do not know the
  3496.    private values should not be able to find the Diffie-Hellman result
  3497.    (i.e. the pre_master_secret).
  3498.  
  3499. Warning: Completely anonymous connections only provide protection
  3500.          against passive eavesdropping. Unless an independent
  3501.          tamper-proof channel is used to verify that the finished
  3502.          messages were not replaced by an attacker, server
  3503.          authentication is required in environments where active
  3504.          man-in-the-middle attacks are a concern.
  3505.  
  3506. F.1.1.2. RSA key exchange and authentication
  3507.  
  3508.    With RSA, key exchange and server authentication are combined. The
  3509.    public key may be either contained in the server's certificate or
  3510.    may be a temporary RSA key sent in a server key exchange message.
  3511.    When temporary RSA keys are used, they are signed by the server's
  3512.    RSA or DSS certificate. The signature includes the current
  3513.    ClientHello.random, so old signatures and temporary keys cannot be
  3514.    replayed. Servers may use a single temporary RSA key for multiple
  3515.    negotiation sessions.
  3516.  
  3517.  Note: The temporary RSA key option is useful if servers need large
  3518.        certificates but must comply with government-imposed size limits
  3519.        on keys used for key exchange.
  3520.  
  3521.    After verifying the server's certificate, the client encrypts a
  3522.    pre_master_secret with the server's public key. By successfully
  3523.    decoding the pre_master_secret and producing a correct finished
  3524.    message, the server demonstrates that it knows the private key
  3525.    corresponding to the server certificate.
  3526.  
  3527.  
  3528.  
  3529. Dierks, T.                  Expires September, 1997            [Page 63]
  3530. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3531.  
  3532.    When RSA is used for key exchange, clients are authenticated using
  3533.    the certificate verify message (see Section 7.4.8). The client signs
  3534.    a value derived from the master_secret and all preceding handshake
  3535.    messages. These handshake messages include the server certificate,
  3536.    which binds the signature to the server, and ServerHello.random,
  3537.    which binds the signature to the current handshake process.
  3538.  
  3539. F.1.1.3. Diffie-Hellman key exchange with authentication
  3540.  
  3541.    When Diffie-Hellman key exchange is used, the server can either
  3542.    supply a certificate containing fixed Diffie-Hellman parameters or
  3543.    can use the server key exchange message to send a set of temporary
  3544.    Diffie-Hellman parameters signed with a DSS or RSA certificate.
  3545.    Temporary parameters are hashed with the hello.random values before
  3546.    signing to ensure that attackers do not replay old parameters. In
  3547.    either case, the client can verify the certificate or signature to
  3548.    ensure that the parameters belong to the server.
  3549.  
  3550.    If the client has a certificate containing fixed Diffie-Hellman
  3551.    parameters, its certificate contains the information required to
  3552.    complete the key exchange. Note that in this case the client and
  3553.    server will generate the same Diffie-Hellman result (i.e.,
  3554.    pre_master_secret) every time they communicate. To prevent the
  3555.    pre_master_secret from staying in memory any longer than necessary,
  3556.    it should be converted into the master_secret as soon as possible.
  3557.    Client Diffie-Hellman parameters must be compatible with those
  3558.    supplied by the server for the key exchange to work.
  3559.  
  3560.    If the client has a standard DSS or RSA certificate or is
  3561.    unauthenticated, it sends a set of temporary parameters to the
  3562.    server in the client key exchange message, then optionally uses a
  3563.    certificate verify message to authenticate itself.
  3564.  
  3565. F.1.2. Version rollback attacks
  3566.  
  3567.    Because TLS includes substantial improvements over SSL Version 2.0,
  3568.    attackers may try to make TLS-capable clients and servers fall back
  3569.    to Version 2.0. This attack can occur if (and only if) two
  3570.    TLS-capable parties use an SSL 2.0 handshake.
  3571.  
  3572.    Although the solution using non-random PKCS #1 block type 2 message
  3573.    padding is inelegant, it provides a reasonably secure way for
  3574.    Version 3.0 servers to detect the attack. This solution is not
  3575.    secure against attackers who can brute force the key and substitute
  3576.    a new ENCRYPTED-KEY-DATA message containing the same key (but with
  3577.    normal padding) before the application specified wait threshold has
  3578.    expired. Parties concerned about attacks of this scale should not be
  3579.    using 40-bit encryption keys anyway. Altering the padding of the
  3580.    least-significant 8 bytes of the PKCS padding does not impact
  3581.    security for the size of the signed hashes and RSA key lengths used
  3582.    in the protocol, since this is essentially equivalent to increasing
  3583.    the input block size by 8 bytes.
  3584.  
  3585. Dierks, T.                  Expires September, 1997            [Page 64]
  3586. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3587.  
  3588. F.1.3. Detecting attacks against the handshake protocol
  3589.  
  3590.    An attacker might try to influence the handshake exchange to make
  3591.    the parties select different encryption algorithms than they would
  3592.    normally choose. Because many implementations will support 40-bit
  3593.    exportable encryption and some may even support null encryption or
  3594.    MAC algorithms, this attack is of particular concern.
  3595.  
  3596.    For this attack, an attacker must actively change one or more
  3597.    handshake messages. If this occurs, the client and server will
  3598.    compute different values for the handshake message hashes. As a
  3599.    result, the parties will not accept each others' finished messages.
  3600.    Without the master_secret, the attacker cannot repair the finished
  3601.    messages, so the attack will be discovered.
  3602.  
  3603. F.1.4. Resuming sessions
  3604.  
  3605.    When a connection is established by resuming a session, new
  3606.    ClientHello.random and ServerHello.random values are hashed with the
  3607.    session's master_secret. Provided that the master_secret has not
  3608.    been compromised and that the secure hash operations used to produce
  3609.    the encryption keys and MAC secrets are secure, the connection
  3610.    should be secure and effectively independent from previous
  3611.    connections. Attackers cannot use known encryption keys or MAC
  3612.    secrets to compromise the master_secret without breaking the secure
  3613.    hash operations (which use both SHA and MD5).
  3614.  
  3615.    Sessions cannot be resumed unless both the client and server agree.
  3616.    If either party suspects that the session may have been compromised,
  3617.    or that certificates may have expired or been revoked, it should
  3618.    force a full handshake. An upper limit of 24 hours is suggested for
  3619.    session ID lifetimes, since an attacker who obtains a master_secret
  3620.    may be able to impersonate the compromised party until the
  3621.    corresponding session ID is retired. Applications that may be run in
  3622.    relatively insecure environments should not write session IDs to
  3623.    stable storage.
  3624.  
  3625. F.1.5. MD5 and SHA
  3626.  
  3627.    TLS uses hash functions very conservatively. Where possible, both
  3628.    MD5 and SHA are used in tandem to ensure that non-catastrophic flaws
  3629.    in one algorithm will not break the overall protocol.
  3630.  
  3631. F.2. Protecting application data
  3632.  
  3633.    The master_secret is hashed with the ClientHello.random and
  3634.    ServerHello.random to produce unique data encryption keys and MAC
  3635.    secrets for each connection.
  3636.  
  3637.    Outgoing data is protected with a MAC before transmission. To
  3638.    prevent message replay or modification attacks, the MAC is computed
  3639.    from the MAC secret, the sequence number, the message length, the
  3640.  
  3641. Dierks, T.                  Expires September, 1997            [Page 65]
  3642. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3643.  
  3644.    message contents, and two fixed character strings. The message type
  3645.    field is necessary to ensure that messages intended for one TLS
  3646.    Record Layer client are not redirected to another. The sequence
  3647.    number ensures that attempts to delete or reorder messages will be
  3648.    detected. Since sequence numbers are 64-bits long, they should never
  3649.    overflow. Messages from one party cannot be inserted into the
  3650.    other's output, since they use independent MAC secrets. Similarly,
  3651.    the server-write and client-write keys are independent so stream
  3652.    cipher keys are used only once.
  3653.  
  3654.    If an attacker does break an encryption key, all messages encrypted
  3655.    with it can be read. Similarly, compromise of a MAC key can make
  3656.    message modification attacks possible. Because MACs are also
  3657.    encrypted, message-alteration attacks generally require breaking the
  3658.    encryption algorithm as well as the MAC.
  3659.  
  3660.  Note: MAC secrets may be larger than encryption keys, so messages can
  3661.        remain tamper resistant even if encryption keys are broken.
  3662.  
  3663. F.3. Final notes
  3664.  
  3665.    For TLS to be able to provide a secure connection, both the client
  3666.    and server systems, keys, and applications must be secure. In
  3667.    addition, the implementation must be free of security errors.
  3668.  
  3669.    The system is only as strong as the weakest key exchange and
  3670.    authentication algorithm supported, and only trustworthy
  3671.    cryptographic functions should be used. Short public keys, 40-bit
  3672.    bulk encryption keys, and anonymous servers should be used with
  3673.    great caution. Implementations and users must be careful when
  3674.    deciding which certificates and certificate authorities are
  3675.    acceptable; a dishonest certificate authority can do tremendous
  3676.    damage.
  3677.  
  3678.    Appendix G
  3679.  
  3680. G. Patent Statement
  3681.  
  3682.    This version of the TLS protocol relies on the use of patented
  3683.    public key encryption technology for authentication and encryption.
  3684.    The Internet Standards Process as defined in RFC 1310 requires a
  3685.    written statement from the Patent holder that a license will be made
  3686.    available to applicants under reasonable terms and conditions prior
  3687.    to approving a specification as a Proposed, Draft or Internet
  3688.    Standard. The Massachusetts Institute of Technology has granted RSA
  3689.    Data Security, Inc., exclusive sub-licensing rights to the following
  3690.    patent issued in the United States:
  3691.  
  3692.        Cryptographic Communications System and Method ("RSA"), No.
  3693.        4,405,829
  3694.  
  3695.  
  3696.  
  3697. Dierks, T.                  Expires September, 1997            [Page 66]
  3698. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3699.  
  3700.    The Board of Trustees of the Leland Stanford Junior University have
  3701.    granted Caro-Kann Corporation, a wholly owned subsidiary
  3702.    corporation, exclusive sub-licensing rights to the following patents
  3703.    issued in the United States, and all of their corresponding foreign
  3704.    patents:
  3705.  
  3706.        Cryptographic Apparatus and Method ("Diffie-Hellman"), No.
  3707.        4,200,770
  3708.  
  3709.        Public Key Cryptographic Apparatus and Method
  3710.        ("Hellman-Merkle"), No. 4,218,582
  3711.  
  3712.    The Internet Society, Internet Architecture Board, Internet
  3713.    Engineering Steering Group and the Corporation for National Research
  3714.    Initiatives take no position on the validity or scope of the patents
  3715.    and patent applications, nor on the appropriateness of the terms of
  3716.    the assurance. The Internet Society and other groups mentioned above
  3717.    have not made any determination as to any other intellectual
  3718.    property rights which may apply to the practice of this standard.
  3719.    Any further consideration of these matters is the user's own
  3720.    responsibility.
  3721.  
  3722. References
  3723.  
  3724.    [3DES] W. Tuchman, "Hellman Presents No Shortcut Solutions To DES,"
  3725.    IEEE Spectrum, v. 16, n. 7, July 1979, pp40-41.
  3726.  
  3727.    [DES] ANSI X3.106, "American National Standard for Information
  3728.    Systems-Data Link Encryption," American National Standards
  3729.    Institute, 1983.
  3730.  
  3731.    [DH1] W. Diffie and M. E. Hellman, "New Directions in Cryptography,"
  3732.    IEEE Transactions on Information Theory, V. IT-22, n. 6, Jun 1977,
  3733.    pp. 74-84.
  3734.  
  3735.    [DSS] NIST FIPS PUB 186, "Digital Signature Standard," National
  3736.    Institute of Standards and Technology, U.S. Department of Commerce,
  3737.    18 May 1994.
  3738.  
  3739.    [FTP] J. Postel and J. Reynolds, RFC 959: File Transfer Protocol,
  3740.    October 1985.
  3741.  
  3742.    [HTTP] T. Berners-Lee, R. Fielding, H. Frystyk, Hypertext Transfer
  3743.    Protocol -- HTTP/1.0, October, 1995.
  3744.  
  3745. |  [HMAC] H. Krawczyk, M. Bellare, and R. Canetti, RFC 2104, HMAC:
  3746. |  Keyed-Hashing for Message Authentication, February, 1997.
  3747.  
  3748.    [IDEA] X. Lai, "On the Design and Security of Block Ciphers," ETH
  3749.    Series in Information Processing, v. 1, Konstanz: Hartung-Gorre
  3750.    Verlag, 1992.
  3751.  
  3752.  
  3753. Dierks, T.                  Expires September, 1997            [Page 67]
  3754. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3755.  
  3756.    [MD2] R. Rivest. RFC 1319: The MD2 Message Digest Algorithm. April
  3757.    1992.
  3758.  
  3759.    [MD5] R. Rivest. RFC 1321: The MD5 Message Digest Algorithm. April
  3760.    1992.
  3761.  
  3762.    [PKCS1] RSA Laboratories, "PKCS #1: RSA Encryption Standard,"
  3763.    version 1.5, November 1993.
  3764.  
  3765.    [PKCS6] RSA Laboratories, "PKCS #6: RSA Extended Certificate Syntax
  3766.    Standard," version 1.5, November 1993.
  3767.  
  3768.    [PKCS7] RSA Laboratories, "PKCS #7: RSA Cryptographic Message Syntax
  3769.    Standard," version 1.5, November 1993.
  3770.  
  3771. ]  [PKIX] R. Housley, W. Ford, W. Polk, D. Solo, Internet Public Key
  3772. ]  Infrastructure: Part I: X.509 Certificate and CRL Profile,
  3773. ]  <draft-ietf-pkix-ipki-part1-03.txt>, December 1996.
  3774.  
  3775. |  [RC4] R. Thayer, A Stream Cipher Encryption Algorithm,
  3776. |  <draft-thayer-cipher-00.txt>, February 1997.
  3777.  
  3778.    [RSA] R. Rivest, A. Shamir, and L. M. Adleman, "A Method for
  3779.    Obtaining Digital Signatures and Public-Key Cryptosystems,"
  3780.    Communications of the ACM, v. 21, n. 2, Feb 1978, pp. 120-126.
  3781.  
  3782.    [RSADSI] Contact RSA Data Security, Inc., Tel: 415-595-8782 [SCH] B.
  3783.    Schneier. Applied Cryptography: Protocols, Algorithms, and Source
  3784.    Code in C, Published by John Wiley & Sons, Inc. 1994.
  3785.  
  3786.    [SHA] NIST FIPS PUB 180-1, "Secure Hash Standard," National
  3787.    Institute of Standards and Technology, U.S. Department of Commerce,
  3788.    DRAFT, 31 May 1994.
  3789.  
  3790. |  [SSL2] Hickman, Kipp, "The SSL Protocol", Netscape Communications
  3791. |  Corp., Feb 9th, 1995.
  3792.  
  3793.    [SSL3] Frier, Karton and Kocher,
  3794.    internet-draft-tls-ssl-version3-00.txt: "The SSL 3.0 Protocol", Nov
  3795.    18 1996.
  3796.  
  3797.    [TCP] ISI for DARPA, RFC 793: Transport Control Protocol, September
  3798.    1981.
  3799.  
  3800.    [TEL] J. Postel and J. Reynolds, RFC 854/5, May, 1993.
  3801.  
  3802.    [X509] CCITT. Recommendation X.509: "The Directory - Authentication
  3803.    Framework". 1988.
  3804.  
  3805.    [XDR] R. Srinivansan, Sun Microsystems, RFC-1832: XDR: External Data
  3806.    Representation Standard, August 1995.
  3807.  
  3808.  
  3809.  
  3810. Dierks, T.                  Expires September, 1997            [Page 68]
  3811. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3812.  
  3813. Credits
  3814.  
  3815. Working Group Chair
  3816.  
  3817.       Win Treese
  3818.       Open Market
  3819. |     treese@openmarket.com
  3820.  
  3821. Editors
  3822.  
  3823.       Christopher Allen             Tim Dierks
  3824.       Consensus Development         Consensus Development
  3825.       christophera@consensus.com    timd@consensus.com
  3826.  
  3827. Authors
  3828.  
  3829.       Tim Dierks                    Philip L. Karlton
  3830.       Consensus Development         Netscape Communications
  3831.       timd@consensus.com            karlton@netscape.com
  3832.  
  3833.       Alan O. Freier                Paul C. Kocher
  3834.       Netscape Communications       Independent Consultant
  3835.       freier@netscape.com           pck@netcom.com
  3836.  
  3837. Other contributors
  3838.  
  3839.       Martin Abadi                  Robert Relyea
  3840.       Digital Equipment Corporation Netscape Communications
  3841.       ma@pa.dec.com                 relyea@netscape.com
  3842.  
  3843. |     Ran Canetti                   Jim Roskind
  3844. |     IBM Watson Research Center    Netscape Communications
  3845. |     canetti@watson.ibm.com        jar@netscape.com
  3846.  
  3847.       Taher Elgamal                 Micheal J. Sabin, Ph. D.
  3848.       Netscape Communications       Consulting Engineer
  3849.       elgamal@netscape.com          msabin@netcom.com
  3850.  
  3851. |     Anil Gangolli                 Dan Simon
  3852. |     Netscape Communications       Microsoft
  3853. |     gangolli@netscape.com         dansimon@microsoft.com
  3854.  
  3855.       Kipp E.B. Hickman             Tom Weinstein
  3856.       Netscape Communications       Netscape Communications
  3857.       kipp@netscape.com             tomw@netscape.com
  3858.  
  3859. |     Hugo Krawczyk
  3860. |     IBM Watson Research Center
  3861. |     hugo@watson.ibm.com
  3862.  
  3863.  
  3864.  
  3865.  
  3866. Dierks, T.                  Expires September, 1997            [Page 69]
  3867. INTERNET-DRAFT                     TLS 1.0                    March 1997
  3868.  
  3869. Comments
  3870.  
  3871. ]  Comments on this draft should be sent to the editors, Tim Dierks and
  3872. ]  Christopher Allen at the address <ietf-tls-editors@consensus.com>,
  3873. ]  or to the IETF Transport Layer Security (TLS) Working Group.
  3874.  
  3875. ]  The discussion list for the IETF TLS working group is located at the
  3876. ]  e-mail address <ietf-tls@consensus.com>. Information on the group
  3877. ]  and information on how to subscribe to the list is at
  3878. ]  <http://www.consensus.com/ietf-tls/>.
  3879.  
  3880. ]  You can subscribe to the list by sending a message to
  3881. ]  <ietf-tls@consensus.com> with the subject "SUBSCRIBE". You can
  3882. ]  subscribe to a digested variant of the list by sending a message to
  3883. ]  <ietf-tls@consensus.com> with the subject "SUBSCRIBE DIGEST". To
  3884. ]  remove yourself from the list, send a message to
  3885. ]  <ietf-tls@consensus.com> with the subject "UNSUBSCRIBE".
  3886.  
  3887.    Archives of the list are at:
  3888. ]      <http://www.imc.org/ietf-tls/mail-archive/>
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922. Dierks, T.                  Expires September, 1997            [Page 70]
  3923.  
  3924.