]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/mifarecmd.c
CHG: CHange the definition of MAX_GRAPH_TRACE_LEN to match eachother.
[proxmark3-svn] / armsrc / mifarecmd.c
index ad8655db4eddffd6c6174b02b7bb07ba7e4087a0..c097cfd5f4a816f4ceef7c121f84d4de875bd71b 100644 (file)
@@ -944,7 +944,7 @@ void MifareNested(uint32_t arg0, uint32_t arg1, uint32_t calibrate, uint8_t *dat
        crypto1_destroy(pcs);\r
        \r
        byte_t buf[4 + 4 * 4] = {0};\r
-       num_to_bytes(cuid, 4, buf);\r
+       memcpy(buf, &cuid, 4);\r
        memcpy(buf+4, &target_nt[0], 4);\r
        memcpy(buf+8, &target_ks[0], 4);\r
        memcpy(buf+12, &target_nt[1], 4);\r
@@ -998,8 +998,6 @@ void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain)
        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
@@ -1007,19 +1005,23 @@ void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain)
                }\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
Impressum, Datenschutz