SC-HSM: Don't block generic contactless ATR

This commit is contained in:
Frank Morgner 2017-11-29 14:18:09 +01:00
parent 804ac2b7f2
commit 3e7f7e632c
2 changed files with 11 additions and 5 deletions

View File

@ -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;
}

View File

@ -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}},