diff options
Diffstat (limited to 'auth1.c')
-rw-r--r-- | auth1.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: auth1.c,v 1.70 2006/08/03 03:34:41 deraadt Exp $ */ | 1 | /* $OpenBSD: auth1.c,v 1.73 2008/07/04 23:30:16 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
4 | * All rights reserved | 4 | * All rights reserved |
@@ -20,6 +20,7 @@ | |||
20 | #include <unistd.h> | 20 | #include <unistd.h> |
21 | #include <pwd.h> | 21 | #include <pwd.h> |
22 | 22 | ||
23 | #include "openbsd-compat/sys-queue.h" | ||
23 | #include "xmalloc.h" | 24 | #include "xmalloc.h" |
24 | #include "rsa.h" | 25 | #include "rsa.h" |
25 | #include "ssh1.h" | 26 | #include "ssh1.h" |
@@ -283,6 +284,8 @@ do_authloop(Authctxt *authctxt) | |||
283 | type != SSH_CMSG_AUTH_TIS_RESPONSE) | 284 | type != SSH_CMSG_AUTH_TIS_RESPONSE) |
284 | abandon_challenge_response(authctxt); | 285 | abandon_challenge_response(authctxt); |
285 | 286 | ||
287 | if (authctxt->failures >= options.max_authtries) | ||
288 | goto skip; | ||
286 | if ((meth = lookup_authmethod1(type)) == NULL) { | 289 | if ((meth = lookup_authmethod1(type)) == NULL) { |
287 | logit("Unknown message during authentication: " | 290 | logit("Unknown message during authentication: " |
288 | "type %d", type); | 291 | "type %d", type); |
@@ -351,7 +354,7 @@ do_authloop(Authctxt *authctxt) | |||
351 | msg[len] = '\0'; | 354 | msg[len] = '\0'; |
352 | else | 355 | else |
353 | msg = "Access denied."; | 356 | msg = "Access denied."; |
354 | packet_disconnect(msg); | 357 | packet_disconnect("%s", msg); |
355 | } | 358 | } |
356 | #endif | 359 | #endif |
357 | 360 | ||
@@ -367,7 +370,7 @@ do_authloop(Authctxt *authctxt) | |||
367 | if (authenticated) | 370 | if (authenticated) |
368 | return; | 371 | return; |
369 | 372 | ||
370 | if (authctxt->failures++ > options.max_authtries) { | 373 | if (++authctxt->failures >= options.max_authtries) { |
371 | #ifdef SSH_AUDIT_EVENTS | 374 | #ifdef SSH_AUDIT_EVENTS |
372 | PRIVSEP(audit_event(SSH_LOGIN_EXCEED_MAXTRIES)); | 375 | PRIVSEP(audit_event(SSH_LOGIN_EXCEED_MAXTRIES)); |
373 | #endif | 376 | #endif |