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 Dec 6, 2023
1 parent f83744a commit 61a36c6
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 @@ -170,7 +170,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 61a36c6

Please sign in to comment.