summaryrefslogtreecommitdiff
path: root/auth2.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2017-05-30 14:18:15 +0000
committerDamien Miller <djm@mindrot.org>2017-05-31 10:49:50 +1000
commit5f4082d886c6173b9e90b9768c9a38a3bfd92c2b (patch)
tree76ca3a7c1727cb3203b982cce20b511eee4d9b09 /auth2.c
parent7da5df11ac788bc1133d8d598d298e33500524cc (diff)
upstream commit
sshd: pass struct ssh to auth functions; ok djm@ Upstream-ID: b00a80c3460884ebcdd14ef550154c761aebe488
Diffstat (limited to 'auth2.c')
-rw-r--r--auth2.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/auth2.c b/auth2.c
index 97dd2ef0a..13ff95eac 100644
--- a/auth2.c
+++ b/auth2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2.c,v 1.137 2017/02/03 23:05:57 djm Exp $ */ 1/* $OpenBSD: auth2.c,v 1.138 2017/05/30 14:18:15 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -168,16 +168,20 @@ done:
168void 168void
169do_authentication2(Authctxt *authctxt) 169do_authentication2(Authctxt *authctxt)
170{ 170{
171 struct ssh *ssh = active_state; /* XXX */
172 ssh->authctxt = authctxt; /* XXX move to caller */
171 dispatch_init(&dispatch_protocol_error); 173 dispatch_init(&dispatch_protocol_error);
172 dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request); 174 dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request);
173 dispatch_run(DISPATCH_BLOCK, &authctxt->success, authctxt); 175 dispatch_run(DISPATCH_BLOCK, &authctxt->success, ssh);
176 ssh->authctxt = NULL;
174} 177}
175 178
176/*ARGSUSED*/ 179/*ARGSUSED*/
177static int 180static int
178input_service_request(int type, u_int32_t seq, void *ctxt) 181input_service_request(int type, u_int32_t seq, void *ctxt)
179{ 182{
180 Authctxt *authctxt = ctxt; 183 struct ssh *ssh = ctxt;
184 Authctxt *authctxt = ssh->authctxt;
181 u_int len; 185 u_int len;
182 int acceptit = 0; 186 int acceptit = 0;
183 char *service = packet_get_cstring(&len); 187 char *service = packet_get_cstring(&len);
@@ -212,8 +216,8 @@ input_service_request(int type, u_int32_t seq, void *ctxt)
212static int 216static int
213input_userauth_request(int type, u_int32_t seq, void *ctxt) 217input_userauth_request(int type, u_int32_t seq, void *ctxt)
214{ 218{
215 struct ssh *ssh = active_state; /* XXX */ 219 struct ssh *ssh = ctxt;
216 Authctxt *authctxt = ctxt; 220 Authctxt *authctxt = ssh->authctxt;
217 Authmethod *m = NULL; 221 Authmethod *m = NULL;
218 char *user, *service, *method, *style = NULL; 222 char *user, *service, *method, *style = NULL;
219 int authenticated = 0; 223 int authenticated = 0;