version 1.7, 2014/10/19 16:30:58 |
version 1.8, 2015/04/03 23:58:19 |
|
|
/* $NetBSD$ */ |
/* $NetBSD$ */ |
/* $OpenBSD: auth2-gss.c,v 1.21 2014/02/26 20:28:44 djm Exp $ */ |
/* $OpenBSD: auth2-gss.c,v 1.22 2015/01/19 20:07:45 markus Exp $ */ |
|
|
/* |
/* |
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. |
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. |
Line 48 __RCSID("$NetBSD$"); |
|
Line 48 __RCSID("$NetBSD$"); |
|
|
|
extern ServerOptions options; |
extern ServerOptions options; |
|
|
static void input_gssapi_token(int type, u_int32_t plen, void *ctxt); |
static int input_gssapi_token(int type, u_int32_t plen, void *ctxt); |
static void input_gssapi_mic(int type, u_int32_t plen, void *ctxt); |
static int input_gssapi_mic(int type, u_int32_t plen, void *ctxt); |
static void input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt); |
static int input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt); |
static void input_gssapi_errtok(int, u_int32_t, void *); |
static int input_gssapi_errtok(int, u_int32_t, void *); |
|
|
/* |
/* |
* We only support those mechanisms that we know about (ie ones that we know |
* We only support those mechanisms that we know about (ie ones that we know |
Line 126 userauth_gssapi(Authctxt *authctxt) |
|
Line 126 userauth_gssapi(Authctxt *authctxt) |
|
return (0); |
return (0); |
} |
} |
|
|
static void |
static int |
input_gssapi_token(int type, u_int32_t plen, void *ctxt) |
input_gssapi_token(int type, u_int32_t plen, void *ctxt) |
{ |
{ |
Authctxt *authctxt = ctxt; |
Authctxt *authctxt = ctxt; |
Line 178 input_gssapi_token(int type, u_int32_t p |
|
Line 178 input_gssapi_token(int type, u_int32_t p |
|
} |
} |
|
|
gss_release_buffer(&min_status, &send_tok); |
gss_release_buffer(&min_status, &send_tok); |
|
return 0; |
} |
} |
|
|
static void |
static int |
input_gssapi_errtok(int type, u_int32_t plen, void *ctxt) |
input_gssapi_errtok(int type, u_int32_t plen, void *ctxt) |
{ |
{ |
Authctxt *authctxt = ctxt; |
Authctxt *authctxt = ctxt; |
Line 212 input_gssapi_errtok(int type, u_int32_t |
|
Line 213 input_gssapi_errtok(int type, u_int32_t |
|
/* The client will have already moved on to the next auth */ |
/* The client will have already moved on to the next auth */ |
|
|
gss_release_buffer(&maj_status, &send_tok); |
gss_release_buffer(&maj_status, &send_tok); |
|
return 0; |
} |
} |
|
|
/* |
/* |
Line 220 input_gssapi_errtok(int type, u_int32_t |
|
Line 222 input_gssapi_errtok(int type, u_int32_t |
|
* which only enables it once the GSSAPI exchange is complete. |
* which only enables it once the GSSAPI exchange is complete. |
*/ |
*/ |
|
|
static void |
static int |
input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt) |
input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt) |
{ |
{ |
Authctxt *authctxt = ctxt; |
Authctxt *authctxt = ctxt; |
Line 244 input_gssapi_exchange_complete(int type, |
|
Line 246 input_gssapi_exchange_complete(int type, |
|
dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, NULL); |
dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, NULL); |
dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL); |
dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL); |
userauth_finish(authctxt, authenticated, "gssapi-with-mic", NULL); |
userauth_finish(authctxt, authenticated, "gssapi-with-mic", NULL); |
|
return 0; |
} |
} |
|
|
static void |
static int |
input_gssapi_mic(int type, u_int32_t plen, void *ctxt) |
input_gssapi_mic(int type, u_int32_t plen, void *ctxt) |
{ |
{ |
Authctxt *authctxt = ctxt; |
Authctxt *authctxt = ctxt; |
Line 284 input_gssapi_mic(int type, u_int32_t ple |
|
Line 287 input_gssapi_mic(int type, u_int32_t ple |
|
dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, NULL); |
dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, NULL); |
dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL); |
dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL); |
userauth_finish(authctxt, authenticated, "gssapi-with-mic", NULL); |
userauth_finish(authctxt, authenticated, "gssapi-with-mic", NULL); |
|
return 0; |
} |
} |
|
|
Authmethod method_gssapi = { |
Authmethod method_gssapi = { |