Skip to content

Commit

Permalink
Update pam_p11.c - key_login always succeed
Browse files Browse the repository at this point in the history
key_login always succeed even if PIN input was incorrect. r = PAM_SUCCESS prior to key_login and didn't get changed to a failure if key_login failed.
  • Loading branch information
archxlith authored Oct 25, 2023
1 parent ba24317 commit eadb0a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pam_p11.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,10 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t * pamh, int flags, int argc,
goto err;
}

if (1 != key_login(pamh, flags, authslot, pin_regex))
if (1 != key_login(pamh, flags, authslot, pin_regex)) {
r = PAM_AUTH_ERR;
goto err;
}

if (authkey == NULL && authcert) {
if (NULL == (authkey = PKCS11_find_key(authcert))) {
Expand Down

0 comments on commit eadb0a2

Please sign in to comment.