Commit graph

298 commits

Author SHA1 Message Date
Romain Tartiere
a9f73f414d Fix wrong trailer block number for writing MAD v2. 2010-06-22 17:11:11 +00:00
Romain Tartiere
2feb65ed04 Copy MIFARE Classic commands codes from the old libnfc source to the libfreefare's one. 2010-06-22 14:01:00 +00:00
Romain Tartiere
a0da16bf65 Update documentation.
Add a note about freefare_get_tags() invalidating previously found targets.
2010-04-26 11:09:04 +00:00
Romain Tartiere
1ea30f37bb Document the new freefare_free_tag() function.
Fixes issue 22.
2010-04-26 10:53:36 +00:00
Romain Tartiere
a2263b7ea8 Remove the freefare_duplicate_tag() function.
Update issue 22
Remove the freefare_duplicate_tag() function.
2010-04-26 10:34:27 +00:00
Romain Tartiere
1f8589f2ae Don't use deprecated cutter API. 2010-04-26 09:11:28 +00:00
Romuald Conty
99b261d132 add freefare_free_tag() to free only one tag and add freefare_duplicate_tag() in order to copy a tag struct. 2010-04-20 15:17:17 +00:00
Romain Tartiere
2cf035768d Add a few hints about where to do what. 2010-04-13 14:00:32 +00:00
Romain Tartiere
bca49635f3 Add HACKING file to the autotooled tarball. Change version to 0.1.0. 2010-04-08 13:02:54 +00:00
Romain Tartiere
72ebd3af5a Add HACKING file. 2010-04-08 12:55:13 +00:00
Romain Tartiere
d6aaeec866 Fill-in the README file. 2010-04-08 12:23:58 +00:00
Romain Tartiere
c9df81d96c Use cut_omit() in tests setup() fixtures (requires cutter>=1.1.2). 2010-04-08 12:10:42 +00:00
Romain Tartiere
18f84ceb7a Detect cutter version. We will depend on 1.1.2 soon actually. 2010-04-08 12:01:14 +00:00
Romain Tartiere
0fb4e7e14c Add infrastructure for generating the ChangeLog. 2010-04-07 15:36:24 +00:00
Romuald Conty
90fce89aee next try to build under OpenBSD. 2010-04-07 14:19:08 +00:00
Romuald Conty
e68904d48a attempt to build under OpenBSD. 2010-04-07 14:06:04 +00:00
Romuald Conty
5dc0575a8b check functions letoh32 and htole32. 2010-04-07 10:23:20 +00:00
Romuald Conty
2566fb645c needs libnfc >= 1.3.4 so configure will now detect it. 2010-04-07 10:22:23 +00:00
Romain Tartiere
e5fbfbe6b7 Replace UTF-8 what-seems-to-be-an "em dash" with a basic ASCII dash: ANSI C says source code should be written in ASCII. 2010-04-01 12:04:53 +00:00
Romain Tartiere
aacddc7aae Add missing htole32() call in mifare_classic_init_value(). Fix Mifare Classic support on big-endian machines. 2010-03-31 22:46:13 +00:00
Romain Tartiere
73c50a544a Remove deprecated API mifare_ultralight_get_uid(), mifare_classic_get_uid(). 2010-03-30 16:24:37 +00:00
Romain Tartiere
574b068b3f New API function freefare_get_tag_uid().
- Deprecates mifare_classic_get_uid() and mifare_ultralight_get_uid().
2010-03-30 16:18:58 +00:00
Romain Tartiere
85e7174a02 Fix weird UIDs for Mifare UltraLight (requires libnfc at r328) 2010-03-30 16:08:07 +00:00
Romain Tartiere
017029fbbe Do not require a Mifare UltraLight TAG to be connected to get it's UID.
Submitted by:	rosek86@gmail.com
2010-03-30 13:56:49 +00:00
Romain Tartiere
26aef03a48 Add man pages. 2010-03-30 12:54:49 +00:00
Romain Tartiere
3b737a11e8 Add access bit macros to ease-up writing code using the library. 2010-03-19 09:00:06 +00:00
Romain Tartiere
feb240ee73 Fix MAD CRC algorithm.
The CRC algorithm is not a standard CRC algorithm so rename it to nxp_crc() and adjust all related code.
2010-03-18 21:03:07 +00:00
Romain Tartiere
42692ccf54 Style. 2010-03-02 19:01:12 +00:00
Romain Tartiere
0f72871eb3 Instead of copying n fields, setup a pointer to the relevant supported_tag information in mifare_tag structures. 2010-03-01 14:19:48 +00:00
Romain Tartiere
0d4744001a Add support for friendly tag names. 2010-03-01 14:04:47 +00:00
Romain Tartiere
62ddf57c53 Rework byteswap.h inclusion.
This header is not available on e.g. FreeBSD so detect it's presence in configure.ac and only include it if appropriate.  Then, if byte order manipulation macros are not defined (old glibc like the one provided by Debian GNU/Linux) define them.
2010-02-25 18:02:54 +00:00
Romuald Conty
8b2de449c7 define le32toh and htole32, this allow to compile against libc that doesn't provide these functions (like Debian Lenny) 2010-02-24 21:52:45 +00:00
Romain Tartiere
8a62a843ac Fix the test_mifare_classic_format unit test. 2010-02-23 14:22:23 +00:00
Romain Tartiere
ce006c3cc9 Change a secret ninja guru one-line expression into a function and document what it is supposed to do and how it does it. 2010-02-23 12:05:14 +00:00
Romain Tartiere
5f7f8ffe2a Add support for MIFARE Classic 4K.
- New mifare_classic_first_sector_block(), mifare_classic_last_sector_block() functions to ease detection of sectors boundaries;
  - New unit tests for mifare_classic_first_sector_block() and mifare_classic_last_sector_block();
  - Start to update the API for consistently using blocks and not mixing blocks and sectors with mifare_classic_*() functions;
  - Update the mifare-classic-format(1) example to handle MIFARE Classic 1k and 4k.

Many thanks to Johann Dantant from SpringCard for giving me MIFARE Classic 4k cards.
2010-02-23 02:12:18 +00:00
Romain Tartiere
24a9198f41 Fix wrong MIFARE Classic 4K SAK. 2010-02-23 02:03:45 +00:00
Romain Tartiere
ffcc3174b2 Add missing block_number <- block that prevented full cache hits. 2010-02-23 02:00:04 +00:00
Romain Tartiere
0f8ec71198 Add a unit test for mifare_classic_get_uid(). 2010-02-22 17:30:50 +00:00
Romain Tartiere
e0d2405a30 Rework data structures allocations / frees.
- New mifare_*_tag_new() functions for allocating and initialising memory for a given MIFARE tag;
  - Rename mifare_*_free_tag() to mifare_*_tag_free() for consistent names with mifare_*_tag_new() functions.
2010-02-22 12:25:23 +00:00
Romain Tartiere
e52fbccb4a Remove unneeded header. 2010-02-22 12:05:48 +00:00
Romain Tartiere
74bc239a71 Abstract tag manipulation functions.
- Factorize Mifare*Tag as MifareTag;
  - Factorize mifare_*_get_tags() / mifare_*_free_tags() as freefare_get_tags() and freefare_free_tags();
  - Add a new freefare_get_tag_type() function to get a tag type;
  - Update regression test suite;
  - Update example.

While this is a major change that basically change all the API, programs using libfreefare should be easily modified by replacing any Mifare*Tag variable by a generic MifareTag one, adding a few lines of code to check the target's type using freefare_get_tag_type(), and changing any call to mifare_*_get_tags() / mifare_*_free_tags() by the generic freefare_get_tags() and freefare_free_tags() functions.
2010-02-19 14:50:18 +00:00
Romain Tartiere
2fd329e530 Do not make regression tests fail: spamming my shell is enouth to reminf me to fix this. 2010-02-19 14:40:28 +00:00
Romain Tartiere
d76da4697b Update files headers and Ids. 2010-02-19 10:43:06 +00:00
Romain Tartiere
1b6d7ab210 Fix MIFARE UltraLight UID length.
Okay, either I lost some code somewhere, or I am really mad _AND_ fu**ing good at writing C code 'cause I am pretty sure I already fixed that at the very beginning of the UltraLight tags support and only after wrote all these test I don't have to modify so they pass.
2010-02-18 18:32:53 +00:00
Romain Tartiere
4c2da817f0 Fix MIFARE UltraLight related code (C99 compliance). 2010-02-18 18:13:48 +00:00
Romain Tartiere
6d5224472c Fix MIFARE Classic unit tests default key.
According to the NXP documentation, default keys are 0xffffffffffff, not 0xa0a1a2a3a4a5 nor 0xd3f7d3f7d3f7.
2010-02-18 18:12:36 +00:00
Romain Tartiere
2380583ec6 fix the mifare_classic_transfer() function. 2010-02-18 18:09:34 +00:00
Romain Tartiere
acb00368c6 Mark test_mifare_classic_get_trailer_permission() as pending.
This test requires a valid MAD to be present on the MIFARE card which is not a requirement for testing MIFARE Classic tags but MAD.
2010-02-18 17:14:37 +00:00
Romain Tartiere
2f24959116 Fix default permissions. 2010-02-18 17:07:36 +00:00
Romain Tartiere
37c404b128 ilibfreefare: The transfer operation actually returns something. 2010-02-18 16:45:24 +00:00