Commit graph

468 commits

Author SHA1 Message Date
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
Romain Tartiere
7278740a03 s|append_iso14443a_crc|iso14443a_crc_append|. 2010-10-29 11:07:22 +00:00
Romain Tartiere
8dac813e53 New API function mifare_desfire_aid_get_aid(). 2010-10-17 20:21:06 +00:00
Romain Tartiere
07709c2835 New API function mifare_desfire_last_picc_error(). 2010-10-17 19:32:59 +00:00
Romain Tartiere
6790ad9bac Add more parenthesis to shut the compiler down. 2010-10-17 16:08:16 +00:00
Romain Tartiere
688d083f63 Fix build with recent libnfc API breakage. 2010-10-15 12:58:29 +00:00
Romain Tartiere
215439cf67 Fix detection of targets without ATS. 2010-10-08 12:31:07 +00:00
Romain Tartiere
22500eaaf6 Add missing Id. 2010-10-08 11:46:58 +00:00
Romain Tartiere
13a62ebf3e Fix $Id$ in make output. 2010-10-08 11:45:57 +00:00
Romain Tartiere
cf9f8d5246 Add missing file header & Id. 2010-10-08 11:43:04 +00:00
Romain Tartiere
53462219f4 Remove unused file.
The test in this file is already in test_mifare_desfire_des.c.
2010-10-08 11:41:52 +00:00
Romain Tartiere
a216a05299 Include fixture.h in fixture.c. 2010-10-08 11:34:50 +00:00
Romain Tartiere
93011b4c07 Use the actual UID length to select a target.
Without it, the libfreefare cannot use 4-bytes-long random UIDs of Mifare
DESFire EV1.
2010-10-01 19:32:03 +00:00
Romain Tartiere
a77fa7ae4a Switch back to InDataExchange() for Mifare DESFire cards.
Wrapping all frames in ISO7816-4 ADPU workarounds the P3 (Lc) > 0xFA limitation
of the PN531.
2010-10-01 18:13:49 +00:00
Romain Tartiere
782e276a7a Reindent after last commit.
Also reindent a forgotten switch/case while here.
2010-09-30 06:04:52 +00:00
Romain Tartiere
93f28ed83e Display old UID in mifare-desfire-ev1-configure-random-uid.
If a presenter Mifare DESFire has a random UID, display it's original UID.
2010-09-30 06:03:31 +00:00
Romain Tartiere
717cd9fecd Minor fixes for mifare-desfire-format.
- Free default_key;
- Really stop on error.
2010-09-30 06:02:30 +00:00
Romain Tartiere
dd8e031e8c Add an example to configure MIFARE DESFire EV1 random UID.
Don't connect it to the build yet because the corresponding code in the library
has not been committed yet: I want to keep a track of modifications I do in the
VCS.
2010-09-30 05:11:26 +00:00
Romain Tartiere
ba56826969 Compare only the 4 first bytes of ATS.
The 5th byte of Mifare DESFire being a "historical character" and being
user-tweakable for Mifare DESFire EV1, we should not use it when comparing the
ATS with our Mifare DESFire reference ATS to determine if a given tag is a
Mifare DESFire or not.
2010-09-29 19:46:55 +00:00
Romain Tartiere
9a2a07ea53 Enhance error reporting.
Now that the libnfc has error handling, report errors triggered in the libnfc
and add support for errors triggered in libfreefare.
2010-09-28 19:01:28 +00:00
Romain Tartiere
18982d360f Update NEWS file. 2010-09-28 17:33:04 +00:00
Romain Tartiere
91d3ff9cc4 Implement ISO14443-4 block numbers.
This feature was not used by the cards I initially used when coding the
, but is required for (at least some) Mifare DESFire EV1 to work.

IMPORTANT NOTE: The cards needing this block-number management to work out
break-down when mifare_desfire_format_picc() is performed on them.  The ATR
change from 0x7577810280 to 0x757781028f and further communication alway result
in a timeout.  At the time of committing, the reason is still unknown (bogus
cards, missed "Remarks" in the documentation, ...).  Other commands seems to
not expose additional problems.
2010-09-28 16:37:25 +00:00
Romuald Conty
cdac2ea340 fix mifare-desfire-write-ndef example, it now works with Nokia 6212 Classic. (Thanks to Roel) 2010-09-27 15:46:16 +00:00
Romuald Conty
fa41d85c94 since r588, mifare-desfire-write-ndef doesn't change anymore permanently settings, executing it is now reversible. 2010-09-13 09:46:51 +00:00
Audrey Diacre
2914460a13 mifare-desfire-write-ndef, allow changing configuration and the PICC master key. 2010-09-13 07:58:10 +00:00
Romain Tartiere
51269a92fa Revert r565.
r565 was misinterpreted as a bug while it's a feature.  Since it might be
inappropriate to do irreversible operations in an example, warn the user about
it.
2010-09-10 14:58:39 +00:00