Skip to content

Commit

Permalink
auth2-chall: Fix selection of the keyboard-interactive device
Browse files Browse the repository at this point in the history
We were only checking if the prefix of a device name was matching what
we had in the devices list, so if the device list contained "pam", then
also the device "pam-foo" was matching.
  • Loading branch information
3v1n0 committed Oct 17, 2023
1 parent 45d424a commit e007e0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion auth2-chall.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ kbdint_next_device(Authctxt *authctxt, KbdintAuthctxt *kbdintctxt)
"keyboard-interactive", devices[i]->name))
continue;
if (strncmp(kbdintctxt->devices, devices[i]->name,
len) == 0) {
len) == 0 && strlen(devices[i]->name) == len) {
kbdintctxt->device = devices[i];
kbdintctxt->devices_done |= 1 << i;
}
Expand Down

0 comments on commit e007e0c

Please sign in to comment.