Skip to content

Commit

Permalink
lib: Add support for not returning PIN when using bio verification
Browse files Browse the repository at this point in the history
  • Loading branch information
aveenismail committed Aug 28, 2024
1 parent b9fc20c commit 3d19b50
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/ykpiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,8 @@ static ykpiv_rc _ykpiv_verify(ykpiv_state *state, char *pin, size_t *p_pin_len,
else if (bio) {
memcpy(apdu.st.data, "\x02\x00", 2);
}
} else {
memcpy(apdu.st.data, "\x03\x00", 2);
}

int sw = 0;
Expand Down Expand Up @@ -1643,9 +1645,13 @@ static ykpiv_rc _ykpiv_verify(ykpiv_state *state, char *pin, size_t *p_pin_len,

static ykpiv_rc _ykpiv_verify_select(ykpiv_state *state, char *pin, size_t* p_pin_len, int *tries, bool force_select, bool bio, bool verify_spin) {
ykpiv_rc res = YKPIV_OK;
if (YKPIV_OK != (res = _ykpiv_begin_transaction(state))) return res;
if (YKPIV_OK != (res = _ykpiv_begin_transaction(state))) {
return res;
}
if (force_select) {
if (YKPIV_OK != (res = _ykpiv_ensure_application_selected(state))) goto Cleanup;
if (YKPIV_OK != (res = _ykpiv_ensure_application_selected(state))) {
goto Cleanup;
}
}
res = _ykpiv_verify(state, pin, p_pin_len, bio, verify_spin);
if(tries) *tries = state->tries;
Expand Down

0 comments on commit 3d19b50

Please sign in to comment.