Romain Tartiere
683cbdf64f
Rename mifare_desfire_authenticate.c to mifare_desfire_crypto.c.
2010-12-18 02:50:38 +00:00
Romain Tartiere
d098bf623f
Add support for authentication using 3K3DES.
...
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...
2010-12-18 02:28:27 +00:00
Romain Tartiere
f06b0ac5d3
Ignore the status code when deciphering (3)DES data.
2010-12-18 02:14:51 +00:00
Romain Tartiere
373cb4f0ef
Rewrite some tests using switch statements.
...
Add a note for the reason I do this in the HACKING file.
2010-12-18 02:07:56 +00:00
Romain Tartiere
1d3c3f5dfd
Improve the way data with already a CRC is preprocessed.
2010-12-18 01:52:48 +00:00
Romain Tartiere
79f6cb20e5
Update CMAC code to handle 64 and 128 bit keys.
2010-12-18 01:45:38 +00:00
Romain Tartiere
8d74401e87
Enlarge another buffer to workaround the read_data() buffer overrun.
2010-12-18 01:44:20 +00:00
Romain Tartiere
48b161d67c
Invalidate authentication when changing the currently used key.
2010-12-18 01:32:56 +00:00
Romain Tartiere
143042fb0b
Remove weird code.
...
I should quit coding drunk... or maybe start to...
2010-12-18 01:09:30 +00:00
Romain Tartiere
a6e52db696
Workaround invalid write in read_data () (sic)
...
This has to be improved to some extend in the near future (hence the FIXME).
2010-12-18 01:05:35 +00:00
Romain Tartiere
c9680fd7c7
Fix key_macing_length() return value when nbytes is 0.
2010-12-17 22:53:40 +00:00
Romain Tartiere
5b55528008
Silent down the compiler.
...
The create_application() function has iso_ parameters for creating ISO
application but this mode is not available yet so the code is unused which
annoys the compiler when told to be somewhat strict.
2010-12-17 22:47:12 +00:00
Romain Tartiere
ed028d720a
Fix the fix introduced at r697.
...
Yes, this type I typed 'make' before committing...
2010-12-17 22:45:56 +00:00
Romain Tartiere
0119a43208
Fix freed memory usage.
2010-12-17 22:38:51 +00:00
Romain Tartiere
0a9a964c17
Fix a brunch of potentially reallocated memory areas.
2010-12-15 13:40:58 +00:00
Romain Tartiere
94bf8d83c6
Fix mifare_desfire_get_key_version() when authenticated with an AES key.
2010-12-15 13:34:15 +00:00
Romain Tartiere
3fd80a3eff
Enable the mifare-desfire-ev1-configure-random-uid example.
2010-12-15 13:19:42 +00:00
Romain Tartiere
b91080ffc7
Fix mifare_desfire_free_mem().
2010-12-15 12:51:22 +00:00
Romain Tartiere
29e9d188b4
Display additional Mifare DESFire EV1 information if applicable.
2010-12-15 12:51:05 +00:00
Romain Tartiere
42f9457d9f
Add support for Mifare DESFire EV1 with AES encryption.
2010-12-15 12:43:31 +00:00
Audrey Diacre
1070d9bfde
fix buffer overflow.
2010-12-13 10:56:27 +00:00
Audrey Diacre
5133491c2c
replace deprecated bzero function by memset.
2010-12-10 17:10:12 +00:00
Romain Tartiere
0e2bc992bf
Discard authentication information after deleting the currently selected application.
2010-12-10 14:30:28 +00:00
Romain Tartiere
fac03f5456
Bump version to 0.2.2.
2010-11-24 00:09:08 +00:00
Romain Tartiere
193809f949
Don't build libtestcommon.la if we are not using cutter.
2010-11-24 00:07:47 +00:00
Romain Tartiere
8d74792379
Update configure.ac [0.2.1].
2010-11-23 20:57:48 +00:00
Romain Tartiere
13ae0961fb
Update NEWS file.
2010-11-23 20:56:37 +00:00
Romain Tartiere
12de6ea4c4
Add forgotten files.
2010-11-23 18:42:25 +00:00
Romain Tartiere
c6f4343276
Fix autotools fun.
...
Tribute to Justice!
2010-11-23 18:38:10 +00:00
Romain Tartiere
e0a28547fd
Reset session key in mifare_desfire_select_application().
...
For Mifare DESFire EV1 support, we need to know when the user has called
mifare_desfire_select_application() after being authenticated and before
authenticated again.
2010-11-23 01:15:27 +00:00
Romain Tartiere
b7a45b4da4
Use mifare_desfire_auto_authenticate() for authentication.
2010-11-21 00:32:38 +00:00
Romain Tartiere
02c9d33ce1
Move master key detection and authentication in a convenience library.
...
The autohell hack sucks and should be fixed, but I was unable to find the magic
trick to prevent automake from building broken libtool rules which produce
warnings about portability :-/.
2010-11-21 00:10:04 +00:00
Romain Tartiere
9011bc01e3
Don't return directly if we just have a command code.
...
Mifare DESFire EV1 with authentication with AES or 3K3DES keys will require to
perform CMACing on each frame, even those with just a command. So it does not
break anything as of today, but would be a problem later on.
2010-11-20 22:39:48 +00:00
Romain Tartiere
6988e3e219
Prepare extension of communication settings.
2010-11-20 22:29:23 +00:00
Romain Tartiere
8975c60de7
Add some shortcuts.
2010-11-20 22:24:36 +00:00
Romain Tartiere
d05f008e76
Change some numbers with corresponding constants.
2010-11-20 14:19:04 +00:00
Romain Tartiere
a643e9149d
Add an offset parameter to mifare_cryto_preprocess_data()
...
Some cryptographic operations are performed on the whole data frame and not
only the payload with Mifare DESFire EV1. The solution for now is not perfect,
(one new macro wrapping another big macro) but makes the code a bit easier to
read, and with the MIFARE_DESFIRE macro rewriting as a function (at some point
in the future), the whole should be bearable :-)
2010-11-20 14:10:27 +00:00
Romain Tartiere
16ae154b42
Don't swap the status byte in the received data.
...
This have been done for consistency with other targets support, but
cryptographic operations with Mifare DESFire EV1 tags would require to swap
again this byte because MACing is performed on the following data (in this
order):
- Plain data
- Status
- Padding
2010-11-20 02:22:37 +00:00
Romain Tartiere
2750c0372c
Display master-key version in mifare-desfire-info.
2010-11-20 01:58:09 +00:00
Romain Tartiere
f94c3c743f
Rely on RAND_bytes() instead of DES_random_key() to generate random vectors.
2010-10-29 18:58:34 +00:00
Romain Tartiere
5b416ee508
Fix a regression introduced at r643.
2010-10-29 18:53:49 +00:00
Romain Tartiere
d9b2deebe2
Rework error reporting infrastructure.
2010-10-29 13:10:23 +00:00
Romain Tartiere
b932c923d5
Improve the test_mifare_rol() test.
2010-10-29 13:02:55 +00:00
Romain Tartiere
678b71edb0
Rename some macros for consistency.
2010-10-29 13:01:55 +00:00
Romain Tartiere
90c82945a9
Split session key generation for DES / 3DES.
2010-10-29 12:47:20 +00:00
Romain Tartiere
3eb8d37d08
Make some more buffer sizes dynamic.
2010-10-29 12:44:12 +00:00
Romain Tartiere
a0b9df6ece
Add a block_size parameter to mifare_des().
2010-10-29 12:34:11 +00:00
Romain Tartiere
356219e21b
Require the ivect to be provided to mifare_cbc_des().
...
- Store ivect in the struct mifare_desfire_tag;
- Reset it before and after authentication;
- Reset before each crypto operation (for now).
2010-10-29 12:22:47 +00:00
Romain Tartiere
87a04904bc
Change xor8() to xor() to work with buffers of any length.
2010-10-29 12:07:26 +00:00
Romain Tartiere
13f03a60bb
Change rol8() to rol() to work with buffers of any length.
2010-10-29 12:01:57 +00:00