mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
turning off field on failure
This commit is contained in:
parent
f189c5c3f8
commit
f57a6195de
1 changed files with 9 additions and 3 deletions
|
@ -1021,7 +1021,7 @@ static bool select_only(uint8_t *CSN, uint8_t *CCNR, bool use_credit_key, bool v
|
||||||
if (isOK <= 1) {
|
if (isOK <= 1) {
|
||||||
if ( verbose )
|
if ( verbose )
|
||||||
PrintAndLogEx(FAILED, "failed to obtain CC! Tag-select is aborting... (%d)", isOK);
|
PrintAndLogEx(FAILED, "failed to obtain CC! Tag-select is aborting... (%d)", isOK);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1033,6 +1033,8 @@ static bool select_and_auth(uint8_t *KEY, uint8_t *MAC, uint8_t *div_key, bool u
|
||||||
|
|
||||||
if (!select_only(CSN, CCNR, use_credit_key, verbose)) {
|
if (!select_only(CSN, CCNR, use_credit_key, verbose)) {
|
||||||
if (verbose) PrintAndLogEx(FAILED, "selecting tag failed");
|
if (verbose) PrintAndLogEx(FAILED, "selecting tag failed");
|
||||||
|
|
||||||
|
DropField();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//get div_key
|
//get div_key
|
||||||
|
@ -2042,8 +2044,10 @@ static int CmdHFiClassCalcNewKey(const char *Cmd) {
|
||||||
|
|
||||||
if (!givenCSN) {
|
if (!givenCSN) {
|
||||||
uint8_t CCNR[12] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
uint8_t CCNR[12] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
if (!select_only(CSN, CCNR, false, true))
|
if (!select_only(CSN, CCNR, false, true)) {
|
||||||
|
DropField();
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HFiClassCalcNewKey(CSN, OLDKEY, NEWKEY, xor_div_key, elite, oldElite, true);
|
HFiClassCalcNewKey(CSN, OLDKEY, NEWKEY, xor_div_key, elite, oldElite, true);
|
||||||
|
@ -2280,16 +2284,18 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
|
||||||
for (uint8_t i = 0; i < ICLASS_AUTH_RETRY && !got_csn; i++) {
|
for (uint8_t i = 0; i < ICLASS_AUTH_RETRY && !got_csn; i++) {
|
||||||
got_csn = select_only(CSN, CCNR, false, false);
|
got_csn = select_only(CSN, CCNR, false, false);
|
||||||
if (got_csn == false)
|
if (got_csn == false)
|
||||||
PrintAndLogEx(WARNING, "one more try\n");
|
PrintAndLogEx(WARNING, "one more try");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (got_csn == false) {
|
if (got_csn == false) {
|
||||||
PrintAndLogEx(WARNING, "Tried 10 times. Can't select card, aborting...");
|
PrintAndLogEx(WARNING, "Tried 10 times. Can't select card, aborting...");
|
||||||
|
DropField();
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre = calloc(keycount, sizeof(iclass_premac_t));
|
pre = calloc(keycount, sizeof(iclass_premac_t));
|
||||||
if (!pre) {
|
if (!pre) {
|
||||||
|
DropField();
|
||||||
free(keyBlock);
|
free(keyBlock);
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue