X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/6c38d4c96fa96c871c739718081caa5e56ce968a..aaa1a9a2dcb8b9f2b6acd937f84464daa50ecad6:/armsrc/mifareutil.c diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c index 20d4b68b..0a057d65 100644 --- a/armsrc/mifareutil.c +++ b/armsrc/mifareutil.c @@ -139,12 +139,11 @@ int mifare_classic_authex(struct Crypto1State *pcs, uint32_t uid, uint8_t blockN // variables int len; uint32_t pos; - uint8_t tmp4[4] = {0x00}; uint8_t par[1] = {0x00}; // "random" reader nonce: - byte_t nr[4] = {0x55, 0x41, 0x49, 0x92}; - //byte_t nr[4] = {0x01, 0x01, 0x01, 0x01}; + //byte_t nr[4] = {0x55, 0x41, 0x49, 0x92}; + byte_t nr[4] = {0x01, 0x01, 0x01, 0x01}; uint32_t nt, ntpp; // Supplied tag nonce @@ -210,10 +209,9 @@ int mifare_classic_authex(struct Crypto1State *pcs, uint32_t uid, uint8_t blockN return 2; } - memcpy(tmp4, receivedAnswer, 4); ntpp = prng_successor(nt, 32) ^ crypto1_word(pcs, 0,0); - - if (ntpp != bytes_to_num(tmp4, 4)) { + + if (ntpp != bytes_to_num(receivedAnswer, 4)) { if (MF_DBGLEVEL >= 1) Dbprintf("Authentication failed. Error card response."); return 3; } @@ -543,7 +541,6 @@ uint8_t FirstBlockOfSector(uint8_t sectorNo) } - // work with emulator memory void emlSetMem(uint8_t *data, int blockNum, int blocksCount) { emlSetMem_xt(data, blockNum, blocksCount, 16);