#include "protocols.h"
#include "crapto1/crapto1.h"
#include "mifarehost.h"
+#include "mifaredefault.h"
enum MifareAuthSeq {
// 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)) {
return *mfDataLen > 0;
}
+bool NestedCheckKey(uint64_t key, TAuthData *ad, uint8_t *cmd, uint8_t cmdsize) {
+ return false;
+}
\ No newline at end of file
extern void annotateIso14443a(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize);
extern void annotateMifare(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize, uint8_t* parity, uint8_t paritysize, bool isResponse);
extern bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, bool isResponse, uint8_t *mfData, size_t *mfDataLen);
+extern bool NestedCheckKey(uint64_t key, TAuthData *ad, uint8_t *cmd, uint8_t cmdsize);
#endif // CMDHFLIST