]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/mifareutil.c
CHG: Added calling clear bigbuff to zero out it also, instead of just "free" it.
[proxmark3-svn] / armsrc / mifareutil.c
index 20d4b68b7e99a9029ca31165797c77e9cca2be7a..0a057d6541250b1fd38d9209255afc9715d7313e 100644 (file)
@@ -139,12 +139,11 @@ int mifare_classic_authex(struct Crypto1State *pcs, uint32_t uid, uint8_t blockN
        // variables\r
        int len;        \r
        uint32_t pos;\r
-       uint8_t tmp4[4] = {0x00};\r
        uint8_t par[1] = {0x00};\r
 \r
        // "random" reader nonce:\r
-       byte_t nr[4] = {0x55, 0x41, 0x49, 0x92};\r
-       //byte_t nr[4] = {0x01, 0x01, 0x01, 0x01};\r
+       //byte_t nr[4] = {0x55, 0x41, 0x49, 0x92};\r
+       byte_t nr[4] = {0x01, 0x01, 0x01, 0x01};\r
        \r
        uint32_t nt, ntpp; // Supplied tag nonce\r
        \r
@@ -210,10 +209,9 @@ int mifare_classic_authex(struct Crypto1State *pcs, uint32_t uid, uint8_t blockN
                return 2;\r
        }\r
        \r
-       memcpy(tmp4, receivedAnswer, 4);\r
        ntpp = prng_successor(nt, 32) ^ crypto1_word(pcs, 0,0);\r
-       \r
-       if (ntpp != bytes_to_num(tmp4, 4)) {\r
+\r
+       if (ntpp != bytes_to_num(receivedAnswer, 4)) {\r
                if (MF_DBGLEVEL >= 1)   Dbprintf("Authentication failed. Error card response.");\r
                return 3;\r
        }\r
@@ -543,7 +541,6 @@ uint8_t FirstBlockOfSector(uint8_t sectorNo)
                \r
 }\r
 \r
-\r
 // work with emulator memory\r
 void emlSetMem(uint8_t *data, int blockNum, int blocksCount) {\r
        emlSetMem_xt(data, blockNum, blocksCount, 16);\r
Impressum, Datenschutz