diff options
author | Damien Miller <djm@mindrot.org> | 2002-01-22 23:24:13 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-01-22 23:24:13 +1100 |
commit | 7d05339c709efbf699e0dae499308428174a0da4 (patch) | |
tree | 22bbfa5480faa991511831b4c8aa5846267a27f4 /auth2.c | |
parent | 84b8ab3eeef42818e20d2b46627245fe450082ab (diff) |
- markus@cvs.openbsd.org 2002/01/11 13:39:36
[auth2.c dispatch.c dispatch.h kex.c]
a single dispatch_protocol_error() that sends a message of type 'UNIMPLEMENTED'
dispatch_range(): set handler for a ranges message types
use dispatch_protocol_ignore() for authentication requests after
successful authentication (the drafts requirement).
serverloop/clientloop now send a 'UNIMPLEMENTED' message instead of exiting.
Diffstat (limited to 'auth2.c')
-rw-r--r-- | auth2.c | 17 |
1 files changed, 3 insertions, 14 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth2.c,v 1.80 2001/12/28 15:06:00 markus Exp $"); | 26 | RCSID("$OpenBSD: auth2.c,v 1.81 2002/01/11 13:39:36 markus Exp $"); |
27 | 27 | ||
28 | #include <openssl/evp.h> | 28 | #include <openssl/evp.h> |
29 | 29 | ||
@@ -71,7 +71,6 @@ struct Authmethod { | |||
71 | 71 | ||
72 | static void input_service_request(int, u_int32_t, void *); | 72 | static void input_service_request(int, u_int32_t, void *); |
73 | static void input_userauth_request(int, u_int32_t, void *); | 73 | static void input_userauth_request(int, u_int32_t, void *); |
74 | static void protocol_error(int, u_int32_t, void *); | ||
75 | 74 | ||
76 | /* helper */ | 75 | /* helper */ |
77 | static Authmethod *authmethod_lookup(const char *); | 76 | static Authmethod *authmethod_lookup(const char *); |
@@ -123,23 +122,13 @@ do_authentication2(void) | |||
123 | if (options.pam_authentication_via_kbd_int) | 122 | if (options.pam_authentication_via_kbd_int) |
124 | options.kbd_interactive_authentication = 1; | 123 | options.kbd_interactive_authentication = 1; |
125 | 124 | ||
126 | dispatch_init(&protocol_error); | 125 | dispatch_init(&dispatch_protocol_error); |
127 | dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request); | 126 | dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request); |
128 | dispatch_run(DISPATCH_BLOCK, &authctxt->success, authctxt); | 127 | dispatch_run(DISPATCH_BLOCK, &authctxt->success, authctxt); |
129 | do_authenticated(authctxt); | 128 | do_authenticated(authctxt); |
130 | } | 129 | } |
131 | 130 | ||
132 | static void | 131 | static void |
133 | protocol_error(int type, u_int32_t seq, void *ctxt) | ||
134 | { | ||
135 | log("auth: protocol error: type %d", type); | ||
136 | packet_start(SSH2_MSG_UNIMPLEMENTED); | ||
137 | packet_put_int(seq); | ||
138 | packet_send(); | ||
139 | packet_write_wait(); | ||
140 | } | ||
141 | |||
142 | static void | ||
143 | input_service_request(int type, u_int32_t seq, void *ctxt) | 132 | input_service_request(int type, u_int32_t seq, void *ctxt) |
144 | { | 133 | { |
145 | Authctxt *authctxt = ctxt; | 134 | Authctxt *authctxt = ctxt; |
@@ -265,7 +254,7 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method) | |||
265 | /* XXX todo: check if multiple auth methods are needed */ | 254 | /* XXX todo: check if multiple auth methods are needed */ |
266 | if (authenticated == 1) { | 255 | if (authenticated == 1) { |
267 | /* turn off userauth */ | 256 | /* turn off userauth */ |
268 | dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &protocol_error); | 257 | dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &dispatch_protocol_ignore); |
269 | packet_start(SSH2_MSG_USERAUTH_SUCCESS); | 258 | packet_start(SSH2_MSG_USERAUTH_SUCCESS); |
270 | packet_send(); | 259 | packet_send(); |
271 | packet_write_wait(); | 260 | packet_write_wait(); |