draft-ietf-secsh-gsskeyex-01.txt   draft-ietf-secsh-gsskeyex-02.txt 
Network Working Group J. Hutzelman Network Working Group J. Hutzelman
Internet-Draft CMU Internet-Draft CMU
Expires: August 31, 2001 J. Salowey Expires: January 18, 2002 J. Salowey
Cisco Systems Cisco Systems
March 2, 2001 J. Galbraith
Van Dyke Technologies, Inc.
V. Welch
U Chicago / ANL
July 20, 2001
Using GSSAPI authentication for key exchange in Secure Shell GSSAPI Authentication and Key Exchange for the Secure Shell Protocol
draft-ietf-secsh-gsskeyex-01 draft-ietf-secsh-gsskeyex-02
Status of this Memo Status of this Memo
This document is an Internet-Draft and is in full conformance with This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC2026. all provisions of Section 10 of RFC2026.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as other groups may also distribute working documents as
Internet-Drafts. Internet-Drafts.
skipping to change at page 1, line 33 skipping to change at page 1, line 37
months and may be updated, replaced, or obsoleted by other documents months and may be updated, replaced, or obsoleted by other documents
at any time. It is inappropriate to use Internet-Drafts as reference at any time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on August 31, 2001. This Internet-Draft will expire on January 18, 2002.
Copyright Notice Copyright Notice
Copyright (C) The Internet Society (2001). All Rights Reserved. Copyright (C) The Internet Society (2001). All Rights Reserved.
Abstract Abstract
This memo describes a method for using the Generic Security Service The Secure Shell protocol (SSH) is a protocol for secure remote
Application Program Interface [2] for key exchange in the Secure login and other secure network services over an insecure network.
Shell protocol, by defining a class of SSH key exchange methods
which use GSSAPI to authenticate the Diffie-Hellman exchange The Generic Security Service Application Program Interface (GSS-API)
described in [10]. [2] provides security services to callers in a mechanism-independent
fashion.
This memo describes methods for using the GSS-API for authentication
and key exchange in SSH. It defines an SSH user authentication
method which uses a specified GSSAPI mechanism to authenticate a
user, and a family of SSH key exchange methods which use GSSAPI to
authenticate the Diffie-Hellman exchange described in [11].
This memo also defines a new host public key algorithm which can be This memo also defines a new host public key algorithm which can be
used when no operations are needed using a host's public key, and a used when no operations are needed using a host's public key, and a
new user authentication method which allows an authorization name to new user authentication method which allows an authorization name to
be used in conjunction with any authentication which has already be used in conjunction with any authentication which has already
occurred as a side-effect of key exchange. occurred as a side-effect of key exchange.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [7]. document are to be interpreted as described in [7].
1. GSSAPI Authenticated Diffie-Hellman Key Exchange 1. Introduction
This document describes the methods used to perform key exchange and
user authentication in the Secure Shell protocol using the GSSAPI.
To do this, it defines a family of key exchange methods, two user
authentication methods, and a new host key algorithm. These
definitions allow any GSSAPI mechanism to be used with the Secure
Shell protocol.
This document should be read only after reading the documents
describing the SSH protocol architecture [9], transport layer
protocol [11], and user authentication protocol [12]. This document
freely uses terminology and notation from the architecture document
without reference or further explanation.
1.1 SSH terminology
The data types used in the packets are defined in the SSH
architecture document [9]. It is particularly important to note the
definition of string allows binary content.
The SSH_MSG_USERAUTH_REQUEST packet refers to a service; this
service name is an SSH service name, and has no relationship to
GSSAPI service names. Currently, the only defined service name is
"ssh-connection", which refers to the SSH connection protocol [10].
2. GSSAPI Authenticated Diffie-Hellman Key Exchange
This section defines a class of key exchange methods which combine This section defines a class of key exchange methods which combine
the Diffie-Hellman key exchange from section 6 of [10] with mutual the Diffie-Hellman key exchange from section 6 of [11] with mutual
authentication using GSSAPI. authentication using GSSAPI.
Since the GSSAPI key exchange methods described in this section do Since the GSSAPI key exchange methods described in this section do
not require the use of public key signature or encryption not require the use of public key signature or encryption
algorithms, they MAY be used with any host key algorithm, including algorithms, they MAY be used with any host key algorithm, including
the "null" algorithm described in section 2 of this document. the "null" algorithm described in Section 5.
1.1 Generic method description 2.1 Generic method description
The following symbols are used in this description: The following symbols are used in this description:
o C is the client, and S is the server o C is the client, and S is the server
o p is a large safe prime, g is a generator for a subgroup of o p is a large safe prime, g is a generator for a subgroup of
GF(p), and q is the order of the subgroup GF(p), and q is the order of the subgroup
o V_S is S's version string, and V_C is C's version string o V_S is S's version string, and V_C is C's version string
skipping to change at page 3, line 43 skipping to change at page 4, line 43
received from S during this exchange, if any. For this call, received from S during this exchange, if any. For this call,
the client MUST set the mutual_req_flag to "true" to request the client MUST set the mutual_req_flag to "true" to request
that mutual authentication be performed. It also MUST set the that mutual authentication be performed. It also MUST set the
integ_req_flag to "true" to request that per-message integrity integ_req_flag to "true" to request that per-message integrity
protection be supported for this context. In addition, the protection be supported for this context. In addition, the
deleg_req_flag MAY be set to "true" to request access deleg_req_flag MAY be set to "true" to request access
delegation, if requested by the user. Since the key exchange delegation, if requested by the user. Since the key exchange
process authenticates only the host, the setting of the process authenticates only the host, the setting of the
anon_req_flag is immaterial to this process. If the client does anon_req_flag is immaterial to this process. If the client does
not support the "external-keyx" user authentication method not support the "external-keyx" user authentication method
described in section 3 of this document, or does not intend to described in Section 4, or does not intend to use that method,
use that method, then the anon_req_flag SHOULD be set to "true". then the anon_req_flag SHOULD be set to "true". Otherwise, this
Otherwise, this flag MAY be set to true if the client wishes to flag MAY be set to true if the client wishes to hide its
hide its identity. identity.
* If the resulting major_status code is GSS_S_COMPLETE and the * If the resulting major_status code is GSS_S_COMPLETE and the
mutual_state flag is not true, then mutual authentication has mutual_state flag is not true, then mutual authentication has
not been established, and the key exchange MUST fail. not been established, and the key exchange MUST fail.
* If the resulting major_status code is GSS_S_COMPLETE and the * If the resulting major_status code is GSS_S_COMPLETE and the
integ_avail flag is not true, then per-message integrity integ_avail flag is not true, then per-message integrity
protection is not available, and the key exchange MUST fail. protection is not available, and the key exchange MUST fail.
* If the resulting major_status code is GSS_S_COMPLETE and the * If the resulting major_status code is GSS_S_COMPLETE and the
skipping to change at page 4, line 43 skipping to change at page 5, line 43
* If the resulting major_status code is GSS_S_CONTINUE_NEEDED, * If the resulting major_status code is GSS_S_CONTINUE_NEEDED,
then the output token is sent to C, and processing continues then the output token is sent to C, and processing continues
with step 2. with step 2.
* If the resulting major_status code is GSS_S_COMPLETE, but a * If the resulting major_status code is GSS_S_COMPLETE, but a
non-zero-length reply token is returned, then that token is non-zero-length reply token is returned, then that token is
sent to the client. sent to the client.
4. S generates a random number y (0 < y < q) and computes f = g^y 4. S generates a random number y (0 < y < q) and computes f = g^y
mod p. It computes K = e ^ y mod p, and H = hash(V_C || V_S || mod p. It computes K = e ^ y mod p, and H = hash(V_C || V_S ||
I_C || I_S || e || f || K). It then calls GSS_GetMIC to obtain I_C || I_S || K_S || e || f || K). It then calls GSS_GetMIC to
a GSSAPI message integrity code for H. S then sends f and the obtain a GSSAPI message integrity code for H. S then sends f
MIC to C. and the MIC to C.
5. This step is performed only if the server's final call to 5. This step is performed only if the server's final call to
GSS_Accept_sec_context produced a non-zero-length final reply GSS_Accept_sec_context produced a non-zero-length final reply
token to be sent to the client _and_ no previous call by the token to be sent to the client _and_ no previous call by the
client to GSS_Init_sec_context has resulted in a major_status of client to GSS_Init_sec_context has resulted in a major_status of
GSS_S_COMPLETE. Under these conditions, the client makes an GSS_S_COMPLETE. Under these conditions, the client makes an
additional call to GSS_Init_sec_context to process the final additional call to GSS_Init_sec_context to process the final
reply token. This call is made exactly as described above. reply token. This call is made exactly as described above.
However, if the resulting major_status is anything other than However, if the resulting major_status is anything other than
GSS_S_COMPLETE, or a non-zero-length token is returned, it is an GSS_S_COMPLETE, or a non-zero-length token is returned, it is an
error and the key exchange MUST fail. error and the key exchange MUST fail.
6. C computes K = f^x mod p, and H = hash(V_C || V_S || I_C || I_S 6. C computes K = f^x mod p, and H = hash(V_C || V_S || I_C || I_S
|| e || f || K). It then calls GSS_VerifyMIC to verify that the || K_S || e || f || K). It then calls GSS_VerifyMIC to verify
MIC sent by S matches H. that the MIC sent by S matches H.
Either side MUST NOT send or accept e or f values that are not in Either side MUST NOT send or accept e or f values that are not in
the range [1, p-1]. If this condition is violated, the key exchange the range [1, p-1]. If this condition is violated, the key exchange
fails. fails.
If any call to GSS_Init_sec_context or GSS_Accept_sec_context If any call to GSS_Init_sec_context or GSS_Accept_sec_context
returns a major_status other than GSS_S_COMPLETE or returns a major_status other than GSS_S_COMPLETE or
GSS_S_CONTINUE_NEEDED, or any other GSSAPI call returns a GSS_S_CONTINUE_NEEDED, or any other GSSAPI call returns a
major_status other than GSS_S_COMPLETE, the key exchange fails. major_status other than GSS_S_COMPLETE, the key exchange fails.
This is implemented with the following messages. The hash algorithm This is implemented with the following messages. The hash algorithm
for computing the exchange hash is defined by the method name, and for computing the exchange hash is defined by the method name, and
is called HASH. The group used for Diffie-Hellman key exchange and is called HASH. The group used for Diffie-Hellman key exchange and
the underlying GSSAPI mechanism are also defined by the method name. the underlying GSSAPI mechanism are also defined by the method name.
After the client's first call to GSS_Init_sec_context, it sends the After the client's first call to GSS_Init_sec_context, it sends the
following: following:
byte SSH_MSG_GSSAPI_INIT byte SSH_MSG_KEXGSS_INIT
boolean TRUE
string output_token (from GSS_Init_sec_context) string output_token (from GSS_Init_sec_context)
mpint e mpint e
Upon receiving the SSH_MSG_KEXGSS_INIT message, the server MAY send
the following message, prior to any other messages, to inform the
client of its host key.
byte SSH_MSG_KEXGSS_HOSTKEY
string server public host key and certificates (K_S)
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 is used, this
message MUST NOT be sent.
Each time the server's call to GSS_Accept_sec_context returns a Each time the server's call to GSS_Accept_sec_context returns a
major_status code of GSS_S_CONTINUE_NEEDED, it sends the following major_status code of GSS_S_CONTINUE_NEEDED, it sends the following
reply to the client: reply to the client:
byte SSH_MSG_GSSAPI_CONTINUE byte SSH_MSG_KEXGSS_CONTINUE
string output_token (from GSS_Accept_sec_context) string output_token (from GSS_Accept_sec_context)
If the client receives this message appears after a call to If the client receives this message appears after a call to
GSS_Init_sec_context has returned a major_status code of GSS_Init_sec_context has returned a major_status code of
GSS_S_COMPLETE, a protocol error has occurred and the key exchange GSS_S_COMPLETE, a protocol error has occurred and the key exchange
MUST fail. MUST fail.
Each time the client receives the message described above, it makes Each time the client receives the message described above, it makes
another call to GSS_Init_sec_context. It then sends the following: another call to GSS_Init_sec_context. It then sends the following:
byte SSH_MSG_GSSAPI_INIT byte SSH_MSG_KEXGSS_CONTINUE
boolean FALSE
string output_token (from GSS_Init_sec_context) string output_token (from GSS_Init_sec_context)
The server and client continue to trade these two messages as long The server and client continue to trade these two messages as long
as the server's calls to GSS_Accept_sec_context result in 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 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 a major_status code of GSS_S_COMPLETE, it sends one of two final
messages. messages.
If the server's final call to GSS_Accept_sec_contents (resulting in If the server's final call to GSS_Accept_sec_context (resulting in a
a major_status code of GSS_S_COMPLETE) returns a non-zero-length major_status code of GSS_S_COMPLETE) returns a non-zero-length token
token to be sent to the client, it sends the following: to be sent to the client, it sends the following:
byte SSH_MSG_GSSAPI_COMPLETE byte SSH_MSG_KEXGSS_COMPLETE
mpint f mpint f
string per_msg_token (MIC of H) string per_msg_token (MIC of H)
boolean TRUE boolean TRUE
string output_token (from GSS_Accept_sec_context) string output_token (from GSS_Accept_sec_context)
If the client receives this message appears after a call to If the client receives this message appears after a call to
GSS_Init_sec_context has returned a major_status code of GSS_Init_sec_context has returned a major_status code of
GSS_S_COMPLETE, a protocol error has occurred and the key exchange GSS_S_COMPLETE, a protocol error has occurred and the key exchange
MUST fail. MUST fail.
If the server's final call to GSS_Accept_sec_contents (resulting in If the server's final call to GSS_Accept_sec_context (resulting in a
a major_status code of GSS_S_COMPLETE) returns a zero-length token major_status code of GSS_S_COMPLETE) returns a zero-length token or
or no token at all, it sends the following: no token at all, it sends the following:
byte SSH_MSG_GSSAPI_COMPLETE byte SSH_MSG_KEXGSS_COMPLETE
mpint f mpint f
string per_msg_token (MIC of H) string per_msg_token (MIC of H)
boolean FALSE boolean FALSE
If the client receives this message when no call to If the client receives this message when no call to
GSS_Init_sec_context has yet resulted in a major_status code of 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 GSS_S_COMPLETE, a protocol error has occurred and the key exchange
MUST fail. MUST fail.
The hash H is computed as the HASH hash of the concatenation of the The hash H is computed as the HASH hash of the concatenation of the
following: following:
string V_C, the client's version string (CR and NL excluded) string V_C, the client's version string (CR and NL excluded)
string V_S, the server's version string (CR and NL excluded) string V_S, the server's version string (CR and NL excluded)
string I_C, the payload of the client's SSH_MSG_KEXINIT string I_C, the payload of the client's SSH_MSG_KEXINIT
string I_S, the payload of the server's SSH_MSG_KEXINIT string I_S, the payload of the server's SSH_MSG_KEXINIT
string K_S, the host key
mpint e, exchange value sent by the client mpint e, exchange value sent by the client
mpint f, exchange value sent by the server mpint f, exchange value sent by the server
mpint K, the shared secret mpint K, the shared secret
This value is called the exchange hash, and it is used to This value is called the exchange hash, and it is used to
authenticate the key exchange. The exchange hash SHOULD be kept authenticate the key exchange. The exchange hash SHOULD be kept
secret. secret. If no SSH_MSG_KEXGSS_HOSTKEY message has been send by the
client or received by the server, then the empty string is used in
place of K_S when computing the exchange hash.
The GSS_GetMIC call MUST be applied over H, not the original data. The GSS_GetMIC call MUST be applied over H, not the original data.
1.2 gss-group1-sha1-* 2.2 gss-group1-sha1-*
Each of these methods specifies GSSAPI authenticated Diffie-Hellman Each of these methods specifies GSSAPI authenticated Diffie-Hellman
key exchange as described in section 1.1 of this document, with key exchange as described in Section 2.1 with SHA-1 as HASH, and the
SHA-1 as HASH, and the group defined in section 6.1 of [10]. The group defined in section 6.1 of [11]. The method name for each
method name for each method is the concatenation of the string method is the concatenation of the string "gss-group1-sha1-" with
"gss-group1-sha1-" with the Base64 encoding of the MD5 hash [5] of the Base64 encoding of the MD5 hash [5] of the ASN.1 DER encoding
the ASN.1 DER encoding [1] of the underlying GSSAPI mechanism's OID. [1] of the underlying GSSAPI mechanism's OID. Base64 encoding is
Base64 encoding is described in section 6.8 of [6]. described in section 6.8 of [6].
Each and every such key exchange method is implicitly registered by Each and every such key exchange method is implicitly registered by
this specification. The IESG is considered to be the owner of all this specification. The IESG is considered to be the owner of all
such key exchange methods; this does NOT imply that the IESG is such key exchange methods; this does NOT imply that the IESG is
considered to be the owner of the underlying GSSAPI mechanism. considered to be the owner of the underlying GSSAPI mechanism.
1.3 Other GSSAPI key exchange methods 2.3 Other GSSAPI key exchange methods
Key exchange method names starting with "gss-" are reserved for key Key exchange method names starting with "gss-" are reserved for key
exchange methods which conform to this document; in particular, for exchange methods which conform to this document; in particular, for
those methods which use the GSSAPI authenticated Diffie-Hellman key those methods which use the GSSAPI authenticated Diffie-Hellman key
exchange algorithm described in section 1.1 of this document, exchange algorithm described in Section 2.1, including any future
including any future methods which use different groups and/or hash methods which use different groups and/or hash functions. The
functions. The intent is that the names for any such future methods intent is that the names for any such future methods methods be
methods be defined in a similar manner to that used in section 1.2 defined in a similar manner to that used in Section 2.2.
of this document.
1.4 SPNEGO 3. GSSAPI User Authentication
The use of the Simple and Protected GSS-API Negotiation Mechanism This section describes a general-purpose user authentication method
[8] in conjunction with the key exchange methods described in this based on [2]. It is intended to be run over the SSH user
document is both unnecessary and undesirable. As a result, key authentication protocol [12].
exchange mechanisms conforming to this document MUST NOT use SPNEGO
as the underlying GSSAPI mechanism.
Since SSH performs its own negotiation of key exchange methods, and The authentication method name for this protocol is "gssapi".
there exists a separate method name corresponding to every possible
underlying GSSAPI mechanism, the negotiation capability of SPNEGO
alone does not provide any added benefit. In fact, as described
below, it has the potential to result in the use of a weaker method
than desired.
Normally, SPNEGO provides the added benefit of protecting the GSSAPI 3.1 GSSAPI Authentication Overview
mechanism negotiation. It does this by having the server compute a
MIC of the list of mechanisms proposed by the client, and then
checking that value at the client. The key exchange methods
described in this document already perform an equivalent operation;
namely, they generate a MIC of the SSH exchange hash, which is a
hash of several items including the lists of key exchange mechanisms
supported by both sides. Thus, the extra level of protection
offered by SPNEGO is unnecessary in this case.
The use of SPNEGO combined with GSSAPI mechanisms used without GSSAPI authentication must maintain a context. Authentication
SPNEGO can lead to interoperability problems. For example, a client begins when the client sends a SSH_MSG_USERAUTH_REQUEST, which
which supports key exchange using the Kerberos V5 GSSAPI mechanism specifies the mechanism OIDs the client supports.
[4] only underneath SPNEGO will not interoperate with a server which
supports key exchange only using the Kerberos V5 GSSAPI mechanism
directly. As a result, allowing GSSAPI mechanisms to be used both
with and without SPNEGO is undesirable.
If a client's policy is to first prefer GSSAPI-based key exchange If the server supports any of the requested mechanism OIDs, the
method X, then non-GSSAPI method Y, then GSSAPI-based method Z, and server sends a SSH_MSG_USERAUTH_GSSAPI_RESPONSE message containing
if a server supports mechanisms Y and Z but not X, then an attempt the mechanism OID.
to use SPNEGO to negotiate a GSSAPI mechanism might result in the
use of method Z when method Y would have been preferable. As a
result, the use of SPNEGO could result in the subversion of the
negotiation algorithm for key exchange methods as described in
section 5.1 of [10].
1.5 Naming Conventions After the client receives SSH_MSG_USERAUTH_GSSAPI_RESPONSE, the
client and server exchange SSH_MSG_USERAUTH_GSSAPI_TOKEN packets
until the authentication mechanism either succeeds or fails.
In order to establish a GSSAPI security context, the SSH client If at any time during the exchange, the client sends a new
needs to determine the appropriate targ_name to use in identifying SSH_MSG_USERAUTH_REQUEST packet, the GSSAPI context is completely
the server when calling GSS_Init_sec_context. For this purpose, the discarded and destroyed, and any further GSSAPI authentication MUST
GSSAPI mechanism-independent name form for host-based services is restart from the beginning.
used, as described in section 4.1 of [2].
In particular, the targ_name to pass to GSS_Init_sec_context is 3.2 Initiating GSSAPI authentication
obtained by calling GSS_Import_name with an input_name_type of
GSS_C_NT_HOSTBASED_SERVICE, and an input_name_string consisting of
the string "host@" concatenated with the hostname of the SSH server.
1.6 Channel Bindings The GSSAPI authentication method is initiated when the client sends
a SSH_MSG_USERAUTH_REQUEST:
This document recommends that channel bindings SHOULD NOT be byte SSH_MSG_USERAUTH_REQUEST
specified in the calls during context establishment. This document string user name (in ISO-10646 UTF-8 encoding)
does not specify any standard data to be used as channel bindings string service name (in US-ASCII)
and the use of network addresses as channel bindings may break SSH string "gssapi" (US-ASCII method name)
in environments where it is most useful. uint32 n, the number of mechanism OIDs client supports
string[n] mechanism OIDs
2. Null Host Key Algorithm Mechanism OIDs are encoded according to the ASN.1 basic encoding
rules (BER), as described in [1] and in section 3.1 of [2]. The
mechanism OIDs MUST be listed in order of preference, and the server
must choose the first mechanism OID on the list that it supports.
The client SHOULD NOT send more then one gssapi mechanism OID unless
there are no non-GSSAPI authentication methods between the GSSAPI
mechanisms in the order of preference, otherwise, authentication
methods may be executed out of order.
If the server does not support any of the specified OIDs, the server
MUST fail the request by sending a SSH_MSG_USERAUTH_FAILURE packet.
The user name may be an empty string if it can be deduced from the
results of the gssapi authentication. If the user name is not
empty, and the requested user does not exist, the server MAY
disconnect, or MAY send a bogus list of acceptable authentications
but never accept any. This makes it possible for the server to
avoid disclosing information about which accounts exist. In any
case, if the user does not exist, the authentication request MUST
NOT be accepted.
The client MAY at any time continue with a new
SSH_MSG_USERAUTH_REQUEST message, in which case the server MUST
abandon the previous authentication attempt and continue with the
new one.
3.3 Initial server response
The server responds to the SSH_MSG_USERAUTH_REQUEST with either a
SSH_MSG_USERAUTH_FAILURE if none of the mechanisms are supported, or
with SSH_MSG_USERAUTH_GSSAPI_RESPONSE as follows:
byte SSH_MSG_USERAUTH_GSSAPI_RESPONSE
string selected mechanism OID
The mechanism OID must be one of the OIDs sent by the client in the
SSH_MSG_USERAUTH_REQUEST packet.
3.4 GSSAPI session
Once the mechanism OID has been selected, the client will then
initiate an exchange of one or more pairs of
SSH_MSG_USERAUTH_GSSAPI_TOKEN packets. These packets contain the
tokens produced from the 'GSS_Init_sec_context()' and
'GSS_Accept_sec_context()' calls. The actual number of packets
exchanged is determined by the underlying GSSAPI mechanism.
byte SSH_MSG_USERAUTH_GSSAPI_TOKEN
string data returned from either GSS_Init_sec_context()
or GSS_Accept_sec_context()
If an error occurs during this exchange on server side, the server
can terminate the method by sending a SSH_MSG_USERAUTH_FAILURE
packet. If an error occurs on client side, the client can terminate
the method by sending a new SSH_MSG_USERAUTH_REQUEST packet.
The client MAY use the deleg_req_flag in calls to
GSS_Init_sec_context() to request credential delegation.
Additional SSH_MSG_USERAUTH_GSSAPI_TOKEN messages are sent if and
only if the calls to the GSSAPI routines produce send tokens of
non-zero length.
Any major status code other than GSS_S_COMPLETE or
GSS_S_CONTINUE_NEEDED SHOULD be a failure.
3.5 Client acknowledgement
It is possible for the server to successfully complete the GSSAPI
method and the client to fail. If the server simply assumed success
on the part of the client and completed the authentication service,
it is possible that the client would fail to complete the
authentication method, but not be able to retry other methods
because the server had already moved on.
Therefore, the client MUST send the following message when it has
successfully called GSS_Init_sec_context() and gotten GSS_S_COMPLETE:
byte SSH_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE
This message MUST be sent if and only if GSS_Init_sec_context()
returned GSS_S_COMPLETE.
If GSS_Init_sec_context() failed, the client MUST terminate the
method by sending a new SSH_MSG_USERAUTH_REQUEST.
3.6 Completion
As with all SSH authentication methods, successful completion is
indicated by a SSH_MSG_USERAUTH_SUCCESS if no other authentication
is required, or a SSH_MSG_USERAUTH_FAILURE with the partial success
flag set if the server requires further authentication.
This packet should be sent immediately following receipt of the the
SSH_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE packet.
4. External Key Exchange User Authentication
This section describes a user authentication method building on the
framework described in [12]. This method relies upon the key
exchange to authenticate both the client and the server. If the key
exchange did not successfully perform these functions then the
server MUST always respond to this request with
SSH_MSG_USERAUTH_FAILURE with partial success set to false.
The new mechanism is defined as follows:
byte SSH_MSG_USERAUTH_REQUEST
string user name (in ISO-10646 UTF-8 encoding)
string service name (in US-ASCII)
string "external-keyx" (US-ASCII method name)
If the authentication performed as part of key exchange can be used
to authorize login as the requested user, this method is successful,
and the server responds with SSH_MSG_USERAUTH_SUCCESS if no more
authentications are needed, or with SSH_MSG_USERAUTH_FAILURE with
partial success set to true if more authentications are needed.
If the authentication performed as part of key-exchange cannot be
used to authorize login as the requested user, then
SSH_MSG_USERAUTH_FAILURE is returned with partial success set to
false.
If the user name is not empty, and the requested user does not
exist, the server MAY disconnect, or MAY send a bogus list of
acceptable authentications but never accept any. This makes it
possible for the server to avoid disclosing information about which
accounts exist. In any case, if the user does not exist, the
authentication request MUST NOT be accepted.
Any implementation supporting at least one key exchange method which
conforms to section 1 of this document SHOULD also support the
"external-keyx" user authentication method, in order to allow user
authentication to be performed at the same time as key exchange,
thereby reducing the number of round trips needed for connection
setup.
5. Null Host Key Algorithm
The "null" host key algorithm has no associated host key material, The "null" host key algorithm has no associated host key material,
and provides neither signature nor encryption algorithms. Thus, it and provides neither signature nor encryption algorithms. Thus, it
can be used only with key exchange methods that do not require any can be used only with key exchange methods that do not require any
public-key operations and do not require the use of host public key public-key operations and do not require the use of host public key
material. The key exchange methods described in section 1 of this material. The key exchange methods described in section 1 of this
document are examples of such methods. document are examples of such methods.
This algorithm is used when, as a matter of configuration, the host This algorithm is used when, as a matter of configuration, the host
does not have or does not wish to use a public key. For example, it does not have or does not wish to use a public key. For example, it
can be used when the administrator has decided as a matter of policy can be used when the administrator has decided as a matter of policy
to require that all key exchanges be authenticated using Kerberos to require that all key exchanges be authenticated using Kerberos
[3], and thus the only permitted key exchange method is the [3], and thus the only permitted key exchange method is the
GSSAPI-authenticated Diffie-Hellman exchange described above, with GSSAPI-authenticated Diffie-Hellman exchange described above, with
Kerberos V5 as the underlying GSSAPI mechanism. In such a Kerberos V5 as the underlying GSSAPI mechanism. In such a
configuration, the server implementation supports the "ssh-dss" key configuration, the server implementation supports the "ssh-dss" key
algorithm (as required by [10], but could be prohibited by algorithm (as required by [11], but could be prohibited by
configuration from using it. In this situation, the server needs configuration from using it. In this situation, the server needs
some key exchange algorithm to advertise; the "null" algorithm fills some key exchange algorithm to advertise; the "null" algorithm fills
this purpose. this purpose.
Note that the use of the "null" algorithm in this way means that the Note that the use of the "null" algorithm in this way means that the
server will not be able to interoperate with clients which do not server will not be able to interoperate with clients which do not
support this algorithm. This is not a significant problem, since in support this algorithm. This is not a significant problem, since in
the configuration described, it will also be unable to interoperate the configuration described, it will also be unable to interoperate
with implementations that do not support the GSSAPI-authenticated with implementations that do not support the GSSAPI-authenticated
key exchange and Kerberos. key exchange and Kerberos.
Any implementation supporting at least one key exchange method which Any implementation supporting at least one key exchange method which
conforms to section 1 of this document MUST also support the "null" conforms to section 1 of this document MUST also support the "null"
host key algorithm. Servers MUST NOT advertise the "null" host key host key algorithm. Servers MUST NOT advertise the "null" host key
algorithm unless it is the only algorithm advertised. algorithm unless it is the only algorithm advertised.
3. External Key Exchange user authentication 6. Summary of Message Numbers
This section describes a user authentication method building on the The following message numbers have been defined for use with
framework described in [11]. This method relies upon the key GSSAPI-based key exchange methods:
exchange to authenticate both the client and the server. If the key
exchange did not successfully perform these functions then the
server MUST always respond to this request with
SSH_MSG_USERAUTH_FAILURE with partial success set to false.
The new mechanism is defined as follows: #define SSH_MSG_KEXGSS_INIT 30
#define SSH_MSG_KEXGSS_CONTINUE 31
#define SSH_MSG_KEXGSS_COMPLETE 32
#define SSH_MSG_KEXGSS_HOSTKEY 33
byte SSH_MSG_USERAUTH_REQUEST The numbers 30-49 are specific to key exchange and may be redefined
string authorization-ID by other kex methods.
string service
string "external-keyx"
If the user authenticated in the key-exchange is allowed to assume The following message numbers have been defined for use with the
the authorization identity, this method is successful, and the 'gssapi' user authentication method:
server responds with SSH_MSG_USERAUTH_SUCCESS if no more
authentications are needed, or with SSH_MSG_USERAUTH_FAILURE with
partial success set to true if more authentications are needed.
If the user authenticated in the key-exchange is not allowed to #define SSH_MSG_USERAUTH_GSSAPI_RESPONSE 60
assume the authorization identity, then SSH_MSG_USERAUTH_FAILURE is #define SSH_MSG_USERAUTH_GSSAPI_TOKEN 61
returned with partial success set to false. #define SSH_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE 63
Any implementation supporting at least one key exchange method which The numbers 60-79 are specific to user authentication and may be
conforms to section 1 of this document SHOULD also support the redefined by other user auth methods. Note that in the method
"external-keyx" user authentication method, in order to allow user described in this document, message number 62 is unused.
authentication to be performed at the same time as key exchange,
thereby reducing the number of round trips needed for connection
setup.
4. Summary of Message Numbers 7. GSSAPI Considerations
The following message numbers have been defined in this document: 7.1 Naming Conventions
#define SSH_MSG_GSSAPI_INIT 30 In order to establish a GSSAPI security context, the SSH client
#define SSH_MSG_GSSAPI_CONTINUE 31 needs to determine the appropriate targ_name to use in identifying
#define SSH_MSG_GSSAPI_COMPLETE 32 the server when calling GSS_Init_sec_context. For this purpose, the
GSSAPI mechanism-independent name form for host-based services is
used, as described in section 4.1 of [2].
The numbers 30-49 are key exchange specific and may be redefined by In particular, the targ_name to pass to GSS_Init_sec_context is
other kex methods. obtained by calling GSS_Import_name with an input_name_type of
GSS_C_NT_HOSTBASED_SERVICE, and an input_name_string consisting of
the string "host@" concatenated with the hostname of the SSH server.
5. Security Considerations 7.2 Channel Bindings
This document describes an authentication and key-exchange protocol. This document recommends that channel bindings SHOULD NOT be
specified in the calls during context establishment. This document
does not specify any standard data to be used as channel bindings
and the use of network addresses as channel bindings may break SSH
in environments where it is most useful.
7.3 SPNEGO
The use of the Simple and Protected GSS-API Negotiation Mechanism
[8] in conjunction with the authentication and key exchange methods
described in this document is both unnecessary and undesirable. As
a result, mechanisms conforming to this document MUST NOT use SPNEGO
as the underlying GSSAPI mechanism.
Since SSH performs its own negotiation of authentication and key
exchange methods, the negotiation capability of SPNEGO alone does
not provide any added benefit. In fact, as described below, it has
the potential to result in the use of a weaker method than desired.
Normally, SPNEGO provides the added benefit of protecting the GSSAPI
mechanism negotiation. It does this by having the server compute a
MIC of the list of mechanisms proposed by the client, and then
checking that value at the client. In the case of key exchange,
this protection is not needed because the key exchange methods
described here already perform an equivalent operation; namely, they
generate a MIC of the SSH exchange hash, which is a hash of several
items including the lists of key exchange mechanisms supported by
both sides. In the case of user authentication, the protection is
not needed because the negotiation occurs over a secure channel, and
the host's identity has already been proved to the user.
The use of SPNEGO combined with GSSAPI mechanisms used without
SPNEGO can lead to interoperability problems. For example, a client
which supports key exchange using the Kerberos V5 GSSAPI mechanism
[4] only underneath SPNEGO will not interoperate with a server which
supports key exchange only using the Kerberos V5 GSSAPI mechanism
directly. As a result, allowing GSSAPI mechanisms to be used both
with and without SPNEGO is undesirable.
If a client's policy is to first prefer GSSAPI-based key exchange
method X, then non-GSSAPI method Y, then GSSAPI-based method Z, and
if a server supports mechanisms Y and Z but not X, then an attempt
to use SPNEGO to negotiate a GSSAPI mechanism might result in the
use of method Z when method Y would have been preferable. As a
result, the use of SPNEGO could result in the subversion of the
negotiation algorithm for key exchange methods as described in
section 5.1 of [11] and/or the negotiation algorithm for user
authentication methods as described in [12].
8. Security Considerations
This document describes authentication and key-exchange protocols.
As such, security considerations are discussed throughout. As such, security considerations are discussed throughout.
This protocol depends on the SSH protocol itself, the GSSAPI, any This protocol depends on the SSH protocol itself, the GSSAPI, any
underlying GSSAPI mechanisms which are used, and any protocols on underlying GSSAPI mechanisms which are used, and any protocols on
which such mechanisms might depend. Each of these components plays which such mechanisms might depend. Each of these components plays
a part in the security of the resulting connection, and each will a part in the security of the resulting connection, and each will
have its own security considerations. have its own security considerations.
The key exchange method described in section 1 of this document The key exchange method described in section 1 of this document
depends on the underlying GSSAPI mechanism to provide both mutual depends on the underlying GSSAPI mechanism to provide both mutual
authentication and per-message integrity services. If either of authentication and per-message integrity services. If either of
these features is not supported by a particular GSSAPI mechanism, or these features is not supported by a particular GSSAPI mechanism, or
by a particular implementation of a GSSAPI mechanism, then the key by a particular implementation of a GSSAPI mechanism, then the key
exchange is not secure and MUST fail. exchange is not secure and MUST fail.
In order for the "external-keyx" user authentication method to be In order for the "external-keyx" user authentication method to be
used, it MUST have access to user authentication information used, it MUST have access to user authentication information
obtained as a side-effect of the key exchange. If this information obtained as a side-effect of the key exchange. If this information
is unavailable, the authentication MUST fail. is unavailable, the authentication MUST fail.
6. Acknowledgements 9. Acknowledgements
The authors would like to thank Sam Hartman and Simon Wilkinson for The authors would like to thank Sam Hartman and Simon Wilkinson for
their invaluable assistance with this document. their invaluable assistance with this document.
10. Changes the last version
This section lists important changes since the previous version of
this internet-draft. This section should be removed at the time of
publication of this document as an RFC.
o Merged user auth and key exchange into one document.
o Dropped host key verification from user auth.
o Changed the key exchange to use the SSH_MSG_KEXGSS_CONTINUE
message in both directions, and dropped the boolean from the
SSH_MSG_KEXGSS_INIT message.
o Added the SSH_MSG_KEXGSS_HOSTKEY message to allow the server to
send its host key during key exchange, even though the key is not
required to perform the exchange.
o Modified the form of the exchange hash to include the host key,
if one was provided by the server. This allows the GSSAPI key
exchange method to be used to bootstrap a host key which can then
be used with other methods, in the same session or in future
sessions.
o Renamed all SSH_MSG_GSSAPI_* messages to SSH_MSG_KEXGSS_*. The
message numbers have not changed.
References References
[1] ISO/IEC, "Specification of Abstract Syntax Notation One [1] ISO/IEC, "Specification of Abstract Syntax Notation One
(ASN.1)", ISO/IEC 8824, November 1998. (ASN.1)", ISO/IEC 8824, November 1998.
[2] Linn, J., "Generic Security Service Application Program [2] Linn, J., "Generic Security Service Application Program
Interface Version 2, Update 1", RFC 2743, January 2000. Interface Version 2, Update 1", RFC 2743, January 2000.
[3] Kohl, J. and C. Neuman, "The Kerberos Network Authentication [3] Kohl, J. and C. Neuman, "The Kerberos Network Authentication
Service (V5)", RFC 1510, September 1993. Service (V5)", RFC 1510, September 1993.
skipping to change at page 14, line 33 skipping to change at page 20, line 33
Extensions (MIME) Part One: Format of Internet Message Extensions (MIME) Part One: Format of Internet Message
Bodies", RFC 2045, November 1996. Bodies", RFC 2045, November 1996.
[7] Bradner, S., "Key words for use in RFCs to Indicate [7] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", RFC 2119, BCP 14, March 1997. Requirement Levels", RFC 2119, BCP 14, March 1997.
[8] Baize, E. and D. Pinkas, "The Simple and Protected GSS-API [8] Baize, E. and D. Pinkas, "The Simple and Protected GSS-API
Negotiation Mechanism", RFC 2478, December 1998. Negotiation Mechanism", RFC 2478, December 1998.
[9] Ylonen, T., Kivinen, T., Saarinen, M., Rinne, T. and S. [9] Ylonen, T., Kivinen, T., Saarinen, M., Rinne, T. and S.
Lehtinen, "SSH Protocol Architecture", November 2000. Lehtinen, "SSH Protocol Architecture", January 2001.
[10] Ylonen, T., Kivinen, T., Saarinen, M., Rinne, T. and S. [10] Ylonen, T., Kivinen, T., Saarinen, M., Rinne, T. and S.
Lehtinen, "SSH Transport Layer Protocol", November 2000. Lehtinen, "SSH Connection Protocol", January 2001.
[11] Ylonen, T., Kivinen, T., Saarinen, M., Rinne, T. and S. [11] Ylonen, T., Kivinen, T., Saarinen, M., Rinne, T. and S.
Lehtinen, "SSH Authentication Protocol", November 2000. Lehtinen, "SSH Transport Layer Protocol", January 2001.
[12] Ylonen, T., Kivinen, T., Saarinen, M., Rinne, T. and S.
Lehtinen, "SSH Authentication Protocol", January 2001.
Authors' Addresses Authors' Addresses
Jeffrey Hutzelman Jeffrey Hutzelman
Carnegie Mellon University Carnegie Mellon University
5000 Forbes Ave 5000 Forbes Ave
Pittsburgh, PA 15213 Pittsburgh, PA 15213
US US
Phone: +1 412 268 7225 Phone: +1 412 268 7225
skipping to change at page 15, line 4 skipping to change at page 21, line 16
Jeffrey Hutzelman Jeffrey Hutzelman
Carnegie Mellon University Carnegie Mellon University
5000 Forbes Ave 5000 Forbes Ave
Pittsburgh, PA 15213 Pittsburgh, PA 15213
US US
Phone: +1 412 268 7225 Phone: +1 412 268 7225
EMail: jhutz+@cmu.edu EMail: jhutz+@cmu.edu
URI: http://www.cs.cmu.edu/~jhutz/ URI: http://www.cs.cmu.edu/~jhutz/
Joseph Salowey Joseph Salowey
Cisco Systems Cisco Systems
Bldg 20 Bldg 20
725 Alder Drive 725 Alder Drive
Milpitas, CA 95035 Milpitas, CA 95035
US US
Phone: +1 408 525 6381 Phone: +1 408 525 6381
EMail: jsalowey@cisco.com EMail: jsalowey@cisco.com
Joseph Galbraith
Van Dyke Technologies, Inc.
4848 Tramway Ridge Dr. NE
Suite 101
Albuquerque, NM 87111
US
EMail: galb@vandyke.com
Vol Welch
University of Chicago & Argonne National Laboratory
Distributed Systems Laboratory
701 E. Washington
Urbana, IL 61801
US
EMail: welch@mcs.anl.gov
Full Copyright Statement Full Copyright Statement
Copyright (C) The Internet Society (2001). All Rights Reserved. Copyright (C) The Internet Society (2001). All Rights Reserved.
This document and translations of it may be copied and furnished to This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph kind, provided that the above copyright notice and this paragraph
 End of changes. 

This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/