Skip to content

Commit

Permalink
SC-HSM: Don't block generic contactless ATR
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmorgner committed Dec 4, 2017
1 parent 804ac2b commit 3e7f7e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/libopensc/card-sc-hsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,23 @@ static int sc_hsm_select_file(sc_card_t *card,
static int sc_hsm_match_card(struct sc_card *card)
{
sc_path_t path;
int i, r;
int i, r, type = 0;

i = _sc_match_atr(card, sc_hsm_atrs, &card->type);
if (i >= 0)
i = _sc_match_atr(card, sc_hsm_atrs, &type);
if (i >= 0 && type != SC_CARD_TYPE_SC_HSM_SOC) {
card->type = type;
return 1;
}

sc_path_set(&path, SC_PATH_TYPE_DF_NAME, sc_hsm_aid.value, sc_hsm_aid.len, 0, 0);
r = sc_hsm_select_file(card, &path, NULL);
LOG_TEST_RET(card->ctx, r, "Could not select SmartCard-HSM application");

card->type = SC_CARD_TYPE_SC_HSM;
if (type == SC_CARD_TYPE_SC_HSM_SOC) {
card->type = SC_CARD_TYPE_SC_HSM_SOC;
} else {
card->type = SC_CARD_TYPE_SC_HSM;
}

return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion win32/customactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ MD_REGISTRATION minidriver_registration[] = {
24, {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}},
{TEXT("SmartCard-HSM-CL"), {0x3B,0x8E,0x80,0x01,0x80,0x31,0x81,0x54,0x48,0x53,0x4D,0x31,0x73,0x80,0x21,0x40,0x81,0x07,0x18},
19, {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}},
{TEXT("SmartCard-HSM-FP"), {0x3B,0x80,0x80,0x01,0x01},
{TEXT("Contactless Smart Card"), {0x3B,0x80,0x80,0x01,0x01},
5, {0xff,0xff,0xff,0xff,0xff}},
{TEXT("GoID"), {0x3B,0x84,0x80,0x01,0x47,0x6f,0x49,0x44,0x00},
9, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00}},
Expand Down

0 comments on commit 3e7f7e6

Please sign in to comment.