Fixes issue 57
New API functions:
* mifare_desfire_create_application_iso()
* mifare_desfire_create_application_3k3des_iso()
* mifare_desfire_create_application_aes_iso()
* mifare_desfire_get_df_names()
Plus unit test to check this.
Because in some circumstances the crypto is skipped regardless of the
communication settings by the Mifare DESFire (e.g. when reading a file which is
writable with any key), do not abort if the crypto fail, and make it possible
to the user to catch such an event to fix his code accordingly.
Only display crypto diagnostic if compiled with debug support.
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.
If the provided key is a 3K3DES key, authenticate in ISO mode. If the key is
an AES one, authenticate in AES mode. This sugar should help third party
applications to handle authentication in a more generic way.
ECOPYPASTETOOFAST | EBADLUCKITSVALID: The argument communication_settings is
not to be used to construct the parameters passed to the crypto functions
mifare_cryto_preprocess_data() & mifare_cryto_postprocess_data(), but only for
building the frame.
Please note that according to the NXP documentation of the Mifare DESFire EV1,
the mifare_desfire_authenticate_iso() function can be used using either 3DES or
3K3DES keys. The former has not been tested yet and is likely not to work. To
word it differently, this is a 3K3DES crypto support, not a ISO authentication
support...