Commit graph

235 commits

Author SHA1 Message Date
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
Romain Tartiere
6ae77a29e1 Bump version to 0.2.0. 2010-09-07 14:35:36 +00:00
Romain Tartiere
40fa0d5d13 Fix mifare-classic-write-ndef example when using a card with an existing MAD.
Also fix some perror() -> nfc_perror().
2010-09-07 14:29:11 +00:00
Romain Tartiere
cf4942b510 Remove debugging line that should not have been committed in r535. 2010-09-07 13:38:48 +00:00
Romain Tartiere
b4ce6bfab6 Add missing function check reported by autoscan. 2010-09-07 09:05:10 +00:00
Romuald Conty
53f21706da bump libnfc needed version. 2010-09-06 09:28:14 +00:00
Romain Tartiere
b6a4982102 Attempt to detect and use CoreFoundation's headers for endianness conversions on Mac OS X.
PR:		Issue 21
Submitted by:	MathewMcBride47
2010-09-04 11:06:14 +00:00
Romain Tartiere
8a477773f7 Rework OpenSSL usage.
- Lookup for crypto functions in libcrypto instead of libssl.  Some systems
  (Mac OS) do not provide libssl, and the other have crypto functions in
  libcrypto but libssl is dynamically linked against libcrypto:
  % ldd /usr/lib/libssl.so
  /usr/lib/libssl.so:
         libcrypto.so.6 => /lib/libcrypto.so.6 (0x800c00000)
         libc.so.7 => /lib/libc.so.7 (0x800647000)
- Do not explicitly link against libssl (instead of libcrypto BTW): the
  autotools magic already does this at some point;
- Improve error message when headers cannot be found.
2010-09-04 10:47:07 +00:00
Romain Tartiere
05bd15b1d3 Explicitly enable auto ISO14443-4 mode.
We may be unable to locate Mifare DESFire otherwise.
2010-09-04 10:25:07 +00:00
Romain Tartiere
a260754627 Add missing include <sys/types.h> (required for some endianness magic). 2010-09-04 09:47:15 +00:00
Romain Tartiere
0db66925e1 Add some endianness macro aliases for OpenBSD. 2010-09-04 09:42:12 +00:00
Romain Tartiere
11794763b1 Complete external document reference in comment. 2010-09-04 09:16:42 +00:00
Romain Tartiere
274dfdefd2 Update the HACKING file and give some indentation sugars. 2010-09-03 18:08:18 +00:00
Romain Tartiere
7b9242e935 Reindent (2/2).
Align cases with switch statements.
Ça y est!  Le code est beau!
2010-09-03 18:04:12 +00:00
Romain Tartiere
af061a3c1a Reindent (1/2).
After trying to tweak gindent so that it does not mess-up my ASCII art, give
and read the help of Vim to setup 'cinoptions' according to my needs
(cino=t0(0).  This changeset reindent some bits that where not indented as they
should.  A future commit will reindent the switch/case according to my (bad)
taste now that I have setup cindent correctly on my system (cino=t0(0:0).
2010-09-03 18:01:02 +00:00
Romain Tartiere
036d2956f4 Update nfc_initiator_transceive_bytes() vs. nfc_initiator_transceive_dep_bytes().
nfc_initiator_transceive_dep_bytes() was removed, and
nfc_initiator_transceive_bytes() is now configured to behave like the one or
the other of the original functions.  For details, see:
http://code.google.com/p/libnfc/source/detail?r=592
2010-09-03 16:13:46 +00:00
Romain Tartiere
70f2fe2685 Do not freeze the card Master Key in mifare-desfire-write-ndef.
Since it is irreversible, the card cannot be used for e.g. running the
regression tests suite.
2010-09-03 15:56:37 +00:00
Romain Tartiere
717e18f810 Display Master Key settings in mifare-desfire-info. 2010-09-03 15:54:58 +00:00
Romain Tartiere
9396e0010e Fix a function name I forgot to change. 2010-09-03 15:51:53 +00:00
Audrey Diacre
487bc621a9 add a new example "mifare-desfire-write-ndef" that put a simple NDEF content on DESFire. 2010-09-03 14:36:17 +00:00
Romain Tartiere
03bd356bd4 Minor tweaks.
- Improve code lisibility;
- Add reference document link.
2010-09-03 13:18:08 +00:00
Romuald Conty
bb840dccaf minor cosmetic enhancements. 2010-09-03 12:51:45 +00:00
Romain Tartiere
4c519ff9d0 Add some missing mifare_desfire_error.3 man page. 2010-09-03 11:26:41 +00:00
Romain Tartiere
d59e197ff9 Rename desfire_error_lookup() into mifare_desfire_error_lookup() for consistency with the rest of the code. 2010-09-03 11:24:25 +00:00
Romain Tartiere
ff7f136fbe Add some missing man pages. 2010-09-03 11:16:18 +00:00
Romain Tartiere
a11d067d21 Free memory. 2010-09-03 11:13:29 +00:00
Romain Tartiere
5b1d51bd55 Enhance Mifare DESFire AID code.
- Fix endianness problems;
- Enforce AID validity;
- Simplify code.
2010-09-03 10:55:57 +00:00
Romain Tartiere
087db1b298 New unit test to check Mifare DESFire AIDs containing a Mifare Classic AID. 2010-09-03 10:54:07 +00:00
Romuald Conty
1151ffdb7f fix test affected by r548. 2010-09-02 11:04:34 +00:00
Romuald Conty
02d09e58f7 Dirty patch to be able to create "real" MifareDESFareAID. 2010-08-31 16:03:08 +00:00
Romain Tartiere
8f645fbe62 Attempt to fix Mifare Classic support after r543. 2010-08-31 14:48:47 +00:00
Romain Tartiere
5aafbc9a48 Indent after last commit. 2010-08-31 12:00:56 +00:00
Romain Tartiere
7ba83f79ed Enhance the mifare-classic-write-ndef example.
- Only format the PICC if no MAD is present;
- Do not overwrite an existing MAD.
2010-08-31 12:00:02 +00:00
Romain Tartiere
a5f1a80447 Check Mifare Classic command return values.
Many command return 1 byte, and my documentation does not tell what it's
supposed to be. However, this byte is always 0 when running the regression test
suite.  It's likely to be an error code with value 0 being a no-error code.
Assume this and check that the returned byte is always 0.
2010-08-31 11:29:29 +00:00