]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhflist.c
added mock of key check
[proxmark3-svn] / client / cmdhflist.c
index 43e0e56258565a97bac788f53c11ad7e932b45c9..30249579848a8ea40f427d41d2db97be0dd9b4b1 100644 (file)
@@ -23,6 +23,7 @@
 #include "protocols.h"
 #include "crapto1/crapto1.h"
 #include "mifarehost.h"
+#include "mifaredefault.h"
 
 
 enum MifareAuthSeq {
@@ -291,10 +292,17 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, bool isResponse, uint8_t *m
                        
                        // check last used key
                        if (mfLastKey) {
-                               
+                               if (NestedCheckKey(mfLastKey, &AuthData, cmd, cmdsize)) {
+                               };
                        }
                        
                        // check default keys
+                       for (int defaultKeyCounter = 0; defaultKeyCounter < MifareDefaultKeysSize; defaultKeyCounter++){
+                               if (NestedCheckKey(MifareDefaultKeys[defaultKeyCounter], &AuthData, cmd, cmdsize)) {
+                                       
+                                       break;
+                               };
+                       }
                        
                        // nested
                        if (validate_prng_nonce(AuthData.nt)) {
@@ -317,3 +325,6 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, bool isResponse, uint8_t *m
        return *mfDataLen > 0;
 }
 
+bool NestedCheckKey(uint64_t key, TAuthData *ad, uint8_t *cmd, uint8_t cmdsize) {
+       return false;
+}
\ No newline at end of file
Impressum, Datenschutz