home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_i / draft-ietf-ipsec-isakmp-oakley-02.txt < prev    next >
Text File  |  1996-11-21  |  55KB  |  1,513 lines

  1.  
  2.  
  3.  
  4. IPSEC Working Group                       D. Harkins, D. Carrel, Editors
  5. INTERNET-DRAFT                                             cisco Systems
  6. draft-ietf-ipsec-isakmp-oakley-02.txt                      November 1996
  7.  
  8.  
  9.                   The resolution of ISAKMP with Oakley
  10.                 <draft-ietf-ipsec-isakmp-oakley-02.txt>
  11.  
  12.  
  13.                           Status of this Memo
  14.  
  15.    This document is an Internet Draft. Internet Drafts are working
  16.    documents of the Internet Engineering Task Force (IETF), its areas,
  17.    and working groups.  Note that other groups may also distribute
  18.    working documents as Internet Drafts.
  19.  
  20.    Internet Drafts are draft documents valid for a maximum of six months
  21.    and may be updated, replaced, or obsoleted by other documents at any
  22.    time. It is inapproporiate to use Internet Drafts as reference
  23.    material or to cite them other than as "work in progress."
  24.  
  25.    To learn the current status of any Internet Draft, please check the
  26.    "1id-abstracts.txt" listing contained in the Internet Drafts Shadow
  27.    Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
  28.    munnari.oz.au (Australia), ds.internic.net (US East Coast), or
  29.    ftp.isi.edu (US West Coast).
  30.  
  31.  
  32. 1. Abstract
  33.  
  34.    [MSST96] (ISAKMP) provides a framework for authentication and key
  35.    exchange but does not define them.  ISAKMP is designed to be key
  36.    exchange independant; that is, it is designed to support many
  37.    different key exchanges.
  38.  
  39.    [Orm96] (Oakley) describes a series of key exchanges-- called
  40.    "modes"-- and details the services provided by each (e.g. perfect
  41.    forward secrecy for keys, identity protection, and authentication).
  42.  
  43.    This document describes a proposal for using the Oakley Key Exchange
  44.    Protocol in conjunction with ISAKMP to obtain authenticated keying
  45.    material for use with ISAKMP, and for other security associations
  46.    such as AH and ESP for the IETF IPsec DOI.
  47.  
  48. 2. Discussion
  49.  
  50.    This draft combines ISAKMP and Oakley. The purpose is to negotiate,
  51.    and provide authenticated keying material for, security associations
  52.  
  53.  
  54.  
  55. Harkins, Carrel                                             [Page 1]
  56.  
  57. INTERNET DRAFT                                                 June 1996
  58.  
  59.  
  60.    in a protected manner.
  61.  
  62.    Processes which implement this draft can be used for negotiating
  63.    virtual private networks (VPNs) and also for providing a remote user
  64.    from a remote site (whose IP address need not be known beforehand)
  65.    access to a secure host or network.
  66.  
  67.    Proxy negotiation is supported.  Proxy mode is where the negotiating
  68.    parties are not the endpoints for which security association
  69.    negotiation is taking place.  When used in proxy mode, the identities
  70.    of the end parties remain hidden.
  71.  
  72.    This proposal does not implement the entire Oakley protocol, but only
  73.    a subset necessary to satisfy its goals. It does not claim
  74.    conformance or compliance with the entire Oakley protocol. For
  75.    greater understanding of the Oakley protocol and the mathematics
  76.    behind it, please refer to [Orm96].
  77.  
  78. 3. Terms and Definitions
  79.  
  80. 3.1 Requirements Terminology
  81.  
  82.    In this document, the words that are used to define the significance
  83.    of each particular requirement are usually capitalised.  These words
  84.    are:
  85.  
  86.    - MUST
  87.  
  88.       This word or the adjective "REQUIRED" means that the item is an
  89.       absolute requirement of the specification.
  90.  
  91.    - SHOULD
  92.  
  93.       This word or the adjective "RECOMMENDED" means that there might
  94.       exist valid reasons in particular circumstances to ignore this
  95.       item, but the full implications should be understood and the case
  96.       carefully weighed before taking a different course.
  97.  
  98.    - MAY
  99.  
  100.       This word or the adjective "OPTIONAL" means that this item is
  101.       truly optional.  One vendor might choose to include the item
  102.       because a particular marketplace requires it or because it
  103.       enhances the product, for example; another vendor may omit the
  104.       same item.
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111. Harkins, Carrel                                             [Page 2]
  112.  
  113. INTERNET DRAFT                                                 June 1996
  114.  
  115.  
  116. 3.2 Notation
  117.  
  118.    The following notation is used throughout this draft.
  119.  
  120.       HDR is an ISAKMP header whose exchange type is the mode.  When
  121.       writen as HDR* it indicates payload encryption.
  122.  
  123.       SA is an SA negotiation payload with one or more proposals. An
  124.       initiator MAY provide multiple proposals for negotiation; a
  125.       responder MUST reply with only one.
  126.  
  127.       SAp is the entire body of the SA payload (minus the SA header)--
  128.       i.e.  all proposals and transforms offered by the Initiator.
  129.  
  130.       KE is the key exchange payload.
  131.  
  132.       Nx is the nonce payload; x can be: i or r for the ISAKMP initiator
  133.       and responder respectively.
  134.  
  135.       IDx is the identity payload for "x".  x can be: "ii" or "ir" for
  136.       the ISAKMP initiator and responder respectively during phase one
  137.       negotiation; or "ui" or "ur" for the user initiator and responder
  138.       respectively during phase two.  The ID payload format for the
  139.       Internet DOI is defined in [Pip96].
  140.  
  141.       SIG is the signature payload. The data to sign is exchange-
  142.       specific.
  143.  
  144.       CERT is the certificate payload.
  145.  
  146.       HASH is the hash payload. The contents of the hash are exchange
  147.       specific.
  148.  
  149.       prf() is the keyed hash function negotiated as part of the ISAKMP
  150.       SA.
  151.  
  152.       SKEYID_e is the keying material used by the ISAKMP SA to protect
  153.       it's messages.
  154.  
  155.       SKEYID_a is the keying material used by the ISAKMP SA to
  156.       authenticate it's messages.
  157.  
  158.       <x>y indicates that "x" is encrypted with the key "y".
  159.  
  160.       --> signifies "initiator to responder" communication (requests).
  161.  
  162.       <-- signifies "responder to initiator" communication (replies).
  163.  
  164.  
  165.  
  166.  
  167. Harkins, Carrel                                             [Page 3]
  168.  
  169. INTERNET DRAFT                                                 June 1996
  170.  
  171.  
  172.        |  signifies concatenation of information-- e.g. X | Y is the
  173.       concatentation of X with Y.
  174.  
  175.       [x] indicates that x is optional.
  176.  
  177.    Payload encryption (when noted by a '*' after the ISAKMP header) MUST
  178.    begin immediately after the ISAKMP header. When communication is
  179.    protected, all payloads following the ISAKMP header MUST be
  180.    encrypted.  Encryption keys are generated from SKEYID_e in a manner
  181.    that is defined for each algorithm.
  182.  
  183. 3.3 Perfect Forward Secrecy
  184.  
  185.    When used in the draft Perfect Forward Secrecy (PFS) refers to the
  186.    notion that compromise of a single key will permit access to only
  187.    data protected by a single key. For PFS to exist the key used to
  188.    protect transmission of data MUST NOT be used to derive any
  189.    additional keys, and if the key used to protect transmission of data
  190.    was derived from some other keying material, that material MUST NOT
  191.    be used to derive any more keys.
  192.  
  193.    Perfect Forward Secrecy for both keys and identities is provided in
  194.    this protocol. (Sections 5.7 and 7).
  195.  
  196. 3.4 Security Association
  197.  
  198.    A security association (SA) is a set of policy and key used to
  199.    protect information. The ISAKMP SA is the shared policy and key used
  200.    by the negotiating peers in this protocol to protect their
  201.    communication.
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223. Harkins, Carrel                                             [Page 4]
  224.  
  225. INTERNET DRAFT                                                 June 1996
  226.  
  227.  
  228. 4. Introducttion
  229.  
  230.    Oakley defines a method to establish an authenticated key exchange.
  231.    This includes how payloads are constructed, the information they
  232.    carry, the order in which they are processed and how they are used.
  233.  
  234.    While Oakley defines "modes", ISAKMP defines "phases".  The
  235.    relationship between the two is very straightforward.  ISAKMP's phase
  236.    1 is where the two ISAKMP peers establish a secure, authenticated
  237.    channel with which to communicate.  This is called the ISAKMP
  238.    Security Association (SA). Oakley's "Main Mode" and "Aggressive Mode"
  239.    each accomplish a phase 1 exchange.  "Main Mode" and "Aggressive
  240.    Mode" MUST ONLY be used in phase 1.
  241.  
  242.    Phase 2 is where Security Associations are negotiated on behalf of
  243.    services such as AH, ESP or any other service which needs key
  244.    material and/or parameter negotiation. Oakley's "Quick Mode"
  245.    accomplishes a phase 2 exchange.  "Quick Mode" MUST ONLY be used in
  246.    phase 2.
  247.  
  248.    Oakley's "New Group Mode" is not really a phase 1 or phase 2.  It
  249.    follows phase 1, but serves to establish a new group which can be
  250.    used in future negotiations. "New Group Mode" MUST ONLY be used in
  251.    phase 2.
  252.  
  253.    With the use of ISAKMP phases, an implementation can accomplish very
  254.    fast keying when necessary.  A single phase 1 negotiation may be used
  255.    for more than one phase 2 negotiation.  Additionally a single phase 2
  256.    negotiation can request multiple Security Associations.  With these
  257.    optimizations, an implementation can see less than one round trip per
  258.    SA as well as less than one DH exponentiation per SA.  "Main Mode"
  259.    for phase 1 provides identity protection.  When identity protection
  260.    is not needed, "Aggressive Mode" can be used to reduce round trips
  261.    even further.  Developer hints for doing these optimizations are
  262.    included below.
  263.  
  264.    The following attributes are required by Oakley and MUST be
  265.    negotiated as part of the ISAKMP Security Association.  (These
  266.    attributes pertain only to the ISAKMP Security Association and not to
  267.    any Security Associations that ISAKMP may be negotiating on behalf of
  268.    other services.)
  269.  
  270.       - encryption algorithm (e.g. DES, IDEA, Blowfish).
  271.  
  272.       - hash algorithm (e.g. MD5, SHA)
  273.  
  274.       - authentication method (e.g. DSS sig, RSA sig, RSA encryption,
  275.       pre-shared key)
  276.  
  277.  
  278.  
  279. Harkins, Carrel                                             [Page 5]
  280.  
  281. INTERNET DRAFT                                                 June 1996
  282.  
  283.  
  284.       - information about a group over which to do Diffie-Hellman.
  285.  
  286.    The selected hash algorithm MUST support both keyed and unkeyed
  287.    modes.
  288.  
  289.    Oakley implementations MUST support the following default attributes:
  290.  
  291.       - DES-CBC with a weak, and semi-weak, key check (weak and semi-
  292.       weak keys are referenced in [Sch94] and listed in Appendix A). The
  293.       key is derived according to Appendix B.
  294.  
  295.       - MD5 and SHA in native and HMAC mode [KBC96].
  296.  
  297.       - Authentication via pre-shared keys. The Digital Signature
  298.       Standard SHOULD be supported; RSA SHOULD also be supported.
  299.  
  300.       - MODP over the default Oakley group (see below). ECP and EC2N
  301.       groups MAY be supported.
  302.  
  303.    The Oakley modes described here MUST be implemented whenever the IETF
  304.    IPsec DOI [Pip96] is implemented. Other DOIs MAY use the Oakley modes
  305.    described here.
  306.  
  307. 5. Exchanges
  308.  
  309.    There are two basic methods used to establish an authenticated key
  310.    exchange: Oakley Main Mode and Oakley Aggressive Mode. Each generates
  311.    authenticated keying material from an ephemeral Diffie-Hellman
  312.    exchange. Oakley in Main Mode MUST be implemented; Oakley Aggressive
  313.    Mode SHOULD be implemented. In addition, Oakley Quick Mode MUST be
  314.    implemented as a mechanism to generate fresh keying material and
  315.    negotiate non-ISAKMP security services. In additon, Oakley New Group
  316.    Mode SHOULD be implemented as a mechanism to define private groups
  317.    for Diffie-Hellman exchanges. Implementations MUST NOT switch
  318.    exchange types in the middle of an exchange.
  319.  
  320.    Exchanges conform to standard ISAKMP [MSST96] payload syntax.
  321.    attribute encoding, timeouts and retransmits of messages, and
  322.    informational messages-- e.g a notify response is sent when, for
  323.    example, a proposal is unacceptable, or a signature verification or
  324.    decryption was unsuccessful, etc.
  325.  
  326.    Oakley Main Mode is an instantiation of the ISAKMP Identity Protect
  327.    Exchange: The first two messages negotiate policy; the next two
  328.    exchange Diffie-Hellman public values and ancillary data (e.g.
  329.    nonces) necessary for the exchange; and the last two messages
  330.    authenticate the Diffie-Hellman Exchange. The authentication method
  331.    negotiated as part of the initial ISAKMP exchange influences the
  332.  
  333.  
  334.  
  335. Harkins, Carrel                                             [Page 6]
  336.  
  337. INTERNET DRAFT                                                 June 1996
  338.  
  339.  
  340.    composition of the payloads but not their purpose. The XCHG for
  341.    Oakley Main Mode is ISAKMP Identity Protect.
  342.  
  343.    Similarly, Oakley Aggressive Mode is an instantiation of the ISAKMP
  344.    Base Exchange. The first two messages negotiate policy, exchange
  345.    Diffie-Hellman public values and ancillary data necessary for the
  346.    exchange, and identities.  In addition the second message
  347.    authenticates the responder. The third message authenticates the
  348.    initiator and provides a proof of participation in the exchange. The
  349.    XCHG for Oakley Aggressive Mode is ISAKMP Base Exchange.  The final
  350.    message is not sent under protection of the ISAKMP SA allowing each
  351.    party to postpone exponentiation, if desired, until negotiation of
  352.    this exchange is complete.
  353.  
  354.    The result of either exchange is two groups of authenticated keying
  355.    material:
  356.  
  357.       SKEYID_e = prf(g^xy, CKY-I | CKY-R | Ni | Nr | 0)
  358.       SKEYID_a = prf(g^xy, CKY-I | CKY-R | Ni | Nr | 1)
  359.  
  360.    and agreed upon policy to protect further communications. The values
  361.    of 0 and 1 above are represented by a single octet. The key used for
  362.    encryption is derived from SKEYID_e in an algorithm-specific manner
  363.    (see appendix B).
  364.  
  365.    Quick Mode and New Group Mode have no analog in ISAKMP. The XCHG
  366.    values for Quick Mode and New Group Mode are defined in Appendix A.
  367.  
  368.    As mentioned above, the negotiated authentication method influences
  369.    the content and use of messages for Phase 1 Oakley Modes, but not
  370.    their intent.  When using public keys for authentication, the Phase 1
  371.    Oakley can be accomplished either by using signatures or by using
  372.    public key encryption (if the algorithm supports it). Following are
  373.    Main Mode Exchanges with different authentication options.
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391. Harkins, Carrel                                             [Page 7]
  392.  
  393. INTERNET DRAFT                                                 June 1996
  394.  
  395.  
  396. 5.1 ISAKMP/Oakley Phase 1 Authenticated With Signatures
  397.  
  398.    Using signatures, the ancillary information exchanged during the
  399.    second roundtrip are nonces; the exchange is authenticated by signing
  400.    a mutually obtainable hash. Oakley Main Mode with signature
  401.    authentication is described as follows:
  402.  
  403.         Initiator                        Responder
  404.        ----------                       -----------
  405.         HDR, SA                   -->
  406.                                   <--    HDR, SA
  407.         HDR, KE, Ni               -->
  408.                                   <--    HDR, KE, Nr
  409.         HDR*, IDii, [ CERT, ] SIG -->
  410.                                   <--    HDR*, IDir, [ CERT, ] SIG
  411.  
  412.    Oakley Aggressive mode with signatures in conjunction with ISAKMP is
  413.    described as follows:
  414.  
  415.         Initiator                        Responder
  416.        -----------                      -----------
  417.         HDR, SA, KE, Ni, IDii     -->
  418.                                   <--    HDR, SA, KE, Nr, IDir,
  419.                                               [ CERT, ] SIG
  420.         HDR, [ CERT, ] SIG        -->
  421.  
  422.    In both modes, the signed data in SIG is a signature of a keyed hash
  423.    of the concatenation of the nonces, cookies, the entire SA offer--
  424.    everything following the SA header-- that was sent from Initiator to
  425.    Responder, and the sender's ID, with g^xy as the key to the hash
  426.    function. The order of the nonces, and cookies are specific to the
  427.    direction. In other words, the sender signs, HASH_I, and the
  428.    responder signs HASH_R where:
  429.  
  430.        HASH_I = prf(g^xy, Ni | Nr | CKY-I | CKY-R | SAp | IDii))
  431.        HASH_R = prf(g^xy, Nr | Ni | CKY-R | CKY-I | SAp | IDir))
  432.  
  433.    In general the keyed hash will be the HMAC version of the negotiated
  434.    hash function. This can be overridden for construction of the
  435.    signature if the signature algorithm is tied to a particular hash
  436.    algorithm. In this case, the negotiated hash function would continue
  437.    to be used for all other proscribed hashing functions.
  438.  
  439.    One or more certificate payloads MAY be optionally passed.
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447. Harkins, Carrel                                             [Page 8]
  448.  
  449. INTERNET DRAFT                                                 June 1996
  450.  
  451.  
  452. 5.2 Oakley Phase 1 Authenticated With Public Key Encryption
  453.  
  454.    Using public key encryption to authenticate the exchange, the
  455.    ancillary information exchanged is encrypted nonces. Each party's
  456.    ability to reconstruct a hash (proving that the other party decrypted
  457.    the nonce) authenticates the exchange.
  458.  
  459.    In order to perform the public key encryption, the initiator must
  460.    already have the responder's public key. In the case where a party
  461.    has multiple public keys, a hash of the certificate the initiator is
  462.    using to encrypt the ancillary information is passed as part of the
  463.    third message. In this way the responder can determine which
  464.    corresponding private key to use to decrypt the nonce and identity
  465.    protection is retained.
  466.  
  467.    In addition, the identities of the parties (IDii and IDir) are also
  468.    encrypted with the other parties public key. If the authentication
  469.    method is public key encryption, the nonce and identity payloads MUST
  470.    be encrypted with the public key of the other party.
  471.  
  472.    When using encrytion for authentication with Oakley, Main Mode is
  473.    defined as follows.
  474.  
  475.         Initiator                        Responder
  476.        -----------                      -----------
  477.         HDR, SA                   -->
  478.                                   <--    HDR, SA
  479.         HDR, KE, [ HASH(1), ]
  480.           <IDii>PubKey_r,
  481.            <Ni>PubKey_r           -->
  482.                                          HDR, KE, <IDir>PubKey_r,
  483.                                   <--          <Nr>PubKey_i
  484.         HDR*, HASH_I              -->
  485.                                   <--    HDR*, HASH_R
  486.  
  487.    Oakley Aggressive Mode authenticated with encryption is described as
  488.    follows:
  489.  
  490.         Initiator                        Responder
  491.        -----------                      -----------
  492.         HDR, SA, [ HASH(1),] KE,
  493.           <IDii>Pubkey_r,
  494.           <Ni>PubKey_r            -->
  495.                                          HDR, SA, KE, <Nr>PubKey_i,
  496.                                   <--         IDir, HASH_R
  497.         HDR, HASH_I               -->
  498.  
  499.    Where HASH(1) is a hash (using the negotiated hash function) of the
  500.  
  501.  
  502.  
  503. Harkins, Carrel                                             [Page 9]
  504.  
  505. INTERNET DRAFT                                                 June 1996
  506.  
  507.  
  508.    certificate which the initiator is using to encrypt the nonce and
  509.    identity.  The contents of the other hashes (HASH_I and HASH_R) are
  510.    the results of the HMAC version of the hash algorithm negotiated in
  511.    the first roundtrip, with a concatenation of the nonces as the key
  512.    and a concatenation of the shared secret, the cookies, the entire SA
  513.    offer-- everything following the SA header-- that was sent from
  514.    Initiator to Responder, and the sender's ID as the hashed data. The
  515.    order of the nonces and cookies are specific to the direction. In
  516.    other words:
  517.  
  518.        HASH_I = prf(Ni | Nr, g^xy | CKY-I | CKY-R | SAp | IDii))
  519.        HASH_R = prf(Nr | Ni, g^xy | CKY-R | CKY-I | SAp | IDir))
  520.  
  521.    Using encryption for authentication provides for a plausably deniable
  522.    exchange. There is no proof (as with a digital signature) that the
  523.    conversation ever took place since each party can completely
  524.    reconstruct both sides of the exchange.
  525.  
  526.    Note that, unlike other authentication methods, authentication with
  527.    public key encryption allows for identity protection with Aggressive
  528.    Mode.
  529.  
  530.  
  531. 5.3 Oakley Phase 1 Authenticated With a Pre-Shared Key
  532.  
  533.    A key derived by some out-of-band mechanism may also be used to
  534.    authenticate the exchange. The actual establishment of this key is
  535.    out of the scope of this document.
  536.  
  537.    When doing a pre-shared key authentication with Oakley, Main Mode is
  538.    defined as follows
  539.  
  540.               Initiator                        Responder
  541.              ----------                       -----------
  542.               HDR, SA             -->
  543.                                   <--    HDR, SA
  544.               HDR, KE, Ni         -->
  545.                                   <--    HDR, KE, Nr
  546.               HDR*, IDii, HASH_I  -->
  547.                                   <--    HDR*, IDir, HASH_R
  548.  
  549.    Oakley Aggressive mode with a pre-shared key is described as follows:
  550.  
  551.             Initiator                        Responder
  552.            -----------                      -----------
  553.             HDR, SA, KE, Ni, IDii -->
  554.                                   <--    HDR, SA, KE, Nr, IDir, HASH_R
  555.             HDR, HASH_I           -->
  556.  
  557.  
  558.  
  559. Harkins, Carrel                                            [Page 10]
  560.  
  561. INTERNET DRAFT                                                 June 1996
  562.  
  563.  
  564.    The hash is the result of the HMAC version of the hash algorithm
  565.    negotiated in the first roundtrip with the pre-shared key as the key
  566.    to the HMAC, and a concatenation of the shared secret, the nonces,
  567.    the cookies, the complete SA offer-- everything following the SA
  568.    header-- sent from Initiator to Responder, and the sender's ID. The
  569.    order of the cookies and nonces are specific to the direction. In
  570.    other words,
  571.  
  572.       HASH_I = prf(pre-shared-key, g^xy | Ni | Nr | CKY-I | CKY-R | SAp
  573.    | IDii)
  574.       HASH_R = prf(pre-shared-key, g^xy | Nr | Ni | CKY-R | CKY-I | SAp
  575.    | IDir)
  576.  
  577.  
  578. 5.4 Oakley Phase 2 - Quick Mode
  579.  
  580.    Oakley Quick Mode is not a complete exchange itself, but is used as
  581.    part of the ISAKMP SA negotiation process (phase 2) to derive keying
  582.    material and negotiate shared policy for non-ISAKMP SAs. The
  583.    information exchanged along with Oakley Quick Mode MUST be protected
  584.    by the ISAKMP SA-- i.e. all payloads except the ISAKMP header are
  585.    encrypted.
  586.  
  587.    Quick Mode is essentially an exchange of nonces that provides replay
  588.    protection. The nonces are used to generate fresh key material and
  589.    prevent replay attacks from generating bogus security associations.
  590.    An optional Key Exchange payload can be exchanged to allow for an
  591.    additional Diffie-Hellman exchange and exponentiation per Quick Mode.
  592.    While use of the key exchange payload with Quick Mode is optional it
  593.    MUST be supported.
  594.  
  595.    Base Quick Mode (without the KE payload) refreshens the keying
  596.    material derived from the exponentiation in phase 1. This does not
  597.    provide PFS.  Using the optional KE payload, an additional
  598.    exponentiation is performed and PFS is provided for the keying
  599.    material. If a KE payload is sent, a Diffie-Hellman group (see
  600.    section 5.5.1 and Appendix A) MUST be sent as attributes of the SA
  601.    being negotiated.
  602.  
  603.    Quick Mode is defined as follows:
  604.  
  605.         Initiator                        Responder
  606.        -----------                      -----------
  607.         HDR*, HASH(1), SA, Ni
  608.           [, KE ] [, IDui, IDur ] -->
  609.                                   <--    HDR*, HASH(2), SA, Nr
  610.                                                [, KE ] [, IDui, IDur ]
  611.         HDR*, HASH(3)             -->
  612.  
  613.  
  614.  
  615. Harkins, Carrel                                            [Page 11]
  616.  
  617. INTERNET DRAFT                                                 June 1996
  618.  
  619.  
  620.    Where:
  621.       HASH(1) and HASH(2) are keyed hashes of the entire message that
  622.    follows the hash including payload headers, and HASH(3)-- for
  623.    liveliness-- is a keyed hash of the value zero represented as a
  624.    single octet, followed by a concatenation of the two nonces. For
  625.    example, the hashes for the above exchange would be:
  626.  
  627.       HASH(1) = prf( SKEYID_a, SA | Ni [ | KE ] [ | IDui | IDur ] )
  628.       HASH(2) = prf( SKEYID_a, SA | Nr [ | KE ] [ | IDui | IDur ] )
  629.       HASH(3) = prf( SKEYID_a, 0 | Ni | Nr )
  630.  
  631.    If PFS is not needed, and KE payloads are not exchanged, the new
  632.    keying material is defined as KEYMAT = prf(SKEYID_e, Ni | Nr | 0).
  633.  
  634.    If PFS is desired and KE payloads were exchanged, the new keying
  635.    material is defined as KEYMAT = prf(g(qm)^xy, Ni | Nr | 0), where
  636.    g(qm)^xy is the shared secret from the ephemeral Diffie-Hellman
  637.    exchange of this Quick Mode.
  638.  
  639.    In either case, 0 is represented by a single octet.
  640.  
  641.    For situations where the amount of keying material desired is greater
  642.    than that supplied by the prf, KEYMAT is expanded by concatenation
  643.    and rehashing with a monotonically increasing number represented by a
  644.    single octet, i.e.
  645.  
  646.       KEYMAT = prf(SKEYID_e, Ni | Nr | 0) | prf(SKEYID_e, Ni | Nr | 1)
  647.    ...
  648.  
  649.    repeated until the required keying material has been reached.
  650.  
  651.    This keying material (whether with PFS or without, and whether
  652.    derived directly or through concatenation) MUST be used with the
  653.    negotiated SA. It is up to the service to define how keys are derived
  654.    from the keying material (see Appendix B).
  655.  
  656.    In the case of an ephemeral Diffie-Hellman exchange in Quick Mode,
  657.    the exponential (g(qm)^xy) is irretreivably removed from the current
  658.    state and SKEYID_e and SKEYID_a (derived from phase 1 negotiation)
  659.    continue to protect and authenticate the ISAKMP SA.
  660.  
  661.    If ISAKMP is acting as a proxy negotiator on behalf of another party
  662.    the identities of the parties MUST be passed as IDui and IDur. Local
  663.    policy will dictate whether the proposals are acceptible for the
  664.    identities specified.  If IDs are not exchanged, the negotiation is
  665.    assumed to be done on behalf of each ISAKMP peer.  If an ID range
  666.    (see Appendix A of [Pip96]) is not acceptable (for example, the
  667.    specified subnet is too large) a BAD_ID_RANGE notify message followed
  668.  
  669.  
  670.  
  671. Harkins, Carrel                                            [Page 12]
  672.  
  673. INTERNET DRAFT                                                 June 1996
  674.  
  675.  
  676.    by an acceptible ID range, in an ID payload, MUST be sent.
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727. Harkins, Carrel                                            [Page 13]
  728.  
  729. INTERNET DRAFT                                                 June 1996
  730.  
  731.  
  732.    Using Quick Mode, multiple SA's and keys can be negotiated with one
  733.    exchange as follows:
  734.  
  735.         Initiator                        Responder
  736.        -----------                      -----------
  737.         HDR*, HASH(1), SA0, SA1, Ni,
  738.           [, KE ] [, IDui, IDur ] -->
  739.                                   <--    HDR*, HASH(2), SA0, SA1, Nr,
  740.                                             [, KE ] [, IDui, IDur ]
  741.         HDR*, HASH(3)             -->
  742.  
  743.    and the keying material for SAx is prf(SKEYID_e, Ni | Nr | x) where x
  744.    is the number of the SA negotiated (starting with zero). (In the case
  745.    where one, or all, of the SAs required keys longer than that supplied
  746.    by the prf, the number merely monotonically increases for this entire
  747.    exchange-- e.g. SA0 uses 0 and 1; SA1 uses 2 and 3; etc). For ease of
  748.    processing the HASH payloads MUST immediately follow the ISAKMP
  749.    header and precede all other payloads.
  750.  
  751. 5.4 Oakley New Group Mode
  752.  
  753.    Oakley New Group Mode MUST NOT be used prior to establishment of an
  754.    ISAKMP SA. The description of a new group MUST only follow phase 1
  755.    negotiation.  (It is not a phase 2 exchange, though).
  756.  
  757.         Initiator                        Responder
  758.        -----------                      -----------
  759.         HDR*, HASH(1), SA        -->
  760.                                  <--     HDR*, HASH(2), SA
  761.  
  762.    where HASH(1) is a keyed hash, using SKEYID_a as the key, and the
  763.    entire SA proposal, body and header, as the data; HASH(2) is a keyed
  764.    hash, using SKEYID_a as the key, and the reply as the data.
  765.  
  766.    The proposal will be an Oakley proposal which specifies the
  767.    characteristics of the group (see appendix A, "Oakley Attribute
  768.    Assigned Numbers"). Group descriptions for private Oakley Groups MUST
  769.    be greater than or equal to 2^15.  If the group is not acceptable,
  770.    the responder MUST reply with a Notify payload with the message type
  771.    set to GROUP_NOT_ACCEPTABLE (13).
  772.  
  773.    ISAKMP implementations MAY require private groups to expire with the
  774.    SA under which they were established.
  775.  
  776.    Groups may be directly negotiated in the SA proposal with Oakley Main
  777.    Mode.  To do this the Prime, Generator, and Group Type are passed as
  778.    SA attributes (see Appendix A in [MSST96]). Alternately, the nature
  779.    of the group can be hidden using Oakley New Group Mode and only the
  780.  
  781.  
  782.  
  783. Harkins, Carrel                                            [Page 14]
  784.  
  785. INTERNET DRAFT                                                 June 1996
  786.  
  787.  
  788.    group identifier is passed in the clear during Main Mode.
  789.  
  790. 5.5 Oakley Groups
  791.  
  792.    [Orm96] defines several groups.  The value 0 indicates no group.  The
  793.    value 1 indicates the default group described below. The attriute
  794.    class for "Group" is defined in Appendix A. Other values are also
  795.    defined in [Orm96]. All values 2^15 and higher are used for private
  796.    group identifiers.
  797.  
  798. 5.5.1 Oakley Default Group
  799.  
  800.    Oakley implementations MUST support a MODP group with the following
  801.    prime and generator. This group is assigned id 1 (one).
  802.  
  803.       The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 }
  804.       Its hexadecimal value is
  805.  
  806.          FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
  807.          29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
  808.          EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
  809.          E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF
  810.  
  811.       The generator is: 2.
  812.  
  813.    other groups can be defined using Oakley New Group Mode. This default
  814.    group was generated by Richard Schroeppel at the University of
  815.    Arizona.  Properties of this prime are described by the following
  816.    exerpt from [Orm96]:
  817.  
  818.          The prime for this group was selected to have certain
  819.          properties.  The high order 64 bits are forced to 1.  This
  820.          helps the classical remainder algorithm, because the trial
  821.          quotient digit can always be taken as the high order word of
  822.          the dividend, possibly +1.  The low order 64 bits are forced to
  823.          1.  This helps the Montgomery-style remainder algorithms,
  824.          because the multiplier digit can always be taken to be the low
  825.          order word of the dividend.  The middle bits are taken from the
  826.          binary expansion of pi.  This guarantees that they are
  827.          effectively random, while avoiding any suspicion that the
  828.          primes have secretly been selected to be weak.
  829.  
  830.          The prime is chosen to be a Sophie-Germain prime (i.e., (P-1)/2
  831.          is also prime), to have the maximum strength against the
  832.          square-root attack.  The starting trial numbers were repeatedly
  833.          incremented by 2^64 until suitable primes were located.
  834.  
  835.          Because this prime is congruent to 7 (mod 8), 2 is a quadratic
  836.  
  837.  
  838.  
  839. Harkins, Carrel                                            [Page 15]
  840.  
  841. INTERNET DRAFT                                                 June 1996
  842.  
  843.  
  844.          residue.  All powers of 2 will also be quadratic residues.
  845.          This prevents an opponent from learning the low order bit of
  846.          the Diffie-Hellman exponent.  Using 2 as a generator is
  847.          efficient for some modular exponentiation algorithms.  [Note
  848.          that 2 is technically not a generator in the number theory
  849.          sense, because it omits half of the possible residues mod P.
  850.          From a cryptographic viewpoint, this is a virtue.]
  851.  
  852.    A further discussion of the properties of this group, the motivation
  853.    behind its creation, as well as the definition of several more groups
  854.    can be found in [Orm96].
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895. Harkins, Carrel                                            [Page 16]
  896.  
  897. INTERNET DRAFT                                                 June 1996
  898.  
  899.  
  900. 5.6 Payload Explosion for Complete ISAKMP-Oakley Exchange
  901.  
  902.    This section illustrates how ISAKMP payloads are used with Oakley to:
  903.  
  904.       - establish a secure and authenticated channel between ISAKMP
  905.       processes (phase 1); and
  906.  
  907.       - generate key material for, and negotiate, an IPsec SA (phase 2).
  908.  
  909. 5.6.1 Phase 1 using Oakley Main Mode
  910.  
  911.    The following diagram illustrates the payloads exchanged between the
  912.    two parties in the first round trip exchange. The initiator MAY
  913.    propose several proposals; the responder MUST reply with one.
  914.  
  915.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  916.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  917.       ~        ISAKMP Header with XCHG of Oakley Main Mode,           ~
  918.       ~             and Next Payload of ISA_SA                        ~
  919.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  920.       !    ISA_PROP   !    RESERVED   !        Payload Length         !
  921.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  922.       !             Domain of Interpretation (IPsec DOI)              !
  923.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  924.       !                          Situation                            !
  925.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  926.       !    ISA_TRANS  !    RESERVED   !        Payload Length         !
  927.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  928.       !  Proposal #1  ! Proto=ISAKMP  !        # of Transforms        !
  929.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  930.       ~                        SPI (8 octets)                         ~
  931.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  932.       !    ISA_TRANS  !    RESERVED   !        Payload Length         !
  933.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  934.       !  Transform #1 !          RESERVED             |     OAKLEY    !
  935.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  936.       ~                   preffered SA attributes                     ~
  937.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  938.       !       0       !    RESERVED   !        Payload Length         !
  939.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  940.       !  Transform #2 !          RESERVED             |     OAKLEY    !
  941.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  942.       ~                   alternate SA attributes                     ~
  943.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  944.  
  945.    The responder replies in kind but selects, and returns, one transform
  946.    proposal (the ISAKMP SA attributes).
  947.  
  948.  
  949.  
  950.  
  951. Harkins, Carrel                                            [Page 17]
  952.  
  953. INTERNET DRAFT                                                 June 1996
  954.  
  955.  
  956.    The second exchange consists of the following payloads:
  957.  
  958.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  959.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  960.       ~        ISAKMP Header with XCHG of Oakley Main Mode,           ~
  961.       ~             and Next Payload of ISA_KE                        ~
  962.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  963.       !    ISA_NONCE  !    RESERVED   !        Payload Length         !
  964.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  965.       ~   D-H Public Value  (g^x from initiator g^y from responder)   ~
  966.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  967.       !       0       !    RESERVED   !        Payload Length         !
  968.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  969.       ~         Ni (from initiator) or  Nr (from responder)           ~
  970.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  971.  
  972.    The shared keys, SKEYID_e and SKEYID_a, are now used to protect and
  973.    authenticate all further communication. Note that both SKEYID_e and
  974.    SKEYID_a are unauthenticated.
  975.  
  976.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  977.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  978.       ~        ISAKMP Header with XCHG of Oakley Main Mode,           ~
  979.       ~     and Next Payload of ISA_ID and the encryption bit set     ~
  980.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  981.       !    ISA_SIG    !    RESERVED   !        Payload Length         !
  982.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  983.       ~        Identification Data of the ISAKMP negotiator           ~
  984.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  985.       !       0       !    RESERVED   !        Payload Length         !
  986.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  987.       ~       signature verified by the public key of the ID above    ~
  988.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  989.  
  990.    The key exchange is authenticated over a signed hash as described in
  991.    section 5.1. Once the signature has been verified using the
  992.    authentication algorithm negotiated as part of the ISAKMP SA, the
  993.    shared keys, SKEYID_e and SKEYID_a can be marked as authenticated.
  994.    (For brevity, certificate payloads were not exchanged).
  995.  
  996. 5.6.2 Phase 2 using Oakley Quick Mode
  997.  
  998.      The following payloads are exchanged in the first round of Oakley
  999.    Quick Mode with ISAKMP SA negotiation. In this hypothetical exchange,
  1000.    the ISAKMP negotiators are proxies for other parties which have
  1001.    requested authentication.
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007. Harkins, Carrel                                            [Page 18]
  1008.  
  1009. INTERNET DRAFT                                                 June 1996
  1010.  
  1011.  
  1012.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1013.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1014.       ~        ISAKMP Header with XCHG of Oakley Quick Mode,          ~
  1015.       ~   Next Payload of ISA_HASH and the encryption bit set         ~
  1016.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1017.       !     ISA_SA    !    RESERVED   !        Payload Length         !
  1018.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1019.       ~                 keyed hash of message                         ~
  1020.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1021.       !    ISA_PROP   !    RESERVED   !         Payload Length        !
  1022.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1023.       !                 Domain Of Interpretation (DOI)                !
  1024.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1025.       !                          Situation                            !
  1026.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1027.       !    ISA_TRANS  !    RESERVED   !        Payload Length         !
  1028.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1029.       !  Proposal #1  !  Protocol=AH  !        # of Transforms        !
  1030.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1031.       ~                        SPI (8 octets)                         ~
  1032.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1033.       !    ISA_TRANS  !    RESERVED   !        Payload Length         !
  1034.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1035.       !  Transform #1 !          RESERVED             |     SHA       !
  1036.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1037.       !                       other SA attributes                     !
  1038.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1039.       !   ISA_NONCE   !    RESERVED   !        Payload Length         !
  1040.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1041.       !  Transform #1 !          RESERVED             |     MD5       !
  1042.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1043.       !                       other SA attributes                     !
  1044.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1045.       !    ISA_ID     !    RESERVED   !        Payload Length         !
  1046.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1047.       ~                            nonce                              ~
  1048.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1049.       !    ISA_ID     !    RESERVED   !        Payload Length         !
  1050.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1051.       ~              ID of source for which ISAKMP is a proxy         ~
  1052.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1053.       !      0        !    RESERVED   !        Payload Length         !
  1054.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1055.       ~           ID of destination for which ISAKMP is a proxy       ~
  1056.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1057.  
  1058.    where the contents of the hash are described in 5.4 above. The
  1059.    responder replies with a similar message which only contains one
  1060.  
  1061.  
  1062.  
  1063. Harkins, Carrel                                            [Page 19]
  1064.  
  1065. INTERNET DRAFT                                                 June 1996
  1066.  
  1067.  
  1068.    transform-- the selected AH transform. Upon receipt, the initiator
  1069.    can provide the key engine with the negotiated security association
  1070.    and the keying material.  As a check against replay attacks, the
  1071.    responder waits until receipt of the next message.
  1072.  
  1073.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1074.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1075.       ~        ISAKMP Header with XCHG of Oakley Quick Mode,          ~
  1076.       ~   Next Payload of ISA_HASH and the encryption bit set         ~
  1077.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1078.       !       0       !    RESERVED   !        Payload Length         !
  1079.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1080.       ~                         hash data                             ~
  1081.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1082.  
  1083.    where the contents of the hash are described in 5.4 above.
  1084.  
  1085. 5.7 Perfect Forward Secrecy Example
  1086.    This protocol can provide PFS of both keys and identities. The
  1087.    identies of both the ISAKMP negotiating peer and, if applicable, the
  1088.    proxy for whom the peers are negotiating can be protected with PFS.
  1089.  
  1090.    To provide Perfect Forward Secrecy of both keys and all identities,
  1091.    two parties would perform the following:
  1092.  
  1093.          o A Main Mode Exchange to protect the identities of the ISAKMP
  1094.    peers.
  1095.            This establishes an ISAKMP SA.
  1096.          o A Quick Mode Exchange to negotiate other security protocol
  1097.    protection.
  1098.            This establishes a SA on each end for this protocol.
  1099.          o Delete the ISAKMP SA and its associated state.
  1100.  
  1101.    Since the key for use in the non-ISAKMP SA was derived from the
  1102.    single ephemeral Diffie-Hellman exchange PFS is preserved.
  1103.  
  1104.    To provide Perfect Forward Secrecy of merely the keys of a non-ISAKMP
  1105.    security association, it in not necessary to do a phase 1 exchange if
  1106.    an ISAKMP SA exists between the two peers. A single Quick Mode in
  1107.    which the optional KE payload is passed, and an additional Diffie-
  1108.    Hellman exchange is performed, is all that is required. At this point
  1109.    the state derived from this Quick Mode must be deleted from the
  1110.    ISAKMP SA as described in section 5.4.
  1111.  
  1112. 6. Implementation Hints
  1113.  
  1114.    Using a single ISAKMP Phase 1 negotiation makes subsequent Phase 2
  1115.    negotiations extremely quick.  As long as the Phase 1 state remains
  1116.  
  1117.  
  1118.  
  1119. Harkins, Carrel                                            [Page 20]
  1120.  
  1121. INTERNET DRAFT                                                 June 1996
  1122.  
  1123.  
  1124.    cached, and PFS is not needed, Phase 2 can proceed without any
  1125.    exponentiation. How many Phase 2 negotiations can be performed for a
  1126.    single Phase 1 is a local policy issue. The decision will depend on
  1127.    the strength of the algorithms being used and level of trust in the
  1128.    peer system.
  1129.  
  1130.    An implementation may wish to negotiate a range of SAs when
  1131.    performing Quick Mode.  By doing this they can speed up the "re-
  1132.    keying". Quick Mode defines how KEYMAT is defined for a range of SAs.
  1133.    When one peer feels it is time to change SAs they simple use the next
  1134.    one within the stated range. A range of SAs can be established by
  1135.    negotiating multiple SAs (identical attributes, different SPIs) with
  1136.    one Quick Mode.
  1137.  
  1138.    An optimization that is often useful is to establish Security
  1139.    Associations with peers before they are needed so that when they
  1140.    become needed they are already in place. This ensures there would be
  1141.    no delays due to key management before initial data transmission.
  1142.    This optimization is easily implemented by setting up more than one
  1143.    Security Association with a peer for each requested Security
  1144.    Association and caching those not immediately used.
  1145.  
  1146.    Also, if ISAKMP is implementation is alerted that a SA will soon be
  1147.    needed (e.g. to replace an existing SA that will expire in the near
  1148.    future), then it can establish the new SA before that new SA is
  1149.    needed.
  1150.  
  1151. 7. Security Considerations
  1152.  
  1153.    This entire draft discusses a hybrid protocol, combining Oakley with
  1154.    ISAKMP, to negotiate, and derive keying material for, security
  1155.    associations in a secure and authenticated manner.
  1156.  
  1157.    Confidentiality is assured by the use of a negotiated encryption
  1158.    algorithm.  Authentication is assured by the use of a negotiated
  1159.    method: a digital signature algorithm; a public key algorithm which
  1160.    supports encryption; or, a pre-shared key. The confidentiality and
  1161.    authentication of this exchange is only as good as the attributes
  1162.    negotiated as part of the ISAKMP security association.
  1163.  
  1164.    Repeated re-keying using Quick Mode can consume the entropy of the
  1165.    Diffie- Hellman shared secret. Implementors should take note of this
  1166.    fact and set a limit on Quick Mode Exchanges between exponentiations.
  1167.    This draft does not proscribe such a limit.
  1168.  
  1169.    Perfect Forward Secrecy (PFS) of both keying material and identities
  1170.    is possible with this protocol. By specifying a Diffie-Hellman group,
  1171.    and passing public values in KE payloads, ISAKMP peers can establish
  1172.  
  1173.  
  1174.  
  1175. Harkins, Carrel                                            [Page 21]
  1176.  
  1177. INTERNET DRAFT                                                 June 1996
  1178.  
  1179.  
  1180.    PFS of keys-- the identities would be protected by SKEYID_e from the
  1181.    ISAKMP SA and would therefore not be protected by PFS. If PFS of both
  1182.    keying material and identities is desired, an ISAKMP peer MUST
  1183.    establish only one non-ISAKMP security association (e.g. IPsec
  1184.    Security Association) per ISAKMP SA. PFS for keys and identities is
  1185.    accomplished by deleting the ISAKMP SA (and optionally issuing a
  1186.    DELETE message) upon establishment of the single non-ISAKMP SA. In
  1187.    this way a phase one negotiation is uniquely tied to a single phase
  1188.    two negotiation, and the ISAKMP SA established during phase one
  1189.    negotiation is never used again.
  1190.  
  1191. 8. Acknowledgements
  1192.  
  1193.    This document is the result of close consultation with Hilarie Orman,
  1194.    Douglas Maughan, Mark Schertler, Mark Schneider, and Jeff Turner. It
  1195.    relies completely on protocols which were written by them. Without
  1196.    their interest and dedication, this would not have been written.
  1197.  
  1198.    We would also like to thank Cheryl Madson, Harry Varnis, Elfed
  1199.    Weaver, and Hugo Krawcyzk for technical input.
  1200.  
  1201. 9. References
  1202.  
  1203.    [KBC96] Krawczyk, H., Bellare, M., Canetti, R., "HMAC: Keyed-Hashing
  1204.    for Message Authentication", draft-ietf-ipsec-hmac-md5-01.txt
  1205.  
  1206.    [Kra96] Krawcyzk, H., "SKEME: A Versatile Secure Key Exchange
  1207.    Mechanism for Internet", from IEEE Proceedings of the 1996 Symposium
  1208.    on Network and Distributed Systems Security.
  1209.  
  1210.    [MSST96] Maughhan, D., Schertler, M., Schneider, M., and Turner, J.,
  1211.    "Internet Security Association and Key Management Protocol (ISAKMP)",
  1212.    version 6, draft-ietf-ipsec-isakmp-06.{ps,txt}.
  1213.  
  1214.    [Orm96] Orman, H., "The Oakley Key Determination Protocol", version
  1215.    1, draft-ietf-ipsec-oakley-01.txt.
  1216.  
  1217.    [Pip96] Piper, D., "The Internet IP Security Domain Of Interpretation
  1218.    for ISAKMP", version 1, draft-ietf-ipsec-ipsec-doi-00.txt.
  1219.  
  1220.    [Sch94] Schneier, B., "Applied Cryptography, Protocols, Algorithms,
  1221.    and Source Code in C", 1st edition.
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231. Harkins, Carrel                                            [Page 22]
  1232.  
  1233. INTERNET DRAFT                                                 June 1996
  1234.  
  1235.  
  1236. Appendix A
  1237.  
  1238.    This is a list of DES Weak and Semi-Weak keys.  The keys come from
  1239.    [Sch94].  All keys are listed in hexidecimal.
  1240.  
  1241.       DES Weak Keys
  1242.       0101 0101 0101 0101
  1243.       1F1F 1F1F E0E0 E0E0
  1244.       E0E0 E0E0 1F1F 1F1F
  1245.       FEFE FEFE FEFE FEFE
  1246.  
  1247.       DES Semi-Weak Keys
  1248.       01FE 01FE 01FE 01FE
  1249.       1FE0 1FE0 0EF1 0EF1
  1250.       01E0 01E0 01F1 01F1
  1251.       1FFE 1FFE 0EFE 0EFE
  1252.       011F 011F 010E 010E
  1253.       E0FE E0FE F1FE F1FE
  1254.  
  1255.       FE01 FE01 FE01 FE01
  1256.       E01F E01F F10E F10E
  1257.       E001 E001 F101 F101
  1258.       FE1F FE1F FE0E FE0E
  1259.       1F01 1F01 0E01 0E01
  1260.       FEE0 FEE0 FEF1 FEF1
  1261.  
  1262.  
  1263.    Attribute Assigned Numbers
  1264.  
  1265.    Attributes negotiated during phase one use the following definitions. Phase
  1266.    two attributes are defined in the applicable DOI specification (for example,
  1267.    IPsec attributes are defined in the IPsec DOI), with the exception of a group
  1268.    description when Quick Mode includes an ephemeral Diffie-Hellman exchange.
  1269.    Attribute types can be either Basic (B) or Variable-length (V). Encoding of
  1270.    these attributes is defined in the base ISAKMP specification.
  1271.  
  1272.      Attribute Classes
  1273.  
  1274.           class                         value              type
  1275.      ---------------------------------------------------------------------------
  1276.       Encryption Algorithm                1                 B
  1277.       Hash Algorithm                      2                 B
  1278.       Authentication Method               3                 B
  1279.       Group Description                   4                 B
  1280.       Group Type                          5                 B
  1281.       Group Prime                         6                 V
  1282.       Group Generator One                 7                 V
  1283.       Group Generator Two                 8                 V
  1284.  
  1285.  
  1286.  
  1287. Harkins, Carrel                                            [Page 23]
  1288.  
  1289. INTERNET DRAFT                                                 June 1996
  1290.  
  1291.  
  1292.       Group Curve A                       9                 V
  1293.       Group Curve B                      10                 V
  1294.       Life Type                          11                 B
  1295.       Life Duration                      12                B/V
  1296.  
  1297.      Class Values
  1298.  
  1299.      Encryption Algorithm
  1300.        DEC-CBC                             1
  1301.        IDEA-CBC                            2
  1302.        Blowfish-CBC                        3
  1303.  
  1304.        values 4-65000 are reserved. Values 65001-65535 are for
  1305.      private use among mutually consenting parties.
  1306.  
  1307.      Hash Algorithm
  1308.        MD5                                 1
  1309.        SHA                                 2
  1310.        Tiger                               3
  1311.  
  1312.        values 4-65000 are reserved. Values 65001-65535 are for
  1313.      private use among mutually consenting parties.
  1314.  
  1315.      Authentication Method
  1316.        pre-shared key                      1
  1317.        DSS signatures                      2
  1318.        RSA signatures                      3
  1319.        RSA encryption                      4
  1320.  
  1321.        values 5-65000 are reserved. Values 65001-65535 are for
  1322.      private use among mutually consenting parties.
  1323.  
  1324.      Group Description
  1325.        default group (section 5.5.1)       1
  1326.  
  1327.        values 2-32767 are reserved. Values 32768-65535 are for
  1328.      private use among mutually consenting parties.
  1329.  
  1330.      Group Type
  1331.        MODP (modular exponentiation group) 1
  1332.        ECP (elliptic curve group)          2
  1333.  
  1334.      Life Type
  1335.        seconds                             1
  1336.        kilobytes                           2
  1337.  
  1338.        values 3-65000 are reserved. Values 65001-65535 are for
  1339.      private use among mutually consenting parties. For a given "Life Type"
  1340.  
  1341.  
  1342.  
  1343. Harkins, Carrel                                            [Page 24]
  1344.  
  1345. INTERNET DRAFT                                                 June 1996
  1346.  
  1347.  
  1348.      the value of the "Life Duration" attribute defines the actual length of
  1349.      the SA life-- either a number of seconds, or a number of kbytes protected.
  1350.  
  1351.      Additional Exchanges Defined-- XCHG values
  1352.        Quick Mode                          32
  1353.        New Group Mode                      33
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399. Harkins, Carrel                                            [Page 25]
  1400.  
  1401. INTERNET DRAFT                                                 June 1996
  1402.  
  1403.  
  1404. Appendix B
  1405.  
  1406.    Encryption keys used to protect the ISAKMP SA are derived from SKEYID_e in
  1407.    an algorithm-specific manner. When SKEYID_e is not long enough to supply all
  1408.    the necessary keying material an algorithm requires, the key is derived from
  1409.    a concatenation of SKEYID_e and successive keyed hashes of a single
  1410.    character which contains a monotonically increasing counter beginning at
  1411.    one (1), and SKEYID_e as the key, using the negotiated hash function.
  1412.  
  1413.    For example, if (ficticious) algorithm AKULA requires 320-bits of key (and
  1414.    has no weak key check) and the prf used to generate SKEYID_e only generates
  1415.    120 bits of material, the key for AKULA, would be the first 320-bits of
  1416.    Ka, where:
  1417.  
  1418.            Ka = SKEYID_e | prf(SKEYID_e | 1) | prf(SKEYID_e | 2)
  1419.  
  1420.    where prf is the HMAC version of the negotiated hash function. SKEYID_e
  1421.    provides 120-bits, and each of the two additional hashes provide 120-bits,
  1422.    for a total of 360 bits.
  1423.  
  1424.    Material for the initialization vector (IV material) for CBC mode encryption
  1425.    algorithms is derived from a hash of a concatenation of the initiator's
  1426.    public Diffie-Hellman value and the responder's public Diffie-Hellman value
  1427.    using the negotiated hash algorithm.
  1428.  
  1429.    The key for DES-CBC is derived from the first eight (8) non-weak and
  1430.    semi-weak (see Appendix A) bytes of SKEYID_e. The IV is the first 8 bytes
  1431.    of the IV material derived above.
  1432.  
  1433.    The key for IDEA-CBC is derived from the first sixteen (16) bytes of SKEYID_e.
  1434.    The IV is the first 8 bytes of the IV material derived above.
  1435.  
  1436.    The key for Blowfish-CBC is derived from the first fifty-six (56) bytes of
  1437.    a key derived in the method described above, by concatenating successive
  1438.    hashes onto SKEYID_e until the requesite number of bytes has been achieved.
  1439.    The IV is the first 8 bytes of the IV material derived above.
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455. Harkins, Carrel                                            [Page 26]
  1456.  
  1457. INTERNET DRAFT                                                 June 1996
  1458.  
  1459.  
  1460. Editors'  Addresses:
  1461.  
  1462.    Dan Harkins <dharkins@cisco.com>
  1463.    Dave Carrel <carrel@cisco.com>
  1464.    cisco Systems
  1465.    170 W. Tasman Dr.
  1466.    San Jose, California, 95134-1706
  1467.    United States of America
  1468.    +1 408 526 4000
  1469.  
  1470. Editors' Note:
  1471.  
  1472.    The editors encourage independent implementation, and
  1473.    interoperability testing, of this hybrid exchange.
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511. Harkins, Carrel                                            [Page 27]
  1512.  
  1513.