mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
return values
This commit is contained in:
parent
f586b38360
commit
bb57d6885b
2 changed files with 10 additions and 7 deletions
|
@ -430,12 +430,12 @@ int Hf14443_4aGetCardData(iso14a_card_select_t *card) {
|
||||||
|
|
||||||
if (select_status == 0) {
|
if (select_status == 0) {
|
||||||
PrintAndLogEx(ERR, "E->iso14443a card select failed");
|
PrintAndLogEx(ERR, "E->iso14443a card select failed");
|
||||||
return 1;
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (select_status == 2) {
|
if (select_status == 2) {
|
||||||
PrintAndLogEx(ERR, "E->Card doesn't support iso14443-4 mode");
|
PrintAndLogEx(ERR, "E->Card doesn't support iso14443-4 mode");
|
||||||
return 1;
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (select_status == 3) {
|
if (select_status == 3) {
|
||||||
|
@ -446,7 +446,7 @@ int Hf14443_4aGetCardData(iso14a_card_select_t *card) {
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(SUCCESS, "\tATQA : %02X %02X", card->atqa[1], card->atqa[0]);
|
PrintAndLogEx(SUCCESS, "\tATQA : %02X %02X", card->atqa[1], card->atqa[0]);
|
||||||
}
|
}
|
||||||
return 1;
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((card->uidlen == 4) && (card->uid[0] == 0x08)) {
|
if ((card->uidlen == 4) && (card->uid[0] == 0x08)) {
|
||||||
|
@ -456,16 +456,19 @@ int Hf14443_4aGetCardData(iso14a_card_select_t *card) {
|
||||||
}
|
}
|
||||||
PrintAndLogEx(SUCCESS, "ATQA: %02X %02X", card->atqa[1], card->atqa[0]);
|
PrintAndLogEx(SUCCESS, "ATQA: %02X %02X", card->atqa[1], card->atqa[0]);
|
||||||
PrintAndLogEx(SUCCESS, " SAK: %02X [%" PRIu64 "]", card->sak, resp.oldarg[0]);
|
PrintAndLogEx(SUCCESS, " 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
|
|
||||||
|
// a valid ATS consists of at least the length byte (TL) and 2 CRC bytes
|
||||||
|
if (card->ats_len < 3) {
|
||||||
PrintAndLogEx(INFO, "E-> Error ATS length(%d) : %s", card->ats_len, sprint_hex(card->ats, card->ats_len));
|
PrintAndLogEx(INFO, "E-> Error ATS length(%d) : %s", card->ats_len, sprint_hex(card->ats, card->ats_len));
|
||||||
return 1;
|
return PM3_ECARDEXCHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (card->ats_len == card->ats[0] + 2)
|
if (card->ats_len == card->ats[0] + 2)
|
||||||
PrintAndLogEx(SUCCESS, " ATS: [%d] %s", card->ats[0], sprint_hex(card->ats, card->ats[0]));
|
PrintAndLogEx(SUCCESS, " ATS: [%d] %s", card->ats[0], sprint_hex(card->ats, card->ats[0]));
|
||||||
else
|
else
|
||||||
PrintAndLogEx(SUCCESS, " ATS: [%d] %s", card->ats_len, sprint_hex(card->ats, card->ats_len));
|
PrintAndLogEx(SUCCESS, " ATS: [%d] %s", card->ats_len, sprint_hex(card->ats, card->ats_len));
|
||||||
return 0;
|
|
||||||
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
iso14a_polling_parameters_t iso14a_get_polling_parameters(bool use_ecp, bool use_magsafe) {
|
iso14a_polling_parameters_t iso14a_get_polling_parameters(bool use_ecp, bool use_magsafe) {
|
||||||
|
|
|
@ -2094,7 +2094,7 @@ static int CmdEMVScan(const char *Cmd) {
|
||||||
PrintAndLogEx(INFO, "GET UID, ATS");
|
PrintAndLogEx(INFO, "GET UID, ATS");
|
||||||
|
|
||||||
iso14a_card_select_t card;
|
iso14a_card_select_t card;
|
||||||
if (Hf14443_4aGetCardData(&card)) {
|
if (Hf14443_4aGetCardData(&card) != PM3_SUCCESS) {
|
||||||
return PM3_ERFTRANS;
|
return PM3_ERFTRANS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue