IASECC: log any APDU Incorrect parameters

From the logs, we can detect many 6A 86 (Incorrect P1 or P2 paremeters).
A deeper analysis will be required, but the best option to check them
is to start emitting any Warning for such events.
This commit is contained in:
Vincent JARDIN 2021-03-28 09:51:25 +00:00 committed by Frank Morgner
parent b9c0addf88
commit 0df0f80b55
1 changed files with 1 additions and 0 deletions

View File

@ -1061,6 +1061,7 @@ iasecc_select_file(struct sc_card *card, const struct sc_path *path,
rv = sc_check_sw(card, apdu.sw1, apdu.sw2);
if (rv == SC_ERROR_INCORRECT_PARAMETERS &&
lpath.type == SC_PATH_TYPE_DF_NAME && apdu.p2 == 0x00) {
sc_log(ctx, "Warning: SC_ERROR_INCORRECT_PARAMETERS for SC_PATH_TYPE_DF_NAME, try again with P2=0x0C");
apdu.p2 = 0x0C;
continue;
}