mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 13:23:25 -07:00
check ATS/ATR length
This commit is contained in:
parent
8987cc85b1
commit
a19e5ea739
1 changed files with 12 additions and 3 deletions
|
@ -1478,6 +1478,10 @@ int CmdEMVScan(const char *cmd) {
|
||||||
if (Hf14443_4aGetCardData(&card)) {
|
if (Hf14443_4aGetCardData(&card)) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
if (!card.uidlen) {
|
||||||
|
PrintAndLogEx(ERR, "get ATS error");
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
JsonSaveStr(root, "$.Card.Contactless.Communication", "iso14443-4a");
|
JsonSaveStr(root, "$.Card.Contactless.Communication", "iso14443-4a");
|
||||||
JsonSaveBufAsHex(root, "$.Card.Contactless.UID", (uint8_t *)&card.uid, card.uidlen);
|
JsonSaveBufAsHex(root, "$.Card.Contactless.UID", (uint8_t *)&card.uid, card.uidlen);
|
||||||
|
@ -1487,11 +1491,16 @@ int CmdEMVScan(const char *cmd) {
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(NORMAL, "--> GET ATR.");
|
PrintAndLogEx(NORMAL, "--> GET ATR.");
|
||||||
|
|
||||||
smart_card_atr_t card;
|
smart_card_atr_t ccard;
|
||||||
smart_getATR(&card);
|
smart_getATR(&ccard);
|
||||||
|
|
||||||
|
if (!ccard.atr_len) {
|
||||||
|
PrintAndLogEx(ERR, "get ATR error");
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
JsonSaveStr(root, "$.Card.Contact.Communication", "iso7816");
|
JsonSaveStr(root, "$.Card.Contact.Communication", "iso7816");
|
||||||
JsonSaveBufAsHex(root, "$.Card.Contact.ATR", (uint8_t *)card.atr, card.atr_len);
|
JsonSaveBufAsHex(root, "$.Card.Contact.ATR", (uint8_t *)ccard.atr, ccard.atr_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
// init applets list tree
|
// init applets list tree
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue