upstream commit
only query each keyboard-interactive device once per authentication request regardless of how many times it is listed; ok markus@ Upstream-ID: d73fafba6e86030436ff673656ec1f33d9ffeda1
This commit is contained in:
parent
cd7324d066
commit
5b64f85bb8
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: auth2-chall.c,v 1.42 2015/01/19 20:07:45 markus Exp $ */
|
/* $OpenBSD: auth2-chall.c,v 1.43 2015/07/18 07:57:14 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Markus Friedl. All rights reserved.
|
* Copyright (c) 2001 Markus Friedl. All rights reserved.
|
||||||
* Copyright (c) 2001 Per Allansson. All rights reserved.
|
* Copyright (c) 2001 Per Allansson. All rights reserved.
|
||||||
|
@ -83,6 +83,7 @@ struct KbdintAuthctxt
|
||||||
void *ctxt;
|
void *ctxt;
|
||||||
KbdintDevice *device;
|
KbdintDevice *device;
|
||||||
u_int nreq;
|
u_int nreq;
|
||||||
|
u_int devices_done;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_PAM
|
#ifdef USE_PAM
|
||||||
|
@ -169,11 +170,15 @@ kbdint_next_device(Authctxt *authctxt, KbdintAuthctxt *kbdintctxt)
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
break;
|
break;
|
||||||
for (i = 0; devices[i]; i++) {
|
for (i = 0; devices[i]; i++) {
|
||||||
if (!auth2_method_allowed(authctxt,
|
if ((kbdintctxt->devices_done & (1 << i)) != 0 ||
|
||||||
|
!auth2_method_allowed(authctxt,
|
||||||
"keyboard-interactive", devices[i]->name))
|
"keyboard-interactive", devices[i]->name))
|
||||||
continue;
|
continue;
|
||||||
if (strncmp(kbdintctxt->devices, devices[i]->name, len) == 0)
|
if (strncmp(kbdintctxt->devices, devices[i]->name,
|
||||||
|
len) == 0) {
|
||||||
kbdintctxt->device = devices[i];
|
kbdintctxt->device = devices[i];
|
||||||
|
kbdintctxt->devices_done |= 1 << i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
t = kbdintctxt->devices;
|
t = kbdintctxt->devices;
|
||||||
kbdintctxt->devices = t[len] ? xstrdup(t+len+1) : NULL;
|
kbdintctxt->devices = t[len] ? xstrdup(t+len+1) : NULL;
|
||||||
|
|
Loading…
Reference in New Issue