X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/6c38d4c96fa96c871c739718081caa5e56ce968a..547595784facfc9565ca08af18d9bead6bfac31b:/armsrc/mifareutil.c diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c index 20d4b68b..1956e88a 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; }