mirror of
https://github.com/openssh/libopenssh
synced 2026-04-27 15:18:13 +00:00
sshd: pass struct ssh instead of authctxt to authentication handlers
This commit is contained in:
@@ -234,7 +234,8 @@ send_userauth_info_request(Authctxt *authctxt)
|
||||
static void
|
||||
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;
|
||||
|
||||
@@ -130,7 +130,8 @@ userauth_gssapi(Authctxt *authctxt)
|
||||
static void
|
||||
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;
|
||||
@@ -184,7 +185,8 @@ input_gssapi_token(int type, u_int32_t plen, void *ctxt)
|
||||
static void
|
||||
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;
|
||||
@@ -224,7 +226,8 @@ input_gssapi_errtok(int type, u_int32_t plen, void *ctxt)
|
||||
static void
|
||||
input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt)
|
||||
{
|
||||
Authctxt *authctxt = ctxt;
|
||||
struct ssh *ssh = ctxt;
|
||||
Authctxt *authctxt = ssh->authctxt;
|
||||
Gssctxt *gssctxt;
|
||||
int authenticated;
|
||||
|
||||
@@ -253,7 +256,8 @@ input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt)
|
||||
static void
|
||||
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;
|
||||
|
||||
@@ -422,7 +422,8 @@ auth2_jpake_start(Authctxt *authctxt)
|
||||
static void
|
||||
input_userauth_jpake_client_step1(int type, u_int32_t seq, void *ctxt)
|
||||
{
|
||||
Authctxt *authctxt = ctxt;
|
||||
struct ssh *ssh = ctxt;
|
||||
Authctxt *authctxt = ssh->authctxt;
|
||||
struct jpake_ctx *pctx = authctxt->jpake_ctx;
|
||||
u_char *x1_proof, *x2_proof, *x4_s_proof;
|
||||
u_int x1_proof_len, x2_proof_len, x4_s_proof_len;
|
||||
@@ -480,7 +481,8 @@ input_userauth_jpake_client_step1(int type, u_int32_t seq, void *ctxt)
|
||||
static void
|
||||
input_userauth_jpake_client_step2(int type, u_int32_t seq, void *ctxt)
|
||||
{
|
||||
Authctxt *authctxt = ctxt;
|
||||
struct ssh *ssh = ctxt;
|
||||
Authctxt *authctxt = ssh->authctxt;
|
||||
struct jpake_ctx *pctx = authctxt->jpake_ctx;
|
||||
u_char *x2_s_proof;
|
||||
u_int x2_s_proof_len;
|
||||
@@ -530,7 +532,8 @@ input_userauth_jpake_client_step2(int type, u_int32_t seq, void *ctxt)
|
||||
static void
|
||||
input_userauth_jpake_client_confirm(int type, u_int32_t seq, void *ctxt)
|
||||
{
|
||||
Authctxt *authctxt = ctxt;
|
||||
struct ssh *ssh = ctxt;
|
||||
Authctxt *authctxt = ssh->authctxt;
|
||||
struct jpake_ctx *pctx = authctxt->jpake_ctx;
|
||||
int authenticated = 0;
|
||||
|
||||
|
||||
11
ssh/auth2.c
11
ssh/auth2.c
@@ -157,16 +157,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 void
|
||||
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);
|
||||
@@ -200,7 +204,8 @@ input_service_request(int type, u_int32_t seq, void *ctxt)
|
||||
static void
|
||||
input_userauth_request(int type, u_int32_t seq, void *ctxt)
|
||||
{
|
||||
Authctxt *authctxt = ctxt;
|
||||
struct ssh *ssh = ctxt;
|
||||
Authctxt *authctxt = ssh->authctxt;
|
||||
Authmethod *m = NULL;
|
||||
char *user, *service, *method, *style = NULL;
|
||||
int authenticated = 0;
|
||||
|
||||
Reference in New Issue
Block a user