mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
Fix PAC/Stanley checksum calculation
The parity bit needs to be discarded when calculating the final checksum byte value of PAC/Stanley card IDs. Verified by scanning a tag which is now correctly identified.
This commit is contained in:
parent
680fb12250
commit
7a6f503161
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue