summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/auth2.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2017-05-30 14:18:15 +0000
committermarkus <markus@openbsd.org>2017-05-30 14:18:15 +0000
commitbd5af9a54a976077c2ffcd66cfc1bf7469b0321c (patch)
tree946c4dcaa2a5c6cf3a1733b9cc9574ae99ca8a06 /usr.bin/ssh/auth2.c
parentremove unused wrapper functions from key.[ch]; ok djm@ (diff)
downloadwireguard-openbsd-bd5af9a54a976077c2ffcd66cfc1bf7469b0321c.tar.xz
wireguard-openbsd-bd5af9a54a976077c2ffcd66cfc1bf7469b0321c.zip
sshd: pass struct ssh to auth functions; ok djm@
Diffstat (limited to 'usr.bin/ssh/auth2.c')
-rw-r--r--usr.bin/ssh/auth2.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/ssh/auth2.c b/usr.bin/ssh/auth2.c
index e163c8ea67e..f019f7def4c 100644
--- a/usr.bin/ssh/auth2.c
+++ b/usr.bin/ssh/auth2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2.c,v 1.137 2017/02/03 23:05:57 djm Exp $ */
+/* $OpenBSD: auth2.c,v 1.138 2017/05/30 14:18:15 markus Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -155,16 +155,20 @@ done:
void
do_authentication2(Authctxt *authctxt)
{
+ struct ssh *ssh = active_state; /* XXX */
+ ssh->authctxt = authctxt; /* XXX move to caller */
dispatch_init(&dispatch_protocol_error);
dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request);
- dispatch_run(DISPATCH_BLOCK, &authctxt->success, authctxt);
+ dispatch_run(DISPATCH_BLOCK, &authctxt->success, ssh);
+ ssh->authctxt = NULL;
}
/*ARGSUSED*/
static int
input_service_request(int type, u_int32_t seq, void *ctxt)
{
- Authctxt *authctxt = ctxt;
+ struct ssh *ssh = ctxt;
+ Authctxt *authctxt = ssh->authctxt;
u_int len;
int acceptit = 0;
char *service = packet_get_cstring(&len);
@@ -199,8 +203,8 @@ input_service_request(int type, u_int32_t seq, void *ctxt)
static int
input_userauth_request(int type, u_int32_t seq, void *ctxt)
{
- struct ssh *ssh = active_state; /* XXX */
- Authctxt *authctxt = ctxt;
+ struct ssh *ssh = ctxt;
+ Authctxt *authctxt = ssh->authctxt;
Authmethod *m = NULL;
char *user, *service, *method, *style = NULL;
int authenticated = 0;