summaryrefslogtreecommitdiff
path: root/auth2.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth2.c')
-rw-r--r--auth2.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/auth2.c b/auth2.c
index 0b4df9cda..554ca4c10 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.61 2001/05/31 10:30:12 markus Exp $"); 26RCSID("$OpenBSD: auth2.c,v 1.62 2001/06/07 19:57:53 markus Exp $");
27 27
28#include <openssl/evp.h> 28#include <openssl/evp.h>
29 29
@@ -219,14 +219,12 @@ input_userauth_request(int type, int plen, void *ctxt)
219 setproctitle("%s", pw ? user : "unknown"); 219 setproctitle("%s", pw ? user : "unknown");
220 authctxt->user = xstrdup(user); 220 authctxt->user = xstrdup(user);
221 authctxt->service = xstrdup(service); 221 authctxt->service = xstrdup(service);
222 authctxt->style = style ? xstrdup(style) : NULL; /* currently unused */ 222 authctxt->style = style ? xstrdup(style) : NULL;
223 } else if (authctxt->valid) { 223 } else if (strcmp(user, authctxt->user) != 0 ||
224 if (strcmp(user, authctxt->user) != 0 || 224 strcmp(service, authctxt->service) != 0) {
225 strcmp(service, authctxt->service) != 0) { 225 packet_disconnect("Change of username or service not allowed: "
226 log("input_userauth_request: mismatch: (%s,%s)!=(%s,%s)", 226 "(%s,%s) -> (%s,%s)",
227 user, service, authctxt->user, authctxt->service); 227 authctxt->user, authctxt->service, user, service);
228 authctxt->valid = 0;
229 }
230 } 228 }
231 /* reset state */ 229 /* reset state */
232 dispatch_set(SSH2_MSG_USERAUTH_INFO_RESPONSE, &protocol_error); 230 dispatch_set(SSH2_MSG_USERAUTH_INFO_RESPONSE, &protocol_error);