diff options
Diffstat (limited to 'auth2.c')
-rw-r--r-- | auth2.c | 23 |
1 files changed, 3 insertions, 20 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth2.c,v 1.102 2003/08/26 09:58:43 markus Exp $"); | 26 | RCSID("$OpenBSD: auth2.c,v 1.104 2003/11/04 08:54:09 djm Exp $"); |
27 | 27 | ||
28 | #include "ssh2.h" | 28 | #include "ssh2.h" |
29 | #include "xmalloc.h" | 29 | #include "xmalloc.h" |
@@ -45,8 +45,6 @@ extern ServerOptions options; | |||
45 | extern u_char *session_id2; | 45 | extern u_char *session_id2; |
46 | extern u_int session_id2_len; | 46 | extern u_int session_id2_len; |
47 | 47 | ||
48 | Authctxt *x_authctxt = NULL; | ||
49 | |||
50 | /* methods */ | 48 | /* methods */ |
51 | 49 | ||
52 | extern Authmethod method_none; | 50 | extern Authmethod method_none; |
@@ -79,19 +77,14 @@ static void input_userauth_request(int, u_int32_t, void *); | |||
79 | static Authmethod *authmethod_lookup(const char *); | 77 | static Authmethod *authmethod_lookup(const char *); |
80 | static char *authmethods_get(void); | 78 | static char *authmethods_get(void); |
81 | int user_key_allowed(struct passwd *, Key *); | 79 | int user_key_allowed(struct passwd *, Key *); |
82 | int hostbased_key_allowed(struct passwd *, const char *, char *, Key *); | ||
83 | 80 | ||
84 | /* | 81 | /* |
85 | * loop until authctxt->success == TRUE | 82 | * loop until authctxt->success == TRUE |
86 | */ | 83 | */ |
87 | 84 | ||
88 | Authctxt * | 85 | void |
89 | do_authentication2(void) | 86 | do_authentication2(Authctxt *authctxt) |
90 | { | 87 | { |
91 | Authctxt *authctxt = authctxt_new(); | ||
92 | |||
93 | x_authctxt = authctxt; /*XXX*/ | ||
94 | |||
95 | /* challenge-response is implemented via keyboard interactive */ | 88 | /* challenge-response is implemented via keyboard interactive */ |
96 | if (options.challenge_response_authentication) | 89 | if (options.challenge_response_authentication) |
97 | options.kbd_interactive_authentication = 1; | 90 | options.kbd_interactive_authentication = 1; |
@@ -99,8 +92,6 @@ do_authentication2(void) | |||
99 | dispatch_init(&dispatch_protocol_error); | 92 | dispatch_init(&dispatch_protocol_error); |
100 | dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request); | 93 | dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request); |
101 | dispatch_run(DISPATCH_BLOCK, &authctxt->success, authctxt); | 94 | dispatch_run(DISPATCH_BLOCK, &authctxt->success, authctxt); |
102 | |||
103 | return (authctxt); | ||
104 | } | 95 | } |
105 | 96 | ||
106 | static void | 97 | static void |
@@ -264,14 +255,6 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method) | |||
264 | } | 255 | } |
265 | } | 256 | } |
266 | 257 | ||
267 | /* get current user */ | ||
268 | |||
269 | struct passwd* | ||
270 | auth_get_user(void) | ||
271 | { | ||
272 | return (x_authctxt != NULL && x_authctxt->valid) ? x_authctxt->pw : NULL; | ||
273 | } | ||
274 | |||
275 | #define DELIM "," | 258 | #define DELIM "," |
276 | 259 | ||
277 | static char * | 260 | static char * |