Fix CRC localisation code.

New issue
Summary: Add regression tests for CRC location in encyphered data files.
The CRC position location code in mifare_cryto_postprocess_data() shall be
checked.

new issue
Summary: Rework mifare_cryto_postprocess_data() CRC localisations
The function has two different implementation of the same feature: locate a CRC
at the end of a decyphered stream and check it.  The crc32 will fail if the
last CRC byte is 0x80, and the crc16 code looks awful.  A refactoring would
make our life easier.
This commit is contained in:
Romain Tartiere 2011-01-01 15:27:36 +00:00
parent 8628d59c5b
commit d9ed7f2c24

View file

@ -552,7 +552,7 @@ mifare_cryto_postprocess_data (MifareTag tag, void *data, ssize_t *nbytes, int c
} else {
end_crc_pos++;
}
} while (!verified && (end_crc_pos < *nbytes - 1));
} while (!verified && (end_crc_pos < *nbytes));
if (!verified) {
warnx ("(3)DES not verified");