X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/c948cbde8cdb6870daa7df8fef0bef76b8da5333..8b6a93df9152de16e16fd4158775954228245613:/client/mifarehost.c?ds=sidebyside diff --git a/client/mifarehost.c b/client/mifarehost.c index fc29e10e..70d2413a 100644 --- a/client/mifarehost.c +++ b/client/mifarehost.c @@ -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))) {