<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC1321 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1321.xml">
<!ENTITY RFC2045 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2045.xml">
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3526 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3526.xml">
<!ENTITY RFC4253 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4253.xml">
<!ENTITY RFC4462 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4462.xml">
<!ENTITY RFC5656 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5656.xml">
<!ENTITY RFC6194 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6194.xml">
<!ENTITY RFC7546 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7546.xml">
<!ENTITY RFC7748 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7748.xml">
<!ENTITY RFC8268 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8268.xml">
<!ENTITY SSHCURVES PUBLIC '' 'http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-curdle-ssh-curves-07.xml'>
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>

<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc autobreaks="yes"?>
<?rfc docmapping="yes"?>

<rfc category="std" docName="draft-ietf-curdle-gss-keyex-sha2-04"
     ipr="trust200902" updates="4462">
  <front>
    <title abbrev="GSS Keyex SHA2">GSS-API Key Exchange with SHA2</title>

    <author fullname="Simo Sorce" initials="S." surname="Sorce">
      <organization>Red Hat, Inc.</organization>

      <address>
        <postal>
          <street>140 Broadway</street>

          <street>24th Floor</street>

          <city>New York</city>

          <region>NY</region>

          <code>10025</code>

          <country>USA</country>
        </postal>

        <email>simo@redhat.com</email>
      </address>
    </author>

    <author fullname="Hubert Kario" initials="H." surname="Kario">
      <organization>Red Hat, Inc.</organization>

      <address>
        <postal>
          <street>Purkynova 99/71</street>

          <city>Brno</city>

          <code>612 45</code>

          <country>Czech Republic</country>
        </postal>

        <email>hkario@redhat.com</email>
      </address>
    </author>

    <date month="Jan" year="2018" />

    <area>Security</area>

    <workgroup>Internet Engineering Task Force</workgroup>

    <abstract>
      <t>This document specifies additions and amendments to RFC4462.
      It defines a new key exchange method that uses SHA-2 for integrity and
      deprecates weak DH groups. The purpose of this specification is to
      modernize the cryptographic primitives used by GSS Key Exchanges.</t>
    </abstract>
  </front>


  <middle>
    <section title="Introduction">
      <t><xref target="RFC4462">SSH GSS-API Methods</xref> allows the use of
      GSSAPI for authentication and key exchange in SSH. It defines three
      exchange methods all based on DH groups and SHA-1. The new methods
      described in this document are intended to support environments that
      desire to use the SHA-2 cryptographic hash functions.</t>
    </section>

    <section title="Rationale">
      <t>Due to security concerns with SHA-1 <xref target="RFC6194"/> and with
      MODP groups with less than 2048 bits <xref target="NIST-SP-800-131Ar1"/>
      we propose the use of the SHA-2 based hashes with DH group14, group15,
      group16, group17 and group18 <xref target="RFC3526"/>. Additionally we
      add support for key exchange based on Elliptic Curve Diffie Hellman with
      NIST P-256, P-384 and P-521 as well as X25519 and X448 curves.
      Following the rationale of <xref target="RFC8268"/> only SHA-256 and
      SHA-512 hashes are used for DH groups. For NIST curves the same
      curve-to-hashing algorithm pairing used in <xref target="RFC5656"/> is
      adopted for consistency.</t>
    </section>

    <section title="Document Conventions">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref target="RFC2119">
      RFC 2119</xref>.</t>
    </section>

    <section title="New Diffie-Hellman Key Exchange methods">
      <t>This document adopts the same naming convention defined in <xref
        target="RFC4462"/> to define families of methods that cover any
        GSS-API mechanism used with a specific Diffie-Hellman group and
        SHA-2 Hash combination.
      </t>
      <texttable>
        <preamble>The following new key exchange algorithms are defined:
        </preamble>
          <ttcol align="left">Key Exchange Method Name</ttcol>
          <ttcol align="left">Implementation Recommendations</ttcol>
          <c>gss-group14-sha256-*</c><c>SHOULD/RECOMMENDED</c>
          <c>gss-group15-sha512-*</c><c>MAY/OPTIONAL</c>
          <c>gss-group16-sha512-*</c><c>SHOULD/RECOMMENDED</c>
          <c>gss-group17-sha512-*</c><c>MAY/OPTIONAL</c>
          <c>gss-group18-sha512-*</c><c>MAY/OPTIONAL</c>
      </texttable>
      <t>Each key exchange method is implicitly registered by this document.
        The IESG is considered to be the owner of all these key exchange
        methods; this does NOT imply that the IESG is considered to be the
        owner of the underlying GSS-API mechanism.
      </t>
      <section title="gss-group14-sha256-*">
        <t>Each of these methods specifies GSS-API-authenticated Diffie-Hellman
        key exchange as described in Section 2.1 of <xref target="RFC4462"/>
        with SHA-256 as HASH, and the group defined in Section 8.2 of <xref
        target="RFC4253"/> The method name for each method is the
        concatenation of the string "gss-group14-sha256-" with the Base64
        encoding of the MD5 hash <xref target="RFC1321"/> of the ASN.1 DER
        encoding <xref target="ISO-IEC-8825-1"/> of the underlying GSS-API
        mechanism's OID. Base64 encoding is described in Section 6.8 of
        <xref target="RFC2045"/>.</t>
      </section>

      <section title="gss-group15-sha512-*">
        <t>Each of these methods specifies GSS-API-authenticated Diffie-Hellman
        key exchange as described in Section 2.1 of <xref target="RFC4462"/>
        with SHA-512 as HASH, and the group defined in Section 4 of <xref
        target="RFC3526"/> The method name for each method is the
        concatenation of the string "gss-group15-sha512-" with the Base64
        encoding of the MD5 hash of the ASN.1 DER encoding of the underlying
        GSS-API mechanism's OID.</t>
      </section>

      <section title="gss-group16-sha512-*">
        <t>Each of these methods specifies GSS-API-authenticated Diffie-Hellman
        key exchange as described in Section 2.1 of <xref target="RFC4462"/>
        with SHA-512 as HASH, and the group defined in Section 5 of <xref
        target="RFC3526"/> The method name for each method is the
        concatenation of the string "gss-group16-sha512-" with the Base64
        encoding of the MD5 hash of the ASN.1 DER encoding of the underlying
        GSS-API mechanism's OID.</t>
      </section>

      <section title="gss-group17-sha512-*">
        <t>Each of these methods specifies GSS-API-authenticated Diffie-Hellman
        key exchange as described in Section 2.1 of <xref target="RFC4462"/>
        with SHA-512 as HASH, and the group defined in Section 6 of <xref
        target="RFC3526"/> The method name for each method is the
        concatenation of the string "gss-group17-sha512-" with the Base64
        encoding of the MD5 hash of the ASN.1 DER encoding of the underlying
        GSS-API mechanism's OID.</t>
      </section>

      <section title="gss-group18-sha512-*">
        <t>Each of these methods specifies GSS-API-authenticated Diffie-Hellman
        key exchange as described in Section 2.1 of <xref target="RFC4462"/>
        with SHA-512 as HASH, and the group defined in Section 7 of <xref
        target="RFC3526"/> The method name for each method is the
        concatenation of the string "gss-group18-sha512-" with the Base64
        encoding of the MD5 hash of the ASN.1 DER encoding of the underlying
        GSS-API mechanism's OID.</t>
      </section>
    </section>

    <section title="New Elliptic Curve Diffie-Hellman Key Exchange methods">
      <t>In <xref target="RFC5656"/> new SSH key exchange algorithms based on
      Elliptic Curve Cryptography are introduced. We reuse much of section 4
      to implement GSS-API-authenticated ECDH Key Exchanges.</t>
      <t>Additionally we utilize also the curves defined in <xref
      target="I-D.ietf-curdle-ssh-curves"/> to complement the 3 classic
      NIST defined curves required by <xref target="RFC5656"/>.</t>

      <section title="Generic GSS-API Key Exchange with ECDH" anchor="gen_gss_ecdh">
        <t>This section reuses much of the scheme defined in Section 2.1 of
        <xref target="RFC4462"/> and combines it with the scheme defined in
        Section 4 of <xref target="RFC5656"/>; in particular, all checks and
        verification steps prescribed in Section 4 of <xref target="RFC5656"/>
        apply here as well.</t>

        <t>The symbols used in this description conform to the symbols used in
        Section 2.1 of <xref target="RFC4462"/>. Additionally, the following
        symbols are defined:</t>
        <t>Q_C is the client ephemeral public key octet string</t>
        <t>Q_S is the server ephemeral public key octet string</t>

        <t>This section defers to <xref target="RFC7546"/> as the source of
        information on GSS-API context establishment operations, Section 3
        being the most relevant. All Security Considerations described in
        <xref target="RFC7546"/> apply here too.</t>

        <t>The Client:</t>
        <t>1. C generates an ephemeral key pair with public key Q_C. It does
            that by:
          <list>
            <t>For NIST curves:
              <list>
                <t>Selecting a value d_C uniformly at random from the interval
                    [1, n-1] where n is the order of generator of the curve
                    associated with the selected key exchange method.</t>
                <t>Performing point multiplication between the curve base point
                    and selected integer d_C to get the public point q_C.</t>
                <t>Converts the point q_C to the Q_C octet string by
                    concatenation of value 0x04 and big-endian representation
                    of the x coordinate and then y coordinate. The coordinate
                    coversion MUST preserve leading zero octets. Thus for
                    nistp521 curve the encoded x coordinate will always have a
                    length of 66 octets while the Q_C representation will be
                    133 octets long. This is the uncompressed representation
                    specified in Section 4.3.6 of
                    <xref target="ANSI-X9-62-2005"/>.</t>
              </list>
            </t>
            <t>For curve25519 and curve448:
                <list>
                    <t>Selecting d_C as 32 uniformly distributed random octets
                        for curve25519 and 56 octets for curve448.</t>
                    <t>Preparing the generator g as the number 9 little-endian
                        encoded in 32 octets for curve25519 and number
                        5 in 56 octets for curve448. This is the same as an
                        octet of value 0x09 followed by 31 zero octets for
                        curve255519 and as an octect of value 0x05 followed by
                        55 zero octets.</t>
                    <t>Calculating Q_C as the result of the call to X25519
                        or X448 function, respectively for curve25519 and
                        curve448 key exchange, with parameters d_C and g.</t>
                </list>
            </t>
          </list>
        </t>
        <t>2. C calls GSS_Init_sec_context(), using the most recent reply
        token received from S during this exchange, if any. For this call,
        the client MUST set mutual_req_flag to "true" to request that mutual
        authentication be performed. It also MUST set integ_req_flag to "true"
        to request that per-message integrity protection be supported for this
        context. In addition, deleg_req_flag MAY be set to "true" to request
        access delegation, if requested by the user. Since the key exchange
        process authenticates only the host, the setting of anon_req_flag is
        immaterial to this process. If the client does not support the
        "gssapi-keyex" user authentication method described in Section 4 of
        <xref target="RFC4462"/>, or does not intend to use that method in
        conjunction with the GSS-API context established during key exchange,
        then anon_req_flag SHOULD be set to "true". Otherwise, this flag MAY
        be set to true if the client wishes to hide its identity. Since the
        key exchange process will involve the exchange of only a single token
        once the context has been established, it is not necessary that the
        GSS-API context support detection of replayed or out-of-sequence
        tokens. Thus, replay_det_req_flag and sequence_req_flag need not be
        set for this process. These flags SHOULD be set to "false".</t>
        <t><list>
          <t>If the resulting major_status code is GSS_S_COMPLETE and the
          mutual_state flag is not true, then mutual authentication has
          not been established, and the key exchange MUST fail.</t>

          <t>If the resulting major_status code is GSS_S_COMPLETE and the
          integ_avail flag is not true, then per-message integrity
          protection is not available, and the key exchange MUST fail.</t>

          <t>If the resulting major_status code is GSS_S_COMPLETE and both
          the mutual_state and integ_avail flags are true, the resulting
          output token is sent to S.</t>

          <t>If the resulting major_status code is GSS_S_CONTINUE_NEEDED,
          the output_token is sent to S, which will reply with a new
          token to be provided to GSS_Init_sec_context().</t>

          <t>The client MUST also include Q_C with the first message it
          sends to the server during this process; if the server
          receives more than one Q_C or none at all, the key exchange
          MUST fail.</t>

          <t>It is an error if the call does not produce a token of non-zero
          length to be sent to the server. In this case, the key exchange
          MUST fail.</t>
        </list></t>

        <t>3. When a Q_C key is received, S verifies that the key is valid.
        If the key is not valid the key exchange MUST fail.</t>
        <t><list>
            <t>The server first checks if the length of the Q_C matches the
                selected key exchange: 65 octets for nistp256, 97 octets for
                nistp384, 133 octets for nistp521, 32 octets for curve25519
                or 56 octets for curve448. If the value does not have matching
                length the key exchange MUST fail.</t>
            <t>In case of key exchanges that use NIST curves, the server MUST
                check if the first octet of the Q_C is equal to 0x04.
                If the octet has different value the key exchange MUST fail.
            </t>
            <t>For NIST curves, the server converts the octet representation of
                the key to q_C point representation by interpreting the first
                half of remaining octets as the unsigned big-endian
                representation of the x coordinate of the point and the second
                half as the unsigned big-endian representation of the y
                coordinate.</t>
            <t>For NIST curves, the server verifies that the q_C is not a point
                at infinity, that both coordinates are in the interval
                [0, p - 1], where p is the prime associated with the curve of
                the selected key exchange and that the point lies on the curve
                (satisfies the curve equation).</t>
            <t>For curve25519, the server verifies that the the high-order
                bit of the last octet is not set - this prevents distinguishing
                attacks between implementations that use Montgomery ladder
                implementation of the curve and ones that use generic
                elliptic-curve libraries. If the bit is set, the key exchange
                SHOULD fail. For curve448 any bit can be set.</t>
            <t>For curve25519 and curve448, the point is not decoded but used
                as is. Q_C and q_C are considered equivalent.</t>
        </list></t>

        <t>4. S calls GSS_Accept_sec_context(), using the token received from
        C.</t>
        <t><list>
          <t>If the resulting major_status code is GSS_S_COMPLETE and the
          mutual_state flag is not true, then mutual authentication has not
          been established, and the key exchange MUST fail.</t>

          <t>If the resulting major_status code is GSS_S_COMPLETE and the
          integ_avail flag is not true, then per-message integrity protection
          is not available, and the key exchange MUST fail.</t>

          <t>If the resulting major_status code is GSS_S_COMPLETE and both
          the mutual_state and integ_avail flags are true, then the security
          context has been established, and processing continues with step
          5.</t>

          <t>If the resulting major_status code is GSS_S_CONTINUE_NEEDED, then
          the output token is sent to C, and processing continues with step
          2.</t>

          <t>If the resulting major_status code is GSS_S_COMPLETE, but a
          non-zero-length reply token is returned, then that token is sent to
          the client.</t>
        </list></t>

        <t>5. S generates an ephemeral key pair with public key Q_S calculated
            the same way it is done in step 1 and peforms
            the following computations:</t>
        <t><list>
          <t>K a shared secret obtained using ECDH key exchange:</t>
          <t>
          <list><t>Both client and server perform the same calculation where
                  d_U is the secret value, d_C for client and d_S for server
                  and q_V is the received public value, q_S for client and q_C
                  for server.</t>
              <t>For NIST curves, the peers perform point multiplication using
                  d_U and q_V to get point P.</t>
              <t>For NIST curves, peers verify that P is not a point at
                  infinity. If P is a point at infinity, the key exchange
                  MUST fail.</t>
              <t>For NIST curves, the shared secret is the zero-padded
                  big-endian representation of the x coordinate of P.</t>
              <t>For curve25519 and curve448, the peers apply the X25519 or
                  X448 function, respectively for curve25519 and curve448,
                  on the d_U and q_V. The result of the function is
                  the shared secret.</t>
              <t>For curve25519 and curve448, if all the octets of the shared
                  secret are zero octets, the key exchange MUST fail.</t>
          </list>
         </t>

          <t>H = hash(V_C || V_S || I_C || I_S || K_S || Q_C || Q_S ||
          K).</t>

          <t>MIC is the GSS-API message integrity code for H computed by
          calling GSS_GetMIC().</t>

          <t>S then sends Q_S and the message integrity code (MIC) to C.</t>
        </list>
        </t>

        <t>6. This step is performed only if the server's final call to
        GSS_Accept_sec_context() produced a non-zero-length final reply
        token to be sent to the client and if no previous call by the
        client to GSS_Init_sec_context() has resulted in a major_status of
        GSS_S_COMPLETE. Under these conditions, the client makes an additional
        call to GSS_Init_sec_context() to process the final reply token.
        This call is made exactly as described above. However, if the
        resulting major_status is anything other than GSS_S_COMPLETE, or a
        non-zero-length token is returned, it is an error and the key exchange
        MUST fail.</t>

        <t>7. C verifies that the key Q_S is valid the same way it is done
        in step 3. If the key is not valid the key exchange MUST fail.</t>

        <t>8. C computes the shared secret K and H and verifies that it is
        valid the same way it is done in step 5. It then calls
        GSS_VerifyMIC() to check that the MIC sent by S verifies H's
        integrity. If the MIC is not successfully verified, the key exchange
        MUST fail.</t>

        <t>If any GSS_Init_sec_context() or GSS_Accept_sec_context() returns
        a major_status other than GSS_S_COMPLETE or GSS_S_CONTINUE_NEEDED, or
        any other GSS-API call returns a major_status other than
        GSS_S_COMPLETE, the key exchange MUST fail. The same recommendations
        expressed in Section 2.1 of <xref target="RFC4462"/> are followed with
        regards to error reporting.</t>

        <t>This exchange is implemented with the following messages:</t>
        <figure>
          <preamble>The client sends:</preamble>
          <artwork>
    byte      SSH_MSG_KEXGSS_INIT
    string    output_token (from GSS_Init_sec_context())
    string    Q_C, client's ephemeral public key octet string
          </artwork>
        </figure>
        <figure>
          <preamble>The server may responds with:</preamble>
          <artwork>
    byte      SSH_MSG_KEXGSS_HOSTKEY
    string    server public host key and certificates (K_S)
          </artwork>
        </figure>
        <t>Since this key exchange method does not require the host key to be
        used for any encryption operations, this message is OPTIONAL. If the
        "null" host key algorithm described in Section 5 of <xref
        target="RFC4462"/> is used, this message MUST NOT be sent.</t>
        <t>Each time the server's call to GSS_Accept_sec_context() returns a
        major_status code of GSS_S_CONTINUE_NEEDED</t>
        <figure>
          <preamble>The server replies:</preamble>
          <artwork>
    byte      SSH_MSG_KEXGSS_CONTINUE
    string    output_token (from GSS_Accept_sec_context())
          </artwork>
        </figure>
        <t>If the client receives this message after a call to
        GSS_Init_sec_context() has returned a major_status code of
        GSS_S_COMPLETE, a protocol error has occurred and the key exchange
        MUST fail.</t>
        <t>Each time the client receives the message described above, it
        makes another call to GSS_Init_sec_context().</t>
        <figure>
          <preamble>The client sends:</preamble>
          <artwork>
    byte      SSH_MSG_KEXGSS_CONTINUE
    string    output_token (from GSS_Init_sec_context())
          </artwork>
        </figure>
        <t>The server and client continue to trade these two messages as
        long as the server's calls to GSS_Accept_sec_context() result in
        major_status codes of GSS_S_CONTINUE_NEEDED. When a call results in
        a major_status code of GSS_S_COMPLETE, it sends one of two final
        messages.</t>
        <t>If the server's final call to GSS_Accept_sec_context() (resulting
        in a major_status code of GSS_S_COMPLETE) returns a non-zero-length
        token to be sent to the client, it sends the following:</t>
        <figure>
          <artwork>
    byte      SSH_MSG_KEXGSS_COMPLETE
    string    Q_S, server's ephemeral public key octet string
    string    mic_token (MIC of H)
    boolean   TRUE
    string    output_token (from GSS_Accept_sec_context())
          </artwork>
        </figure>
        <t>If the client receives this message after a call to
        GSS_Init_sec_context() has returned a major_status code of
        GSS_S_COMPLETE, a protocol error has occurred and the key exchange
        MUST fail.</t>
        <t>If the server's final call to GSS_Accept_sec_context() (resulting
        in a major_status code of GSS_S_COMPLETE) returns a zero-length token
        or no token at all, it sends the following:</t>
        <figure>
          <artwork>
    byte      SSH_MSG_KEXGSS_COMPLETE
    string    Q_S, server's ephemeral public key octet string
    string    mic_token (MIC of H)
    boolean   FALSE
          </artwork>
        </figure>
        <t>If the client receives this message when no call to
        GSS_Init_sec_context() has yet resulted in a major_status code of
        GSS_S_COMPLETE, a protocol error has occurred and the key exchange
        MUST fail.</t>
        <t>In case of errors the messages described in Section 2.1 of
        <xref target="RFC4462"/> are used as well as the recommendation about
        the messages' order.</t>
        <figure>
          <preamble>The hash H is computed as the HASH hash of the
          concatenation of the following:</preamble>
          <artwork>
    string    V_C, the client's version string (CR, NL excluded)
    string    V_S, server's version string (CR, NL excluded)
    string    I_C, payload of the client's SSH_MSG_KEXINIT
    string    I_S, payload of the server's SSH_MSG_KEXINIT
    string    K_S, server's public host key
    string    Q_C, client's ephemeral public key octet string
    string    Q_S, server's ephemeral public key octet string
    mpint     K,   shared secret
          </artwork>
        </figure>

        <t>This value is called the exchange hash, and it is used to
        authenticate the key exchange. The exchange hash SHOULD be kept
        secret. If no SSH_MSG_KEXGSS_HOSTKEY message has been sent by the
        server or received by the client, then the empty string is used in
        place of K_S when computing the exchange hash.</t>

        <t>The GSS_GetMIC call MUST be applied over H, not the original
        data.</t>
      </section>

      <section title="ECDH Key Exchange Methods">
      <texttable>
        <preamble>The following new key exchange methods are defined:
        </preamble>
          <ttcol align="left">Key Exchange Method Name</ttcol>
          <ttcol align="left">Implementation Recommendations</ttcol>
          <c>gss-nistp256-sha256-*</c><c>SHOULD/RECOMMENDED</c>
          <c>gss-nistp384-sha384-*</c><c>MAY/OPTIONAL</c>
          <c>gss-nistp521-sha512-*</c><c>MAY/OPTIONAL</c>
          <c>gss-curve25519-sha256-*</c><c>SHOULD/RECOMMENDED</c>
          <c>gss-curve448-sha512-*</c><c>MAY/OPTIONAL</c>
      </texttable>
      <t>Each key exchange method is implicitly registered by this document.
        The IESG is considered to be the owner of all these key exchange
        methods; this does NOT imply that the IESG is considered to be the
        owner of the underlying GSS-API mechanism.</t>
        <section title="gss-nistp256-sha256-*">
            <t>Each of these methods specifies GSS-API-authenticated Elliptic
                Curve Diffie-Hellman key exchange as described in
                <xref target="gen_gss_ecdh"/>
                of this document with SHA-256 as HASH, and the curve and base
                point defined in section 2.4.2 of <xref target="SEC2v2"/> as
                secp256r1. The method name for each method is the concatenation
                of the string "gss-nistp256-sha256-" with the Base64 encoding
                of the MD5 hash <xref target="RFC1321"/> of the ASN.1 DER
                encoding <xref target="ISO-IEC-8825-1"/> of the underlying
                GSS-API mechanism's OID. Base64 encoding is described in
                Section 6.8 of <xref target="RFC2045"/>.</t>
        </section>

        <section title="gss-nistp384-sha384-*">
            <t>Each of these methods specifies GSS-API-authenticated Elliptic
                Curve Diffie-Hellman key exchange as described in
                <xref target="gen_gss_ecdh"/>
                of this document with SHA-384 as HASH, and the curve and base
                point defined in section 2.5.1 of <xref target="SEC2v2"/> as
                secp384r1. The method name for each method is the concatenation
                of the string "gss-nistp384-sha384-" with the Base64 encoding
                of the MD5 hash <xref target="RFC1321"/> of the ASN.1 DER
                encoding <xref target="ISO-IEC-8825-1"/> of the underlying
                GSS-API mechanism's OID. Base64 encoding is described in
                Section 6.8 of <xref target="RFC2045"/>.</t>
        </section>

        <section title="gss-nistp521-sha512-*">
            <t>Each of these methods specifies GSS-API-authenticated Elliptic
                Curve Diffie-Hellman key exchange as described in
                <xref target="gen_gss_ecdh"/>
                of this document with SHA-512 as HASH, and the curve and base
                point defined in section 2.6.1 of <xref target="SEC2v2"/> as
                secp521r1. The method name for each method is the concatenation
                of the string "gss-nistp521-sha512-" with the Base64 encoding
                of the MD5 hash <xref target="RFC1321"/> of the ASN.1 DER
                encoding <xref target="ISO-IEC-8825-1"/> of the underlying
                GSS-API mechanism's OID. Base64 encoding is described in
                Section 6.8 of <xref target="RFC2045"/>.</t>
        </section>

        <section title="gss-curve25519-sha256-*">
            <t>Each of these methods specifies GSS-API-authenticated Elliptic
                Curve Diffie-Hellman key exchange as described in
                <xref target="gen_gss_ecdh"/>
                of this document with SHA-256 as HASH, and the X25519 function
                defined in section 5 of <xref target="RFC7748"/>. The method
                name for each method is the concatenation
                of the string "gss-curve25519-sha256-" with the Base64 encoding
                of the MD5 hash <xref target="RFC1321"/> of the ASN.1 DER
                encoding <xref target="ISO-IEC-8825-1"/> of the underlying
                GSS-API mechanism's OID. Base64 encoding is described in
                Section 6.8 of <xref target="RFC2045"/>.</t>
        </section>

        <section title="gss-curve448-sha512-*">
            <t>Each of these methods specifies GSS-API-authenticated Elliptic
                Curve Diffie-Hellman key exchange as described in
                <xref target="gen_gss_ecdh"/>
                of this document with SHA-512 as HASH, and the X448 function
                defined in section 5 of <xref target="RFC7748"/>. The method
                name for each method is the concatenation
                of the string "gss-curve448-sha512-" with the Base64 encoding
                of the MD5 hash <xref target="RFC1321"/> of the ASN.1 DER
                encoding <xref target="ISO-IEC-8825-1"/> of the underlying
                GSS-API mechanism's OID. Base64 encoding is described in
                Section 6.8 of <xref target="RFC2045"/>.</t>
        </section>
      </section>
    </section>

    <section title="IANA Considerations">
      <t>This document augments the SSH Key Exchange Method Names in <xref
      target="RFC4462"/>.</t>
      <texttable>
        <preamble>IANA is requested to update the SSH
        algorithm registry with the following entries:</preamble>
          <ttcol align="left">Key Exchange Method Name</ttcol>
          <ttcol align="left">Reference</ttcol>
          <ttcol align="left">Implementation Support</ttcol>
          <c>gss-group14-sha256-*</c><c>This draft</c><c>SHOULD</c>
          <c>gss-group15-sha512-*</c><c>This draft</c><c>MAY</c>
          <c>gss-group16-sha512-*</c><c>This draft</c><c>SHOULD</c>
          <c>gss-group17-sha512-*</c><c>This draft</c><c>MAY</c>
          <c>gss-group18-sha512-*</c><c>This draft</c><c>MAY</c>
          <c>gss-nistp256-sha256-*</c><c>This draft</c><c>SHOULD</c>
          <c>gss-nistp384-sha384-*</c><c>This draft</c><c>MAY</c>
          <c>gss-nistp521-sha512-*</c><c>This draft</c><c>MAY</c>
          <c>gss-curve25519-sha256-*</c><c>This draft</c><c>SHOULD</c>
          <c>gss-curve448-sha512-*</c><c>This draft</c><c>MAY</c>
      </texttable>
    </section>

    <section title="Security Considerations">
      <section title="New Finite Field DH mechanisms">
        <t>Except for the use of a different secure hash function and larger
        DH groups, no significant changes has been made to the protocol
        described by <xref target="RFC4462"/>; therefore all the original
        Security Considerations apply.</t>
      </section>
      <section title="New Elliptic Curve DH mechanisms">
        <t>Although a new cryptographic primitive is used with these methods
        the actual key exchange closely follows the key exchange defined in
        <xref target="RFC5656"/>; therefore all the original Security
        Considerations as well as those expressed in <xref target="RFC5656"/>
        apply.</t>
      </section>
      <section title="GSSAPI Delegation">
        <t>Some GSSAPI mechanisms can optionally delegate credentials to the
        target host by setting the deleg_ret_flag. In this case extra care
        must be taken to ensure that the acceptor being authenticated matches
        the target the user intended. Some mechanisms implementations (like
        commonly used krb5 libraries) may use insecure DNS resolution to
        canonicalize the target name; in these cases spoofing a DNS response
        that points to an attacker-controlled machine may results in the user
        silently delegating credentials to the attacker, who can then
        impersonate the user at will.</t>
      </section>
    </section>

  </middle>

  <back>
<?rfc rfcedstyle="no"?>
    <references title="Normative References">

      &RFC1321;
      &RFC2045;

      <!--DH GROUPS-->

      &RFC3526;

      <!-- SSH Transport -->

      &RFC4253;

      <!--SSH GSS-API Methods-->

      &RFC4462;

      <!-- SSH ECC Algorithms -->

      &RFC5656;

      &RFC7546;

      &SSHCURVES;

      &RFC7748;

      <!--Key words for use in RFCs to Indicate Requirement Levels-->

      &RFC2119;

      <!--ECC specifications-->

      <reference
          anchor="ANSI-X9-62-2005">
          <front>
              <title>Public Key Cryptography for the Financial Services
                  Industry, The Elliptic Curve Digital Signature Algorithm
                  (ECDSA)</title>
              <author>
                  <organization abbrev="ANSI">American National Standards
                      Institute
                  </organization>
              </author>
              <date year="2005"/>
          </front>
          <seriesInfo
              name="ANSI Standard"
              value="X9.62"/>
      </reference>

      <reference
          anchor="SEC2v2">
          <front>
              <title>SEC 2: Recommended Elliptic Curve Domain Parameters</title>
              <author>
                  <organization>Certicom Research</organization>
              </author>
              <date year="2010"/>
          </front>
          <seriesInfo
              name="Standards for Efficient Cryptography"
              value="SEC 2"/>
      </reference>
    </references>

    <references title="Informative References">

      &RFC6194;

      &RFC8268;

      <!--SHA-2-->

      <reference
          anchor="ISO-IEC-8825-1"
          target="http://standards.iso.org/ittf/PubliclyAvailableStandards/c068345_ISO_IEC_8825-1_2015.zip">
        <front>
          <title>ASN.1 encoding rules: Specification of Basic Encoding Rules
          (BER), Canonical Encoding Rules (CER) and Distinguished Encoding
          Rules (DER)</title>
          <author>
            <organization>International Organization for Standardization /
            International Electrotechnical Commission</organization>
          </author>
          <date day="15" month="November" year="2015"/>
        </front>
        <seriesInfo name="ISO/IEC" value="8825-1"/>
      </reference>

      <reference
          anchor="NIST-SP-800-131Ar1"
          target="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar1.pdf">
        <front>
          <title>Transitions: Recommendation for Transitioning of
          the Use of Cryptographic Algorithms and Key Lengths</title>
          <author>
            <organization
                abbrev="NIST">National Institute of Standards and Technology
            </organization>
          </author>
          <date month="November" year="2015"/>
        </front>
        <seriesInfo
            name="NIST Special Publication"
            value="800-131A Revision 1"/>
       </reference>
    </references>

  </back>
</rfc>
