X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/82885445b3be2ad153b53bcfe3c53f77e2db0dc7..28d47dc9b4bb437596594a62793bace13bbff172:/armsrc/mifarecmd.c?ds=inline diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 22f499aa..c097cfd5 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -998,8 +998,6 @@ void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain) set_tracing(TRUE); for (i = 0; i < keyCount; ++i) { - if (mifare_classic_halt(pcs, cuid)) - if (MF_DBGLEVEL >= 1) Dbprintf("ChkKeys: Halt error"); if (!iso14443a_select_card(uid, NULL, &cuid, true, 0)) { if (OLD_MF_DBGLEVEL >= 1) Dbprintf("ChkKeys: Can't select card"); @@ -1007,19 +1005,23 @@ void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain) } ui64Key = bytes_to_num(datain + i * 6, 6); - if (mifare_classic_auth(pcs, cuid, blockNo, keyType, ui64Key, AUTH_FIRST)) + if (mifare_classic_auth(pcs, cuid, blockNo, keyType, ui64Key, AUTH_FIRST)) { + if (mifare_classic_halt(pcs, cuid)) + if (MF_DBGLEVEL >= 1) Dbprintf("ChkKeys: Halt error"); continue; + } isOK = 1; break; } - crypto1_destroy(pcs); LED_B_ON(); cmd_send(CMD_ACK,isOK,0,0,datain + i * 6,6); + FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); LEDsoff(); set_tracing(FALSE); + crypto1_destroy(pcs); // restore debug level MF_DBGLEVEL = OLD_MF_DBGLEVEL;