mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
simplify logic
This commit is contained in:
+5
-4
@@ -3113,10 +3113,12 @@ int iso14_apdu(uint8_t *cmd, uint16_t cmd_len, bool send_chaining, void *data, u
|
||||
size_t len = ReaderReceive(data, data_len, parity_array);
|
||||
uint8_t *data_bytes = (uint8_t *) data;
|
||||
|
||||
if (!len) {
|
||||
if (len == 0) {
|
||||
BigBuf_free();
|
||||
return 0; // DATA LINK ERROR
|
||||
} else {
|
||||
}
|
||||
|
||||
|
||||
// S-Block WTX
|
||||
while (len && ((data_bytes[0] & 0xF2) == 0xF2)) {
|
||||
uint32_t save_iso14a_timeout = iso14a_get_timeout();
|
||||
@@ -3130,6 +3132,7 @@ int iso14_apdu(uint8_t *cmd, uint16_t cmd_len, bool send_chaining, void *data, u
|
||||
// transmit S-Block
|
||||
ReaderTransmit(data_bytes, len, NULL);
|
||||
// retrieve the result again (with increased timeout)
|
||||
data_bytes[0] = 0x00;
|
||||
len = ReaderReceive(data, data_len, parity_array);
|
||||
data_bytes = data;
|
||||
// restore timeout
|
||||
@@ -3156,8 +3159,6 @@ int iso14_apdu(uint8_t *cmd, uint16_t cmd_len, bool send_chaining, void *data, u
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (len) {
|
||||
// cut frame byte
|
||||
len -= 1;
|
||||
|
||||
Reference in New Issue
Block a user