Merge pull request #99 from merlokk/scan_err

check ATR length
This commit is contained in:
Oleg Moiseenko 2019-02-20 19:38:04 +02:00 committed by GitHub
commit 956899b839
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1444,6 +1444,10 @@ int CmdEMVScan(const char *cmd) {
smart_card_atr_t card;
smart_select(true, &card);
if (!card.atr_len) {
PrintAndLogEx(ERR, "Can't get ATR from a smart card.");
return 1;
}
JsonSaveStr(root, "$.Card.Contact.Communication", "iso7816");
JsonSaveBufAsHex(root, "$.Card.Contact.ATR", (uint8_t *)card.atr, card.atr_len);