summaryrefslogtreecommitdiff
path: root/auth2.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth2.c')
-rw-r--r--auth2.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/auth2.c b/auth2.c
index 41e77efdc..a9490ccfd 100644
--- a/auth2.c
+++ b/auth2.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2.c,v 1.102 2003/08/26 09:58:43 markus Exp $"); 26RCSID("$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;
45extern u_char *session_id2; 45extern u_char *session_id2;
46extern u_int session_id2_len; 46extern u_int session_id2_len;
47 47
48Authctxt *x_authctxt = NULL;
49
50/* methods */ 48/* methods */
51 49
52extern Authmethod method_none; 50extern Authmethod method_none;
@@ -79,19 +77,14 @@ static void input_userauth_request(int, u_int32_t, void *);
79static Authmethod *authmethod_lookup(const char *); 77static Authmethod *authmethod_lookup(const char *);
80static char *authmethods_get(void); 78static char *authmethods_get(void);
81int user_key_allowed(struct passwd *, Key *); 79int user_key_allowed(struct passwd *, Key *);
82int 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
88Authctxt * 85void
89do_authentication2(void) 86do_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
106static void 97static void
@@ -264,14 +255,6 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method)
264 } 255 }
265} 256}
266 257
267/* get current user */
268
269struct passwd*
270auth_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
277static char * 260static char *