version 1.36.2.1, 2013/11/08 05:52:21 |
version 1.37, 2013/03/07 19:27:25 |
|
|
Buffer b; |
Buffer b; |
int i; |
int i; |
|
|
kbdintctxt = xcalloc(1, sizeof(KbdintAuthctxt)); |
kbdintctxt = xmalloc(sizeof(KbdintAuthctxt)); |
if (strcmp(devs, "") == 0) { |
if (strcmp(devs, "") == 0) { |
buffer_init(&b); |
buffer_init(&b); |
for (i = 0; devices[i]; i++) { |
for (i = 0; devices[i]; i++) { |
|
|
} |
} |
/* get next device */ |
/* get next device */ |
static int |
static int |
kbdint_next_device(KbdintAuthctxt *kbdintctxt) |
kbdint_next_device(Authctxt *authctxt, KbdintAuthctxt *kbdintctxt) |
{ |
{ |
size_t len; |
size_t len; |
char *t; |
char *t; |
|
|
|
|
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, |
|
"keyboard-interactive", devices[i]->name)) |
|
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]; |
|
} |
t = kbdintctxt->devices; |
t = kbdintctxt->devices; |
kbdintctxt->devices = t[len] ? xstrdup(t+len+1) : NULL; |
kbdintctxt->devices = t[len] ? xstrdup(t+len+1) : NULL; |
xfree(t); |
xfree(t); |
|
|
debug2("auth2_challenge_start: devices %s", |
debug2("auth2_challenge_start: devices %s", |
kbdintctxt->devices ? kbdintctxt->devices : "<empty>"); |
kbdintctxt->devices ? kbdintctxt->devices : "<empty>"); |
|
|
if (kbdint_next_device(kbdintctxt) == 0) { |
if (kbdint_next_device(authctxt, kbdintctxt) == 0) { |
auth2_challenge_stop(authctxt); |
auth2_challenge_stop(authctxt); |
return 0; |
return 0; |
} |
} |