-/* $OpenBSD: auth2-chall.c,v 1.45 2017/05/30 08:49:58 markus Exp $ */
+/* $OpenBSD: auth2-chall.c,v 1.46 2017/05/30 14:18:15 markus Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2001 Per Allansson. All rights reserved.
static int
input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
{
- Authctxt *authctxt = ctxt;
+ struct ssh *ssh = ctxt;
+ Authctxt *authctxt = ssh->authctxt;
KbdintAuthctxt *kbdintctxt;
int authenticated = 0, res;
u_int i, nresp;
-/* $OpenBSD: auth2-gss.c,v 1.22 2015/01/19 20:07:45 markus Exp $ */
+/* $OpenBSD: auth2-gss.c,v 1.23 2017/05/30 14:18:15 markus Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
static int
input_gssapi_token(int type, u_int32_t plen, void *ctxt)
{
- Authctxt *authctxt = ctxt;
+ struct ssh *ssh = ctxt;
+ Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
gss_buffer_desc recv_tok;
static int
input_gssapi_errtok(int type, u_int32_t plen, void *ctxt)
{
- Authctxt *authctxt = ctxt;
+ struct ssh *ssh = ctxt;
+ Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
gss_buffer_desc recv_tok;
static int
input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt)
{
- Authctxt *authctxt = ctxt;
+ struct ssh *ssh = ctxt;
+ Authctxt *authctxt = ssh->authctxt;
int authenticated;
if (authctxt == NULL || (authctxt->methoddata == NULL && !use_privsep))
static int
input_gssapi_mic(int type, u_int32_t plen, void *ctxt)
{
- Authctxt *authctxt = ctxt;
+ struct ssh *ssh = ctxt;
+ Authctxt *authctxt = ssh->authctxt;
Gssctxt *gssctxt;
int authenticated = 0;
Buffer b;
-/* $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.
*
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);
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;
-/* $OpenBSD: packet.h,v 1.79 2017/05/03 21:08:09 naddy Exp $ */
+/* $OpenBSD: packet.h,v 1.80 2017/05/30 14:18:15 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
TAILQ_HEAD(, key_entry) private_keys;
TAILQ_HEAD(, key_entry) public_keys;
+ /* Client/Server authentication context */
+ void *authctxt;
+
/* APP data */
void *app_data;
};