fixed checking SW in iso7816_read_binary_sfid
fixes https://github.com/OpenSC/OpenSC/issues/1360
This commit is contained in:
parent
01f712d5da
commit
ae31408f81
|
@ -1320,9 +1320,13 @@ int iso7816_read_binary_sfid(sc_card_t *card, unsigned char sfid,
|
||||||
apdu.le = read;
|
apdu.le = read;
|
||||||
|
|
||||||
r = sc_transmit_apdu(card, &apdu);
|
r = sc_transmit_apdu(card, &apdu);
|
||||||
|
if (r < 0)
|
||||||
|
goto err;
|
||||||
|
r = sc_check_sw(card, apdu.sw1, apdu.sw2);
|
||||||
|
if (r < 0 && r != SC_ERROR_FILE_END_REACHED)
|
||||||
|
goto err;
|
||||||
/* emulate the behaviour of sc_read_binary */
|
/* emulate the behaviour of sc_read_binary */
|
||||||
if (r >= 0)
|
r = apdu.resplen;
|
||||||
r = apdu.resplen;
|
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
if (r >= 0 && ((size_t) r) != read) {
|
if (r >= 0 && ((size_t) r) != read) {
|
||||||
|
|
Loading…
Reference in New Issue