iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN);\r
\r
// free eventually allocated BigBuf memory\r
- BigBuf_free();\r
+ BigBuf_free(); BigBuf_Clear_ext(false);\r
clear_trace();\r
set_tracing(true);\r
\r
iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN);\r
\r
// free eventually allocated BigBuf memory\r
- BigBuf_free();\r
-\r
+ BigBuf_free(); BigBuf_Clear_ext(false);\r
+ \r
if (calibrate) clear_trace();\r
set_tracing(true);\r
\r
set_tracing(TRUE);\r
\r
for (i = 0; i < keyCount; ++i) {\r
- if (mifare_classic_halt(pcs, cuid))\r
- if (MF_DBGLEVEL >= 1) Dbprintf("ChkKeys: Halt error");\r
\r
if (!iso14443a_select_card(uid, NULL, &cuid, true, 0)) {\r
if (OLD_MF_DBGLEVEL >= 1) Dbprintf("ChkKeys: Can't select card");\r
}\r
\r
ui64Key = bytes_to_num(datain + i * 6, 6);\r
- if (mifare_classic_auth(pcs, cuid, blockNo, keyType, ui64Key, AUTH_FIRST))\r
+ if (mifare_classic_auth(pcs, cuid, blockNo, keyType, ui64Key, AUTH_FIRST)) {\r
+ if (mifare_classic_halt(pcs, cuid))\r
+ if (MF_DBGLEVEL >= 1) Dbprintf("ChkKeys: Halt error");\r
continue;\r
+ }\r
\r
isOK = 1;\r
break;\r
}\r
- crypto1_destroy(pcs);\r
\r
LED_B_ON();\r
cmd_send(CMD_ACK,isOK,0,0,datain + i * 6,6);\r
+\r
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);\r
LEDsoff();\r
set_tracing(FALSE);\r
+ crypto1_destroy(pcs);\r
\r
// restore debug level\r
MF_DBGLEVEL = OLD_MF_DBGLEVEL; \r
memcpy(data, receivedAnswer, sizeof(data));\r
\r
// send HALT\r
- if (workFlags & MAGIC_HALT) {\r
+ if (workFlags & MAGIC_HALT)\r
mifare_classic_halt_ex(NULL);\r
- break;\r
- }\r
+\r
isOK = true;\r
break;\r
}\r