IASECC/CPX: Avoid APDU Incorrect Parameters
Without this patch, we would get from the logs: Outgoing APDU (18 bytes): 00 A4 04 00 0D E8 28 BD 08 0F 80 25 00 00 01 FF ......(....%.... 00 10 .. [opensc-pkcs11] reader-pcsc.c:242:pcsc_internal_transmit: called [opensc-pkcs11] reader-pcsc.c:333:pcsc_transmit: Incoming APDU (2 bytes): 6A 86 j. [opensc-pkcs11] apdu.c:382:sc_single_transmit: returning with: 0 (Success) [opensc-pkcs11] apdu.c:537:sc_transmit: returning with: 0 (Success) [opensc-pkcs11] card.c:523:sc_unlock: called [opensc-pkcs11] iso7816.c:128:iso7816_check_sw: Incorrect parameters P1-P2 [opensc-pkcs11] card-iasecc.c:1064:iasecc_select_file: Warning: SC_ERROR_INCORRECT_PARAMETERS for SC_PATH_TYPE_DF_NAME, try again with P2=0x0C [opensc-pkcs11] apdu.c:548:sc_transmit_apdu: called [opensc-pkcs11] card.c:473:sc_lock: called [opensc-pkcs11] card.c:513:sc_lock: returning with: 0 (Success) [opensc-pkcs11] apdu.c:515:sc_transmit: called [opensc-pkcs11] apdu.c:363:sc_single_transmit: called [opensc-pkcs11] apdu.c:367:sc_single_transmit: CLA:0, INS:A4, P1:4, P2:C, data(13) 0x7fff4b339b20 [opensc-pkcs11] reader-pcsc.c:323:pcsc_transmit: reader 'Ingenico TL TELIUM (25005334) 00 02' [opensc-pkcs11] reader-pcsc.c:324:pcsc_transmit: Outgoing APDU (18 bytes): 00 A4 04 0C 0D E8 28 BD 08 0F 80 25 00 00 01 FF ......(....%.... 00 10 .. [opensc-pkcs11] reader-pcsc.c:242:pcsc_internal_transmit: called [opensc-pkcs11] reader-pcsc.c:333:pcsc_transmit: Incoming APDU (2 bytes): 90 00 .. Let's align it with the behaviour of the other IASECC cards.
This commit is contained in:
parent
0df0f80b55
commit
1a3666364d
|
@ -1037,7 +1037,8 @@ iasecc_select_file(struct sc_card *card, const struct sc_path *path,
|
|||
apdu.p1 = 0x04;
|
||||
if (card->type == SC_CARD_TYPE_IASECC_AMOS ||
|
||||
card->type == SC_CARD_TYPE_IASECC_MI2 ||
|
||||
card->type == SC_CARD_TYPE_IASECC_OBERTHUR) {
|
||||
card->type == SC_CARD_TYPE_IASECC_OBERTHUR ||
|
||||
iasecc_is_cpx(card)) {
|
||||
apdu.p2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue