summaryrefslogtreecommitdiff
path: root/auth2-gss.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2015-01-19 20:07:45 +0000
committerDamien Miller <djm@mindrot.org>2015-01-20 09:14:16 +1100
commit3fdc88a0def4f86aa88a5846ac079dc964c0546a (patch)
treed26470c8ffb49bb4417af2b729d933d6ce3f75f8 /auth2-gss.c
parent091c302829210c41e7f57c3f094c7b9c054306f0 (diff)
upstream commit
move dispatch to struct ssh; ok djm@
Diffstat (limited to 'auth2-gss.c')
-rw-r--r--auth2-gss.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/auth2-gss.c b/auth2-gss.c
index 447f896f2..1ca835773 100644
--- a/auth2-gss.c
+++ b/auth2-gss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-gss.c,v 1.21 2014/02/26 20:28:44 djm Exp $ */ 1/* $OpenBSD: auth2-gss.c,v 1.22 2015/01/19 20:07:45 markus Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. 4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -48,10 +48,10 @@
48 48
49extern ServerOptions options; 49extern ServerOptions options;
50 50
51static void input_gssapi_token(int type, u_int32_t plen, void *ctxt); 51static int input_gssapi_token(int type, u_int32_t plen, void *ctxt);
52static void input_gssapi_mic(int type, u_int32_t plen, void *ctxt); 52static int input_gssapi_mic(int type, u_int32_t plen, void *ctxt);
53static void input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt); 53static int input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt);
54static void input_gssapi_errtok(int, u_int32_t, void *); 54static int input_gssapi_errtok(int, u_int32_t, void *);
55 55
56/* 56/*
57 * We only support those mechanisms that we know about (ie ones that we know 57 * We only support those mechanisms that we know about (ie ones that we know
@@ -126,7 +126,7 @@ userauth_gssapi(Authctxt *authctxt)
126 return (0); 126 return (0);
127} 127}
128 128
129static void 129static int
130input_gssapi_token(int type, u_int32_t plen, void *ctxt) 130input_gssapi_token(int type, u_int32_t plen, void *ctxt)
131{ 131{
132 Authctxt *authctxt = ctxt; 132 Authctxt *authctxt = ctxt;
@@ -178,9 +178,10 @@ input_gssapi_token(int type, u_int32_t plen, void *ctxt)
178 } 178 }
179 179
180 gss_release_buffer(&min_status, &send_tok); 180 gss_release_buffer(&min_status, &send_tok);
181 return 0;
181} 182}
182 183
183static void 184static int
184input_gssapi_errtok(int type, u_int32_t plen, void *ctxt) 185input_gssapi_errtok(int type, u_int32_t plen, void *ctxt)
185{ 186{
186 Authctxt *authctxt = ctxt; 187 Authctxt *authctxt = ctxt;
@@ -212,6 +213,7 @@ input_gssapi_errtok(int type, u_int32_t plen, void *ctxt)
212 /* The client will have already moved on to the next auth */ 213 /* The client will have already moved on to the next auth */
213 214
214 gss_release_buffer(&maj_status, &send_tok); 215 gss_release_buffer(&maj_status, &send_tok);
216 return 0;
215} 217}
216 218
217/* 219/*
@@ -220,7 +222,7 @@ input_gssapi_errtok(int type, u_int32_t plen, void *ctxt)
220 * which only enables it once the GSSAPI exchange is complete. 222 * which only enables it once the GSSAPI exchange is complete.
221 */ 223 */
222 224
223static void 225static int
224input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt) 226input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt)
225{ 227{
226 Authctxt *authctxt = ctxt; 228 Authctxt *authctxt = ctxt;
@@ -244,9 +246,10 @@ input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt)
244 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, NULL); 246 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, NULL);
245 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL); 247 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL);
246 userauth_finish(authctxt, authenticated, "gssapi-with-mic", NULL); 248 userauth_finish(authctxt, authenticated, "gssapi-with-mic", NULL);
249 return 0;
247} 250}
248 251
249static void 252static int
250input_gssapi_mic(int type, u_int32_t plen, void *ctxt) 253input_gssapi_mic(int type, u_int32_t plen, void *ctxt)
251{ 254{
252 Authctxt *authctxt = ctxt; 255 Authctxt *authctxt = ctxt;
@@ -284,6 +287,7 @@ input_gssapi_mic(int type, u_int32_t plen, void *ctxt)
284 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, NULL); 287 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_MIC, NULL);
285 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL); 288 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL);
286 userauth_finish(authctxt, authenticated, "gssapi-with-mic", NULL); 289 userauth_finish(authctxt, authenticated, "gssapi-with-mic", NULL);
290 return 0;
287} 291}
288 292
289Authmethod method_gssapi = { 293Authmethod method_gssapi = {