Add criteria to check if card capability SC_CARD_CAP_PROTECTED_AUTHENTICATION_PATH is available

The code segment checks the response to determine if the
SC_CARD_CAP_PROTECTED_AUTHENTICATION_PATH is available.
From the APDU manual of the sc-hsm, there's one status word:
SC_ERROR_REF_DATA_NOT_USABLE(0x6984) that should also be taken into account.
This commit is contained in:
yehj 2021-03-12 12:02:49 +08:00 committed by Frank Morgner
parent 83162c5c87
commit c3c5f2d518
1 changed files with 1 additions and 1 deletions

View File

@ -1026,7 +1026,7 @@ static int sc_pkcs15emu_sc_hsm_init (sc_pkcs15_card_t * p15card)
r = sc_pin_cmd(card, &pindata, NULL);
}
if ((r != SC_ERROR_DATA_OBJECT_NOT_FOUND) && (r != SC_ERROR_INCORRECT_PARAMETERS))
if ((r != SC_ERROR_DATA_OBJECT_NOT_FOUND) && (r != SC_ERROR_INCORRECT_PARAMETERS) && (r != SC_ERROR_REF_DATA_NOT_USABLE))
card->caps |= SC_CARD_CAP_PROTECTED_AUTHENTICATION_PATH;