hf mf sniff added CRC_14443_A check

This commit is contained in:
Merlokbr@gmail.com 2012-07-17 11:41:56 +00:00
commit 8b6a93df91
2 changed files with 8 additions and 1 deletions

View file

@ -419,7 +419,13 @@ int mfTraceDecode(uint8_t *data_src, int len, bool wantSaveToEmlFile) {
switch (traceState) {
case TRACE_IDLE:
// TODO: check packet crc16!
// check packet crc16!
if ((len >= 4) && (!CheckCrc14443(CRC_14443_A, data, len))) {
PrintAndLog("dec> CRC ERROR!!!");
AddLogLine(logHexFileName, "dec> ", "CRC ERROR!!!");
traceState = TRACE_ERROR; // do not decrypt the next commands
return 1;
}
// AUTHENTICATION
if ((len ==4) && ((data[0] == 0x60) || (data[0] == 0x61))) {

View file

@ -19,6 +19,7 @@
#include "util.h"
#include "nonce2key/nonce2key.h"
#include "nonce2key/crapto1.h"
#include "iso14443crc.h"
#define MEM_CHUNK 1000000
#define NESTED_SECTOR_RETRY 10