Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

card-piv.c - Card matching fix for unknown card #3112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/libopensc/card-piv.c
Original file line number Diff line number Diff line change
Expand Up @@ -5468,9 +5468,16 @@ static int piv_match_card_continued(sc_card_t *card)
* Will fail for other reasons if wrong applet is selected or bad PIV implementation.
*/

/* first test if PIV is active applet without using AID If fails use the AID */
/*
* if ATR matched or user forced card type
* test if PIV is active applet without using AID If fails use the AID
*/

if (card->type != SC_CARD_TYPE_PIV_II_BASE)
r = piv_find_discovery(card);
else
r = SC_CARD_TYPE_UNKNOWN;

r = piv_find_discovery(card);
if (r < 0) {
piv_obj_cache_free_entry(card, PIV_OBJ_DISCOVERY, 0); /* don't cache on failure */
r = piv_find_aid(card);
Expand Down