Skip to content

Commit

Permalink
PAM: Fail empty password in passkey fallback
Browse files Browse the repository at this point in the history
We can assume in this fallback chain that an empty password
is not allowed.

Reviewed-by: Iker Pedrosa <[email protected]>
Reviewed-by: Sumit Bose <[email protected]>
  • Loading branch information
justin-stephenson authored and pbrezina committed Jul 24, 2023
1 parent d019132 commit 43d89dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sss_client/pam_sss.c
Original file line number Diff line number Diff line change
Expand Up @@ -2549,6 +2549,11 @@ static int get_authtok_for_authentication(pam_handle_t *pamh,
/* Fallback to password auth if no PIN was entered */
if (ret == EIO) {
ret = prompt_password(pamh, pi, _("Password: "));
if (pi->pam_authtok_size == 0) {
D(("Empty password failure"));
pi->passkey_prompt_pin = NULL;
return PAM_AUTHTOK_ERR;
}
}
} else {
ret = prompt_password(pamh, pi, _("Password: "));
Expand Down

0 comments on commit 43d89dd

Please sign in to comment.