Merge pull request #1487 from rknoll/fix-pac-checksum

Fix PAC/Stanley checksum calculation
This commit is contained in:
Philippe Teuwen authored and GitHub committed 2021-08-28 19:48:19 +02:00
commit 8a925b496a
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -54,7 +54,7 @@ static int pac_buf_to_cardid(uint8_t *src, const size_t src_size, uint8_t *dst,
PrintAndLogEx(DEBUG, "DEBUG: Error - PAC: Parity check failed");
return PM3_ESOFT;
}
if (idx < dataLength - 1) checksum ^= byte;
if (idx < dataLength - 1) checksum ^= dst[idx];
}
if (dst[dataLength - 1] != checksum) {
PrintAndLogEx(DEBUG, "DEBUG: Error - PAC: Bad checksum - expected: %02X, actual: %02X", dst[dataLength - 1], checksum);