]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhflist.c
Merge pull request #638 from grauerfuchs/master
[proxmark3-svn] / client / cmdhflist.c
index 87d5b67dc774779eb7ea7f809243858d8848bf3e..5538b6fb8a50ff71b2b9d2127cf72824c33ceaca 100644 (file)
@@ -16,7 +16,6 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include "util.h"
 #include <stdint.h>
 #include <stdbool.h>
 #include "util.h"
-#include "data.h"
 #include "ui.h"
 #include "iso14443crc.h"
 #include "parity.h"
 #include "ui.h"
 #include "iso14443crc.h"
 #include "parity.h"
@@ -456,7 +455,7 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes
 
                                                        AuthData.nt = ntx;
                                                        mfLastKey = GetCrypto1ProbableKey(&AuthData);
 
                                                        AuthData.nt = ntx;
                                                        mfLastKey = GetCrypto1ProbableKey(&AuthData);
-                                                       PrintAndLog("            |          * | key | nested probable key:%010"PRIx64"      ks2:%08x ks3:%08x |     |", 
+                                                       PrintAndLog("            |          * | key | nested probable key:%012"PRIx64"      ks2:%08x ks3:%08x |     |", 
                                                                mfLastKey,
                                                                AuthData.ks2,
                                                                AuthData.ks3);
                                                                mfLastKey,
                                                                AuthData.ks2,
                                                                AuthData.ks3);
@@ -560,8 +559,10 @@ bool NestedCheckKey(uint64_t key, TAuthData *ad, uint8_t *cmd, uint8_t cmdsize,
        uint32_t ar1 = crypto1_word(pcs, 0, 0) ^ ad->ar_enc;
        uint32_t at1 = crypto1_word(pcs, 0, 0) ^ ad->at_enc;
 
        uint32_t ar1 = crypto1_word(pcs, 0, 0) ^ ad->ar_enc;
        uint32_t at1 = crypto1_word(pcs, 0, 0) ^ ad->at_enc;
 
-       if (!(ar == ar1 && at == at1 && NTParityChk(ad, nt1)))
+       if (!(ar == ar1 && at == at1 && NTParityChk(ad, nt1))) {
+               crypto1_destroy(pcs);
                return false;
                return false;
+       }
 
        memcpy(buf, cmd, cmdsize);
        mf_crypto1_decrypt(pcs, buf, cmdsize, 0);
 
        memcpy(buf, cmd, cmdsize);
        mf_crypto1_decrypt(pcs, buf, cmdsize, 0);
Impressum, Datenschutz