Fix ExchangeAPDUSC() in cmdsmartcard.c

It doesn't return 1 if the retry fails, which is different from the
behavior of the first try.
This commit is contained in:
wh201906 2023-11-24 22:18:06 +08:00
commit 493383c995
No known key found for this signature in database

View file

@ -1417,6 +1417,10 @@ int ExchangeAPDUSC(bool verbose, uint8_t *datain, int datainlen, bool activateCa
SendCommandNG(CMD_SMART_RAW, (uint8_t *)payload, sizeof(smart_card_raw_t) + 5); SendCommandNG(CMD_SMART_RAW, (uint8_t *)payload, sizeof(smart_card_raw_t) + 5);
datain[4] = 0; datain[4] = 0;
len = smart_responseEx(dataout, maxdataoutlen, verbose); len = smart_responseEx(dataout, maxdataoutlen, verbose);
if (len < 0) {
free(payload);
return 1;
}
} }
free(payload); free(payload);