]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
`hf mf sniff` added CRC_14443_A check
authorMerlokbr@gmail.com <Merlokbr@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 17 Jul 2012 11:41:56 +0000 (11:41 +0000)
committerMerlokbr@gmail.com <Merlokbr@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 17 Jul 2012 11:41:56 +0000 (11:41 +0000)
client/mifarehost.c
client/mifarehost.h

index fc29e10e9f1e3d3f5db3e0886a83187070190354..70d2413a856936ccd38f5f314589f1ec2de3e6fc 100644 (file)
@@ -419,7 +419,13 @@ int mfTraceDecode(uint8_t *data_src, int len, bool wantSaveToEmlFile) {
        \r
        switch (traceState) {\r
        case TRACE_IDLE: \r
-               // TODO: check packet crc16!\r
+               // check packet crc16!\r
+               if ((len >= 4) && (!CheckCrc14443(CRC_14443_A, data, len))) {\r
+                       PrintAndLog("dec> CRC ERROR!!!");\r
+                       AddLogLine(logHexFileName, "dec> ", "CRC ERROR!!!"); \r
+                       traceState = TRACE_ERROR;  // do not decrypt the next commands\r
+                       return 1;\r
+               }\r
                \r
                // AUTHENTICATION\r
                if ((len ==4) && ((data[0] == 0x60) || (data[0] == 0x61))) {\r
index 64fc9339d94164733e7055884d03ba4023b7a76b..d74f3f0e4aa2361b08d1766bd0b0a814913ff52b 100644 (file)
@@ -19,6 +19,7 @@
 #include "util.h"\r
 #include "nonce2key/nonce2key.h"\r
 #include "nonce2key/crapto1.h"\r
+#include "iso14443crc.h"\r
 \r
 #define MEM_CHUNK               1000000\r
 #define NESTED_SECTOR_RETRY     10\r
Impressum, Datenschutz