Commit graph

67 commits

Author SHA1 Message Date
Romain Tartiere
12ad1a452a Set the default ATS instead of a custom one.
This prevent some tools to work properly with a card afterthat.
2010-12-25 09:46:56 +00:00
Romain Tartiere
9a4b7b5882 New API function mifare_desfire_set_ats(). 2010-12-24 22:08:56 +00:00
Romain Tartiere
9d8c991f50 Fix example. 2010-12-24 21:10:48 +00:00
Romain Tartiere
adbba0342b New API function mifare_desfire_set_default_key(). 2010-12-24 20:41:43 +00:00
Romain Tartiere
3fd80a3eff Enable the mifare-desfire-ev1-configure-random-uid example. 2010-12-15 13:19:42 +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
Romain Tartiere
2750c0372c Display master-key version in mifare-desfire-info. 2010-11-20 01:58:09 +00:00
Romain Tartiere
678b71edb0 Rename some macros for consistency. 2010-10-29 13:01:55 +00:00
Romain Tartiere
22500eaaf6 Add missing Id. 2010-10-08 11:46:58 +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
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
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
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
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
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
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
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
Romuald Conty
bb840dccaf minor cosmetic enhancements. 2010-09-03 12:51:45 +00:00
Romuald Conty
02d09e58f7 Dirty patch to be able to create "real" MifareDESFareAID. 2010-08-31 16:03:08 +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
e68ae59c5e Rename mad_application_(read|write) to mifare_application_(read|write).
Fixes issue 40.
2010-08-24 10:51:58 +00:00
Romain Tartiere
cc50ebc4df Fix $Id$ vcs keywords.
- Add a new svn-keywords target to fix missing properties;
  - Add a new svn-keywords-check target to locate files lacking $Id$ statement.
2010-07-29 06:25:57 +00:00
Romuald Conty
9ff14c416d mifare-classic-write-ndef now use newly introduced public keys and AID. 2010-07-28 10:23:56 +00:00
Romain Tartiere
6631491dec change sectors keys THEN write application data.
This should avoid failure in some advanced use cases and when the example will be able to add user-provided data without data-loss.

Suggested by:	Romuald Conty <rconty@il4p.fr>
2010-07-27 14:03:20 +00:00
Romain Tartiere
0ada18e508 Fix sector counts.
Submitted by:	Romuald Conty <rconty@il4p.fr>
Pointy hat to:	me
2010-07-27 13:54:09 +00:00
Romain Tartiere
21fa85ca1d Only search keys of existing sectors. 2010-07-27 13:37:57 +00:00
Romain Tartiere
9872a1b087 Rename DESFIRE_4K to DESFIRE.
The code can work with virtually any size of DESFire (since the operating
system embedded in the card handle almost everything), so there is no need for
us to distinguish cards of different sizes.
2010-07-27 08:44:12 +00:00
Romain Tartiere
5779d6f945 Merge the freefare-desfire branch into trunk. 2010-07-26 21:48:18 +00:00
Romain Tartiere
3f6a142b57 Enhance the mifare-classic-write-ndef example.
- Use the new mifare_application_alloc() and mad_application_write API;
  - Deal with writing over multiple sectors with different keys.
2010-07-26 20:27:21 +00:00
Romain Tartiere
9ba6d198b8 Merge r487 from the libfreefare-desfire branch. 2010-07-26 20:21:02 +00:00
Romain Tartiere
f425ae30c6 Merge r486 from the libfreefare-desfire branch. 2010-07-26 20:20:22 +00:00
Romuald Conty
4230d2b378 Add missing config.h include in mifare-classic-format example. Fix Issue 34. 2010-07-07 07:25:16 +00:00
Romain Tartiere
9e5820b89e Allow mifare-classic-format to be run non-interactively. 2010-07-03 09:14:32 +00:00
Romain Tartiere
6cbb9f4f9d Add a fast-format feature in the mifare-classic-format utility to only erase MAD. 2010-07-03 09:09:26 +00:00
Romain Tartiere
163df002f2 Rename MifareSectorNumber to MifareClassicSectorNumber. 2010-07-03 06:31:28 +00:00
Romain Tartiere
163ce56cc0 Refactoring Blocks vs. Sectors.
- mifare_classic_format_sector() now wants a sector instead of a block (the name was really disturbing);
  - New public API functions for Block <=> Sector conversions.
2010-07-01 23:19:45 +00:00
Romain Tartiere
4a1415ed01 s/blocks/sectors/ 2010-07-01 13:25:14 +00:00
Romuald Conty
97edcb45e8 factorize some code in examples/mifare-classic-write-ndef 2010-06-29 15:16:35 +00:00
Romuald Conty
0296e52d29 minor enhancement in mifare-classic-format progress display with 4k. 2010-06-29 08:26:50 +00:00
Romuald Conty
0447774e17 (mifare-classic-write-ndef) fix authentication block number with 4k. 2010-06-28 19:13:10 +00:00