summaryrefslogtreecommitdiff
path: root/auth2.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2015-08-19 14:23:51 +0100
committerColin Watson <cjwatson@debian.org>2015-08-19 16:48:11 +0100
commit0f0841b2d28b7463267d4d91577e72e3340a1d3a (patch)
treeba55fcd2b6e2cc22b30f5afb561dbb3da4c8b6c7 /auth2.c
parentf2a5f5dae656759efb0b76c3d94890b65c197a02 (diff)
parent8698446b972003b63dfe5dcbdb86acfe986afb85 (diff)
New upstream release (6.8p1).
Diffstat (limited to 'auth2.c')
-rw-r--r--auth2.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/auth2.c b/auth2.c
index fa1a5886d..6eb3cc7b9 100644
--- a/auth2.c
+++ b/auth2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2.c,v 1.132 2014/07/15 15:54:14 millert Exp $ */ 1/* $OpenBSD: auth2.c,v 1.135 2015/01/19 20:07:45 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -89,8 +89,8 @@ Authmethod *authmethods[] = {
89 89
90/* protocol */ 90/* protocol */
91 91
92static void input_service_request(int, u_int32_t, void *); 92static int input_service_request(int, u_int32_t, void *);
93static void input_userauth_request(int, u_int32_t, void *); 93static int input_userauth_request(int, u_int32_t, void *);
94 94
95/* helper */ 95/* helper */
96static Authmethod *authmethod_lookup(Authctxt *, const char *); 96static Authmethod *authmethod_lookup(Authctxt *, const char *);
@@ -153,9 +153,7 @@ userauth_banner(void)
153{ 153{
154 char *banner = NULL; 154 char *banner = NULL;
155 155
156 if (options.banner == NULL || 156 if (options.banner == NULL || (datafellows & SSH_BUG_BANNER) != 0)
157 strcasecmp(options.banner, "none") == 0 ||
158 (datafellows & SSH_BUG_BANNER) != 0)
159 return; 157 return;
160 158
161 if ((banner = PRIVSEP(auth2_read_banner())) == NULL) 159 if ((banner = PRIVSEP(auth2_read_banner())) == NULL)
@@ -178,7 +176,7 @@ do_authentication2(Authctxt *authctxt)
178} 176}
179 177
180/*ARGSUSED*/ 178/*ARGSUSED*/
181static void 179static int
182input_service_request(int type, u_int32_t seq, void *ctxt) 180input_service_request(int type, u_int32_t seq, void *ctxt)
183{ 181{
184 Authctxt *authctxt = ctxt; 182 Authctxt *authctxt = ctxt;
@@ -209,10 +207,11 @@ input_service_request(int type, u_int32_t seq, void *ctxt)
209 packet_disconnect("bad service request %s", service); 207 packet_disconnect("bad service request %s", service);
210 } 208 }
211 free(service); 209 free(service);
210 return 0;
212} 211}
213 212
214/*ARGSUSED*/ 213/*ARGSUSED*/
215static void 214static int
216input_userauth_request(int type, u_int32_t seq, void *ctxt) 215input_userauth_request(int type, u_int32_t seq, void *ctxt)
217{ 216{
218 Authctxt *authctxt = ctxt; 217 Authctxt *authctxt = ctxt;
@@ -294,6 +293,7 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt)
294 free(service); 293 free(service);
295 free(user); 294 free(user);
296 free(method); 295 free(method);
296 return 0;
297} 297}
298 298
299void 299void
@@ -364,7 +364,7 @@ userauth_finish(Authctxt *authctxt, int authenticated, const char *method,
364 } else { 364 } else {
365 365
366 /* Allow initial try of "none" auth without failure penalty */ 366 /* Allow initial try of "none" auth without failure penalty */
367 if (!authctxt->server_caused_failure && 367 if (!partial && !authctxt->server_caused_failure &&
368 (authctxt->attempt > 1 || strcmp(method, "none") != 0)) 368 (authctxt->attempt > 1 || strcmp(method, "none") != 0))
369 authctxt->failures++; 369 authctxt->failures++;
370 if (authctxt->failures >= options.max_authtries) { 370 if (authctxt->failures >= options.max_authtries) {