summaryrefslogtreecommitdiff
path: root/auth2-chall.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2004-11-28 12:31:03 +0000
committerColin Watson <cjwatson@debian.org>2004-11-28 12:31:03 +0000
commit9ebd617cc085a14c1a197f140b037a3679ba3e2e (patch)
tree2250f61f7e87ee984ca9b8c3d47b63c283c072f3 /auth2-chall.c
parent4ce1a4433f9ee75c4c5508db6e499db725882887 (diff)
Fix timing information leak allowing discovery of invalid usernames in PAM
keyboard-interactive authentication (backported from a patch by Darren Tucker; closes: #281595).
Diffstat (limited to 'auth2-chall.c')
-rw-r--r--auth2-chall.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/auth2-chall.c b/auth2-chall.c
index aacbf0bcc..0f08b05c6 100644
--- a/auth2-chall.c
+++ b/auth2-chall.c
@@ -275,12 +275,9 @@ input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
275 } 275 }
276 packet_check_eom(); 276 packet_check_eom();
277 277
278 if (authctxt->valid) { 278 res = kbdintctxt->device->respond(kbdintctxt->ctxt, nresp, response);
279 res = kbdintctxt->device->respond(kbdintctxt->ctxt, 279 if (!authctxt->valid)
280 nresp, response); 280 res = 1; /* keep going if login invalid */
281 } else {
282 res = -1;
283 }
284 281
285 for (i = 0; i < nresp; i++) { 282 for (i = 0; i < nresp; i++) {
286 memset(response[i], 'r', strlen(response[i])); 283 memset(response[i], 'r', strlen(response[i]));
@@ -292,7 +289,7 @@ input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
292 switch (res) { 289 switch (res) {
293 case 0: 290 case 0:
294 /* Success! */ 291 /* Success! */
295 authenticated = 1; 292 authenticated = authctxt->valid ? 1 : 0;
296 break; 293 break;
297 case 1: 294 case 1:
298 /* Authentication needs further interaction */ 295 /* Authentication needs further interaction */