draft-ietf-secsh-gsskeyex-00.txt   draft-ietf-secsh-gsskeyex-01.txt 
Network Working Group J. Hutzelman Network Working Group J. Hutzelman
Internet-Draft CMU Internet-Draft CMU
Expires: July 14, 2001 J. Salowey Expires: August 31, 2001 J. Salowey
Cisco Systems Cisco Systems
January 13, 2001 March 2, 2001
Using GSSAPI authentication for key exchange in Secure Shell Using GSSAPI authentication for key exchange in Secure Shell
draft-ietf-secsh-gsskeyex-00 draft-ietf-secsh-gsskeyex-01
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 33
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 July 14, 2001. This Internet-Draft will expire on August 31, 2001.
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 This memo describes a method for using the Generic Security Service
Application Program Interface [2] for key exchange in the Secure Application Program Interface [2] for key exchange in the Secure
Shell protocol, by defining a class of SSH key exchange methods Shell protocol, by defining a class of SSH key exchange methods
skipping to change at page 3, line 13 skipping to change at page 3, line 13
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. 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 [10] 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 hey 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 2 of this document.
1.1 Generic method description 1.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
o I_C is C's KEXINIT message, and I_S is S's KEXINIT message o I_C is C's KEXINIT message, and I_S is S's KEXINIT message
1. C generates a random number x (1 < x < q) and computes e = g^x 1. C generates a random number x (1 < x < q) and computes e = g^x
mod p. mod p.
2. C calls GSS_Init_sec_context, using the most reply token 2. C calls GSS_Init_sec_context, using the most recent reply token
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 or anon_req_flag is immaterial to this process. If the client does
server does not support the "external-keyx" user authentication not support the "external-keyx" user authentication method
method described in section 3 of this document, or if the client described in section 3 of this document, or does not intend to
does not intend to use that method, then the anon_req_flag use that method, then the anon_req_flag SHOULD be set to "true".
SHOULD be set to "true". Otherwise, this flag MAY be set to Otherwise, this flag MAY be set to true if the client wishes to
true if the client wishes to hide its identity. hide its 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
mutual_state flag is true, the resulting output token is sent mutual_state flag is true, the resulting output token is sent
to S along with "e". to S.
* If the resulting major_status code is GSS_S_CONTINUE_NEEDED, * If the resulting major_status code is GSS_S_CONTINUE_NEEDED,
the the output_token (only) is sent to S, which will reply the the output_token is sent to S, which will reply with a
with a new token to be provided to GSS_Init_sec_context. new token to be provided to GSS_Init_sec_context.
* The client MUST include "e" with exactly one of the messages * The client MUST also include "e" with the first message it
it sends to the server during this process; if the server sends to the server during this process; if the server
receives more than one "e" or none at all, the key exchange receives more than one "e" or none at all, the key exchange
fails. The client SHOULD wait until the last message (that fails.
is, the one containing the token returned by
GSS_Init_sec_context at the same time it returned * It is an error if the call does not produce a token of
GSS_S_COMPLETE) to send "e", so that it is not sent if there non-zero length to be sent to the server. In this case, the
is an error in the course of setting up the GSSAPI security key exchange MUST fail.
context.
3. S calls GSS_Accept_sec_context, using the token received from C. 3. S calls GSS_Accept_sec_context, using the token received from C.
* 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
mutual_state flag is true, then the security context has been mutual_state flag is true, then the security context has been
established, and processing continues with step 4. established, and processing continues with step 4.
* 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
non-zero-length reply token is returned, then that token is
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 || e || f || K). It then calls GSS_GetMIC to obtain
a GSSAPI message integrity code for H. S then sends f and the a GSSAPI message integrity code for H. S then sends f and the
MIC to C. MIC to C.
5. C computes K = f^x mod p, and H = hash(V_C || V_S || I_C || I_S 5. 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_ 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.
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 || e || f || K). It then calls GSS_VerifyMIC to verify that the
MIC sent by S matches H. 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.
Each time GSS_Init_sec_context returns a major_status code of After the client's first call to GSS_Init_sec_context, it sends the
GSS_S_CONTINUE_NEEDED, the client sends the following: following:
byte SSH_MSG_GSSAPI_INIT byte SSH_MSG_GSSAPI_INIT
boolean FALSE boolean TRUE
string output_token (from GSS_Init_sec_context) string output_token (from GSS_Init_sec_context)
mpint e
The server responds with the following: 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
reply to the client:
byte SSH_MSG_GSSAPI_CONTINUE byte SSH_MSG_GSSAPI_CONTINUE
string output_token (from GSS_Accept_sec_context) string output_token (from GSS_Accept_sec_context)
When GSS_Init_sec_context returns a major_status code of If the client receives this message appears after a call to
GSS_S_COMPLETE, the client sends the following: 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.
Each time the client receives the message described above, it makes
another call to GSS_Init_sec_context. It then sends the following:
byte SSH_MSG_GSSAPI_INIT byte SSH_MSG_GSSAPI_INIT
boolean TRUE boolean FALSE
string output_token (from GSS_Init_sec_context) string output_token (from GSS_Init_sec_context)
mpint e 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.
The server responds with the following: If the server's final call to GSS_Accept_sec_contents (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:
byte SSH_MSG_GSSAPI_COMPLETE
mpint f
string per_msg_token (MIC of H)
boolean TRUE
string output_token (from GSS_Accept_sec_context)
If the client receives this message appears 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.
If the server's final call to GSS_Accept_sec_contents (resulting in
a major_status code of GSS_S_COMPLETE) returns a zero-length token
or no token at all, it sends the following:
byte SSH_MSG_GSSAPI_COMPLETE byte SSH_MSG_GSSAPI_COMPLETE
mpint f mpint f
string per_msg_token (MIC of H) string per_msg_token (MIC of H)
boolean FALSE
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.
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
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
skipping to change at page 6, line 13 skipping to change at page 7, line 13
secret. secret.
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-* 1.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 1.1 of this document, with
SHA-1 as HASH, and the group defined in section 6.1 of [10]. The SHA-1 as HASH, and the group defined in section 6.1 of [10]. The
method name for each method is the concatenation of the string method name for each method is the concatenation of the string
"gss-group1-sha1-" with the Base64 encoding of the first ten bytes "gss-group1-sha1-" with the Base64 encoding of the MD5 hash [5] of
of the MD5 hash [5] of the ASN.1 DER encoding [1] of the underlying the ASN.1 DER encoding [1] of the underlying GSSAPI mechanism's OID.
GSSAPI mechanism's OID. Base64 encoding is described in section 6.8 Base64 encoding is described in section 6.8 of [6].
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 1.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
skipping to change at page 8, line 5 skipping to change at page 8, line 38
needs to determine the appropriate targ_name to use in identifying needs to determine the appropriate targ_name to use in identifying
the server when calling GSS_Init_sec_context. For this purpose, the the server when calling GSS_Init_sec_context. For this purpose, the
GSSAPI mechanism-independent name form for host-based services is GSSAPI mechanism-independent name form for host-based services is
used, as described in section 4.1 of [2]. used, as described in section 4.1 of [2].
In particular, the targ_name to pass to GSS_Init_sec_context is In particular, the targ_name to pass to GSS_Init_sec_context is
obtained by calling GSS_Import_name with an input_name_type of obtained by calling GSS_Import_name with an input_name_type of
GSS_C_NT_HOSTBASED_SERVICE, and an input_name_string consisting of GSS_C_NT_HOSTBASED_SERVICE, and an input_name_string consisting of
the string "host@" concatenated with the hostname of the SSH server. the string "host@" concatenated with the hostname of the SSH server.
1.6 Channel Bindings
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.
2. Null Host Key Algorithm 2. 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
skipping to change at page 10, line 5 skipping to change at page 11, line 5
assume the authorization identity, then SSH_MSG_USERAUTH_FAILURE is assume the authorization identity, then SSH_MSG_USERAUTH_FAILURE is
returned with partial success set to false. returned with partial success set to false.
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 SHOULD also support the conforms to section 1 of this document SHOULD also support the
"external-keyx" user authentication method, in order to allow user "external-keyx" user authentication method, in order to allow user
authentication to be performed at the same time as key exchange, authentication to be performed at the same time as key exchange,
thereby reducing the number of round trips needed for connection thereby reducing the number of round trips needed for connection
setup. setup.
4. Security Considerations 4. Summary of Message Numbers
The following message numbers have been defined in this document:
#define SSH_MSG_GSSAPI_INIT 30
#define SSH_MSG_GSSAPI_CONTINUE 31
#define SSH_MSG_GSSAPI_COMPLETE 32
The numbers 30-49 are key exchange specific and may be redefined by
other kex methods.
5. Security Considerations
This document describes an authentication and key-exchange protocol. This document describes an authentication and key-exchange protocol.
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.
skipping to change at page 11, line 5 skipping to change at page 13, line 5
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.
5. Trademark Issues 6. Acknowledgements
SSH is a registered trademark and Secure Shell is a trademark of SSH The authors would like to thank Sam Hartman and Simon Wilkinson for
Communications Security Corp (www.ssh.com), and are used herein to their invaluable assistance with this document.
describe and refer to the SSH protocol, as permitted in section 9 of
[9]. These trademarks may not be used as part of a product name or
in otherwise confusing manner without prior written permission of
SSH Communications Security Corp.
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
 End of changes. 

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