mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
Better Reply structs
This commit is contained in:
parent
64eb93c9c4
commit
533667ea6d
57 changed files with 725 additions and 718 deletions
|
@ -228,15 +228,15 @@ static int CmdHF14AList(const char *Cmd) {
|
|||
}
|
||||
|
||||
int Hf14443_4aGetCardData(iso14a_card_select_t *card) {
|
||||
UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT, 0, 0}, {{0}}};
|
||||
UsbCommandOLD c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT, 0, 0}, {{0}}};
|
||||
SendCommand(&c);
|
||||
|
||||
UsbReplyNG resp;
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
|
||||
memcpy(card, (iso14a_card_select_t *)resp.core.old.d.asBytes, sizeof(iso14a_card_select_t));
|
||||
memcpy(card, (iso14a_card_select_t *)resp.data.asBytes, sizeof(iso14a_card_select_t));
|
||||
|
||||
uint64_t select_status = resp.core.old.arg[0]; // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS, 3: proprietary Anticollision
|
||||
uint64_t select_status = resp.oldarg[0]; // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS, 3: proprietary Anticollision
|
||||
|
||||
if (select_status == 0) {
|
||||
PrintAndLogEx(ERR, "E->iso14443a card select failed");
|
||||
|
@ -256,7 +256,7 @@ int Hf14443_4aGetCardData(iso14a_card_select_t *card) {
|
|||
|
||||
PrintAndLogEx(NORMAL, " UID: %s", sprint_hex(card->uid, card->uidlen));
|
||||
PrintAndLogEx(NORMAL, "ATQA: %02x %02x", card->atqa[1], card->atqa[0]);
|
||||
PrintAndLogEx(NORMAL, " SAK: %02x [%" PRIu64 "]", card->sak, resp.core.old.arg[0]);
|
||||
PrintAndLogEx(NORMAL, " SAK: %02x [%" PRIu64 "]", card->sak, resp.oldarg[0]);
|
||||
if (card->ats_len < 3) { // a valid ATS consists of at least the length byte (TL) and 2 CRC bytes
|
||||
PrintAndLogEx(NORMAL, "E-> Error ATS length(%d) : %s", card->ats_len, sprint_hex(card->ats, card->ats_len));
|
||||
return 1;
|
||||
|
@ -298,7 +298,7 @@ static int CmdHF14AReader(const char *Cmd) {
|
|||
if (!disconnectAfter)
|
||||
cm |= ISO14A_NO_DISCONNECT;
|
||||
|
||||
UsbCommand c = {CMD_READER_ISO_14443a, {cm, 0, 0}, {{0}}};
|
||||
UsbCommandOLD c = {CMD_READER_ISO_14443a, {cm, 0, 0}, {{0}}};
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
|
||||
|
@ -311,7 +311,7 @@ static int CmdHF14AReader(const char *Cmd) {
|
|||
}
|
||||
|
||||
iso14a_card_select_t card;
|
||||
memcpy(&card, (iso14a_card_select_t *)resp.core.old.d.asBytes, sizeof(iso14a_card_select_t));
|
||||
memcpy(&card, (iso14a_card_select_t *)resp.data.asBytes, sizeof(iso14a_card_select_t));
|
||||
|
||||
/*
|
||||
0: couldn't read
|
||||
|
@ -319,7 +319,7 @@ static int CmdHF14AReader(const char *Cmd) {
|
|||
2: OK, no ATS
|
||||
3: proprietary Anticollision
|
||||
*/
|
||||
uint64_t select_status = resp.core.old.arg[0];
|
||||
uint64_t select_status = resp.oldarg[0];
|
||||
|
||||
if (select_status == 0) {
|
||||
if (!silent) PrintAndLogEx(WARNING, "iso14443a card select failed");
|
||||
|
@ -336,7 +336,7 @@ static int CmdHF14AReader(const char *Cmd) {
|
|||
|
||||
PrintAndLogEx(NORMAL, " UID : %s", sprint_hex(card.uid, card.uidlen));
|
||||
PrintAndLogEx(NORMAL, "ATQA : %02x %02x", card.atqa[1], card.atqa[0]);
|
||||
PrintAndLogEx(NORMAL, " SAK : %02x [%" PRIu64 "]", card.sak, resp.core.old.arg[0]);
|
||||
PrintAndLogEx(NORMAL, " SAK : %02x [%" PRIu64 "]", card.sak, resp.oldarg[0]);
|
||||
|
||||
if (card.ats_len >= 3) { // a valid ATS consists of at least the length byte (TL) and 2 CRC bytes
|
||||
PrintAndLogEx(NORMAL, " ATS : %s", sprint_hex(card.ats, card.ats_len));
|
||||
|
@ -385,16 +385,16 @@ static int CmdHF14ACUIDs(const char *Cmd) {
|
|||
}
|
||||
|
||||
// execute anticollision procedure
|
||||
UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0}, {{0}}};
|
||||
UsbCommandOLD c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0}, {{0}}};
|
||||
SendCommand(&c);
|
||||
|
||||
UsbReplyNG resp;
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
|
||||
iso14a_card_select_t *card = (iso14a_card_select_t *) resp.core.old.d.asBytes;
|
||||
iso14a_card_select_t *card = (iso14a_card_select_t *) resp.data.asBytes;
|
||||
|
||||
// check if command failed
|
||||
if (resp.core.old.arg[0] == 0) {
|
||||
if (resp.oldarg[0] == 0) {
|
||||
PrintAndLogEx(WARNING, "card select failed.");
|
||||
} else {
|
||||
char uid_string[20];
|
||||
|
@ -483,7 +483,7 @@ int CmdHF14ASim(const char *Cmd) {
|
|||
if (useUIDfromEML)
|
||||
flags |= FLAG_UID_IN_EMUL;
|
||||
|
||||
UsbCommand c = {CMD_SIMULATE_TAG_ISO_14443a, { tagtype, flags, 0 }, {{0}}};
|
||||
UsbCommandOLD c = {CMD_SIMULATE_TAG_ISO_14443a, { tagtype, flags, 0 }, {{0}}};
|
||||
memcpy(c.d.asBytes, uid, uidlen >> 1);
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
|
@ -494,9 +494,9 @@ int CmdHF14ASim(const char *Cmd) {
|
|||
while (!ukbhit()) {
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) continue;
|
||||
if (!(flags & FLAG_NR_AR_ATTACK)) break;
|
||||
if ((resp.core.old.arg[0] & 0xffff) != CMD_SIMULATE_MIFARE_CARD) break;
|
||||
if ((resp.oldarg[0] & 0xffff) != CMD_SIMULATE_MIFARE_CARD) break;
|
||||
|
||||
memcpy(data, resp.core.old.d.asBytes, sizeof(data));
|
||||
memcpy(data, resp.data.asBytes, sizeof(data));
|
||||
readerAttack(data[0], setEmulatorMem, verbose);
|
||||
}
|
||||
showSectorTable();
|
||||
|
@ -512,7 +512,7 @@ int CmdHF14ASniff(const char *Cmd) {
|
|||
if (ctmp == 'c') param |= 0x01;
|
||||
if (ctmp == 'r') param |= 0x02;
|
||||
}
|
||||
UsbCommand c = {CMD_SNIFF_ISO_14443a, {param, 0, 0}, {{0}}};
|
||||
UsbCommandOLD c = {CMD_SNIFF_ISO_14443a, {param, 0, 0}, {{0}}};
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
return 0;
|
||||
|
@ -528,7 +528,7 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
|
|||
UsbReplyNG resp;
|
||||
|
||||
// Anticollision + SELECT card
|
||||
UsbCommand ca = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}, {{0}}};
|
||||
UsbCommandOLD ca = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}, {{0}}};
|
||||
SendCommand(&ca);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
|
||||
|
@ -536,19 +536,19 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
|
|||
}
|
||||
|
||||
// check result
|
||||
if (resp.core.old.arg[0] == 0) {
|
||||
if (resp.oldarg[0] == 0) {
|
||||
PrintAndLogEx(ERR, "No card in field.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (resp.core.old.arg[0] != 1 && resp.core.old.arg[0] != 2) {
|
||||
PrintAndLogEx(ERR, "Card not in iso14443-4. res=%d.", resp.core.old.arg[0]);
|
||||
if (resp.oldarg[0] != 1 && resp.oldarg[0] != 2) {
|
||||
PrintAndLogEx(ERR, "Card not in iso14443-4. res=%d.", resp.oldarg[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (resp.core.old.arg[0] == 2) { // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS, 3: proprietary Anticollision
|
||||
if (resp.oldarg[0] == 2) { // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS, 3: proprietary Anticollision
|
||||
// get ATS
|
||||
UsbCommand cr = {CMD_READER_ISO_14443a, {ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_DISCONNECT, 2, 0}, {{0}}};
|
||||
UsbCommandOLD cr = {CMD_READER_ISO_14443a, {ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_DISCONNECT, 2, 0}, {{0}}};
|
||||
uint8_t rats[] = { 0xE0, 0x80 }; // FSDI=8 (FSD=256), CID=0
|
||||
memcpy(cr.d.asBytes, rats, 2);
|
||||
SendCommand(&cr);
|
||||
|
@ -557,7 +557,7 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (resp.core.old.arg[0] == 0) { // ats_len
|
||||
if (resp.oldarg[0] == 0) { // ats_len
|
||||
PrintAndLogEx(ERR, "Can't get ATS.");
|
||||
return 1;
|
||||
}
|
||||
|
@ -567,7 +567,7 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
|
|||
if (leaveSignalON)
|
||||
cmdc |= ISO14A_NO_DISCONNECT;
|
||||
|
||||
UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_RAW | ISO14A_APPEND_CRC | cmdc, (datainlen & 0xFFFF) + 2, 0}, {{0}}};
|
||||
UsbCommandOLD c = {CMD_READER_ISO_14443a, {ISO14A_RAW | ISO14A_APPEND_CRC | cmdc, (datainlen & 0xFFFF) + 2, 0}, {{0}}};
|
||||
uint8_t header[] = { 0x0a | responseNum, 0x00};
|
||||
responseNum ^= 1;
|
||||
memcpy(c.d.asBytes, header, 2);
|
||||
|
@ -578,8 +578,8 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
|
|||
UsbReplyNG resp;
|
||||
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
recv = resp.core.old.d.asBytes;
|
||||
int iLen = resp.core.old.arg[0];
|
||||
recv = resp.data.asBytes;
|
||||
int iLen = resp.oldarg[0];
|
||||
|
||||
if (!iLen) {
|
||||
PrintAndLogEx(ERR, "No card response.");
|
||||
|
@ -627,7 +627,7 @@ static int SelectCard14443_4(bool disconnect, iso14a_card_select_t *card) {
|
|||
DropField();
|
||||
|
||||
// Anticollision + SELECT card
|
||||
UsbCommand ca = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}, {{0}}};
|
||||
UsbCommandOLD ca = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}, {{0}}};
|
||||
SendCommand(&ca);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
|
||||
|
@ -635,19 +635,19 @@ static int SelectCard14443_4(bool disconnect, iso14a_card_select_t *card) {
|
|||
}
|
||||
|
||||
// check result
|
||||
if (resp.core.old.arg[0] == 0) {
|
||||
if (resp.oldarg[0] == 0) {
|
||||
PrintAndLogEx(ERR, "No card in field.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (resp.core.old.arg[0] != 1 && resp.core.old.arg[0] != 2) {
|
||||
PrintAndLogEx(ERR, "Card not in iso14443-4. res=%d.", resp.core.old.arg[0]);
|
||||
if (resp.oldarg[0] != 1 && resp.oldarg[0] != 2) {
|
||||
PrintAndLogEx(ERR, "Card not in iso14443-4. res=%d.", resp.oldarg[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (resp.core.old.arg[0] == 2) { // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS, 3: proprietary Anticollision
|
||||
if (resp.oldarg[0] == 2) { // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS, 3: proprietary Anticollision
|
||||
// get ATS
|
||||
UsbCommand cr = {CMD_READER_ISO_14443a, {ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_DISCONNECT, 2, 0}, {{0}}};
|
||||
UsbCommandOLD cr = {CMD_READER_ISO_14443a, {ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_DISCONNECT, 2, 0}, {{0}}};
|
||||
uint8_t rats[] = { 0xE0, 0x80 }; // FSDI=8 (FSD=256), CID=0
|
||||
memcpy(cr.d.asBytes, rats, 2);
|
||||
SendCommand(&cr);
|
||||
|
@ -656,20 +656,20 @@ static int SelectCard14443_4(bool disconnect, iso14a_card_select_t *card) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (resp.core.old.arg[0] == 0) { // ats_len
|
||||
if (resp.oldarg[0] == 0) { // ats_len
|
||||
PrintAndLogEx(ERR, "Can't get ATS.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// get frame length from ATS in data field
|
||||
if (resp.core.old.arg[0] > 1) {
|
||||
uint8_t fsci = resp.core.old.d.asBytes[1] & 0x0f;
|
||||
if (resp.oldarg[0] > 1) {
|
||||
uint8_t fsci = resp.data.asBytes[1] & 0x0f;
|
||||
if (fsci < sizeof(atsFSC) / sizeof(atsFSC[0]))
|
||||
frameLength = atsFSC[fsci];
|
||||
}
|
||||
} else {
|
||||
// get frame length from ATS in card data structure
|
||||
iso14a_card_select_t *vcard = (iso14a_card_select_t *) resp.core.old.d.asBytes;
|
||||
iso14a_card_select_t *vcard = (iso14a_card_select_t *) resp.data.asBytes;
|
||||
if (vcard->ats_len > 1) {
|
||||
uint8_t fsci = vcard->ats[1] & 0x0f;
|
||||
if (fsci < sizeof(atsFSC) / sizeof(atsFSC[0]))
|
||||
|
@ -704,7 +704,7 @@ static int CmdExchangeAPDU(bool chainingin, uint8_t *datain, int datainlen, bool
|
|||
// https://stackoverflow.com/questions/32994936/safe-max-java-card-apdu-data-command-and-respond-size
|
||||
// here length USB_CMD_DATA_SIZE=512
|
||||
// timeout must be authomatically set by "get ATS"
|
||||
UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, (datainlen & 0xFFFF), 0}, {{0}}};
|
||||
UsbCommandOLD c = {CMD_READER_ISO_14443a, {ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, (datainlen & 0xFFFF), 0}, {{0}}};
|
||||
|
||||
if (datain)
|
||||
memcpy(c.d.asBytes, datain, datainlen);
|
||||
|
@ -715,9 +715,9 @@ static int CmdExchangeAPDU(bool chainingin, uint8_t *datain, int datainlen, bool
|
|||
UsbReplyNG resp;
|
||||
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
recv = resp.core.old.d.asBytes;
|
||||
int iLen = resp.core.old.arg[0];
|
||||
uint8_t res = resp.core.old.arg[1];
|
||||
recv = resp.data.asBytes;
|
||||
int iLen = resp.oldarg[0];
|
||||
uint8_t res = resp.oldarg[1];
|
||||
|
||||
int dlen = iLen - 2;
|
||||
if (dlen < 0)
|
||||
|
@ -891,7 +891,7 @@ static int CmdHF14AAPDU(const char *Cmd) {
|
|||
}
|
||||
|
||||
static int CmdHF14ACmdRaw(const char *Cmd) {
|
||||
UsbCommand c = {CMD_READER_ISO_14443a, {0, 0, 0}, {{0}}};
|
||||
UsbCommandOLD c = {CMD_READER_ISO_14443a, {0, 0, 0}, {{0}}};
|
||||
bool reply = 1;
|
||||
bool crc = false;
|
||||
bool power = false;
|
||||
|
@ -1050,9 +1050,9 @@ static int waitCmd(uint8_t iSelect) {
|
|||
UsbReplyNG resp;
|
||||
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
uint16_t len = (resp.core.old.arg[0] & 0xFFFF);
|
||||
uint16_t len = (resp.oldarg[0] & 0xFFFF);
|
||||
if (iSelect) {
|
||||
len = (resp.core.old.arg[1] & 0xFFFF);
|
||||
len = (resp.oldarg[1] & 0xFFFF);
|
||||
if (len) {
|
||||
PrintAndLogEx(NORMAL, "Card selected. UID[%i]:", len);
|
||||
} else {
|
||||
|
@ -1065,7 +1065,7 @@ static int waitCmd(uint8_t iSelect) {
|
|||
if (!len)
|
||||
return 1;
|
||||
|
||||
PrintAndLogEx(NORMAL, "%s", sprint_hex(resp.core.old.d.asBytes, len));
|
||||
PrintAndLogEx(NORMAL, "%s", sprint_hex(resp.data.asBytes, len));
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
|
||||
return 3;
|
||||
|
@ -1096,7 +1096,7 @@ static int CmdHF14AAntiFuzz(const char *Cmd) {
|
|||
arg0 = FLAG_10B_UID_IN_DATA;
|
||||
|
||||
CLIParserFree();
|
||||
UsbCommand c = {CMD_ANTIFUZZ_ISO_14443a, {arg0, 0, 0}, {{0}}};
|
||||
UsbCommandOLD c = {CMD_ANTIFUZZ_ISO_14443a, {arg0, 0, 0}, {{0}}};
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
return 0;
|
||||
|
@ -1161,7 +1161,7 @@ int CmdHF14A(const char *Cmd) {
|
|||
}
|
||||
|
||||
int infoHF14A(bool verbose, bool do_nack_test) {
|
||||
UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}, {{0}}};
|
||||
UsbCommandOLD c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}, {{0}}};
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
UsbReplyNG resp;
|
||||
|
@ -1172,7 +1172,7 @@ int infoHF14A(bool verbose, bool do_nack_test) {
|
|||
}
|
||||
|
||||
iso14a_card_select_t card;
|
||||
memcpy(&card, (iso14a_card_select_t *)resp.core.old.d.asBytes, sizeof(iso14a_card_select_t));
|
||||
memcpy(&card, (iso14a_card_select_t *)resp.data.asBytes, sizeof(iso14a_card_select_t));
|
||||
|
||||
/*
|
||||
0: couldn't read
|
||||
|
@ -1180,7 +1180,7 @@ int infoHF14A(bool verbose, bool do_nack_test) {
|
|||
2: OK, no ATS
|
||||
3: proprietary Anticollision
|
||||
*/
|
||||
uint64_t select_status = resp.core.old.arg[0];
|
||||
uint64_t select_status = resp.oldarg[0];
|
||||
|
||||
if (select_status == 0) {
|
||||
if (verbose) PrintAndLogEx(WARNING, "iso14443a card select failed");
|
||||
|
@ -1197,7 +1197,7 @@ int infoHF14A(bool verbose, bool do_nack_test) {
|
|||
|
||||
PrintAndLogEx(NORMAL, " UID : %s", sprint_hex(card.uid, card.uidlen));
|
||||
PrintAndLogEx(NORMAL, "ATQA : %02x %02x", card.atqa[1], card.atqa[0]);
|
||||
PrintAndLogEx(NORMAL, " SAK : %02x [%" PRIu64 "]", card.sak, resp.core.old.arg[0]);
|
||||
PrintAndLogEx(NORMAL, " SAK : %02x [%" PRIu64 "]", card.sak, resp.oldarg[0]);
|
||||
|
||||
bool isMifareClassic = true;
|
||||
switch (card.sak) {
|
||||
|
@ -1221,9 +1221,9 @@ int infoHF14A(bool verbose, bool do_nack_test) {
|
|||
SendCommand(&c);
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
|
||||
memcpy(&card, (iso14a_card_select_t *)resp.core.old.d.asBytes, sizeof(iso14a_card_select_t));
|
||||
memcpy(&card, (iso14a_card_select_t *)resp.data.asBytes, sizeof(iso14a_card_select_t));
|
||||
|
||||
select_status = resp.core.old.arg[0]; // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS
|
||||
select_status = resp.oldarg[0]; // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS
|
||||
|
||||
if (select_status == 0) {
|
||||
DropField();
|
||||
|
@ -1295,8 +1295,8 @@ int infoHF14A(bool verbose, bool do_nack_test) {
|
|||
SendCommand(&c);
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
|
||||
memcpy(card.ats, resp.core.old.d.asBytes, resp.core.old.arg[0]);
|
||||
card.ats_len = resp.core.old.arg[0]; // note: ats_len includes CRC Bytes
|
||||
memcpy(card.ats, resp.data.asBytes, resp.oldarg[0]);
|
||||
card.ats_len = resp.oldarg[0]; // note: ats_len includes CRC Bytes
|
||||
}
|
||||
|
||||
if (card.ats_len >= 3) { // a valid ATS consists of at least the length byte (TL) and 2 CRC bytes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue