Commit graph

56 commits

Author SHA1 Message Date
Stefan Walkner
565ee18b8e Fix build with CMake
- Fix library finding ('nfc' instead of 'libnfc');
- Generate config.h from template on non-win32 platforms;
- While here, include protection for config.h in several files.
2017-04-24 09:35:08 +02:00
Pi3rrot
b819315caa Add support for Mifare Mini 0.3k 2016-11-22 21:27:30 +01:00
Romain Tartière
0ef6a74963 Drop deprecated struct supported_tag. 2016-01-19 15:45:37 +01:00
Romain Tartière
ee628f7ec5 Rework tag allocation.
Split Mifare Classic 1 and 4K tag allocation.
Rely on new tasting functions.
2016-01-19 15:45:37 +01:00
Romain Tartière
0279361873 Introduce tasting functions.
References #17.
2016-01-19 15:45:37 +01:00
Romain Tartière
34ee5bd28b Fix build. 2015-06-01 13:16:43 +02:00
Romain Tartière
1e43abd9d4 Leave enougth room for the final \0. 2015-06-01 13:15:42 +02:00
Romain Tartière
6049acaf5a Introduce experimental FeliCa Lite API. 2015-05-13 02:06:55 +02:00
Romain Tartière
1ce3db3ca6 Improve naming consistency.
Ensure all MIFARE related names and structures start with "mifare_" or
"MIFARE_".
2015-05-12 13:52:18 +02:00
Romain Tartière
48e4f979a9 Add modulation_type to the supported_tag structure.
This will allow supporting tags using other modulations.
2015-05-12 13:11:56 +02:00
Romain Tartière
07695f4c18 Remove subversion artifacts.
We do not have $Id$ to expand anymore.
2015-05-12 12:22:39 +02:00
Romain Tartière
c388ba6b30 Another step in card type agnostism direction. 2015-05-11 22:55:32 +02:00
Romain Tartière
42b21ff42f Rename MifareTag to FreefareTag.
Because we are libfreefare and not libmifare, the generic tag type
should not be so specific.
2015-05-11 18:55:20 +02:00
Romain Tartière
510d8a4b85 Reindent after last commit. 2014-04-06 14:14:01 +02:00
Romain Tartière
3085408bf2 Check malloc() return value.
Fixes issue 25.
2014-04-06 13:38:12 +02:00
Philippe Teuwen
2960f704f8 Let's redirect NFC phones to Desfire as they're ISO14443-4 2014-02-11 17:24:38 +01:00
Philippe Teuwen
e797ee2a2e Add freefare_selected_tag_is_present() 2014-01-27 16:32:23 +01:00
Maxim Chechel
9ee3687280 Support for Dual Interface cards like UICC/eSE SmartMX based emulation 2013-12-18 19:14:50 +04:00
Romuald Conty
a8e0b6e1e7 Support Infineon Mifare Classic 1k. (Fixes Issue 88)
Thanks to Gernoth!
2012-06-01 00:38:38 +00:00
Ludovic Rousseau
73a3eb7268 Fix spelling mistakes in manpages
Closes Issue #90
2012-05-18 16:51:51 +00:00
Romain Tartiere
fe5e7f3016 Fix signed/unsigned comparison. 2012-05-14 13:57:20 +00:00
Audrey Diacre
4f0227ddcb update to use libnfc's trunk 2012-01-25 09:58:16 +00:00
Romain Tartiere
68ef944cd0 Make freefare_tag_new() public (Fixes issue 64). 2011-09-29 14:10:07 +00:00
Romain Tartiere
f19d9bd05f Fix parenthesis position. 2010-12-28 11:42:24 +00:00
Romain Tartiere
82a7b8df66 Merge de libfreefare-ultralight branch into trunk (Mifare UltraLightC support). 2010-12-28 11:30:31 +00:00
Romain Tartiere
06c052db36 Detect Mifare DESFire targets with more than one historical character. 2010-12-24 22:14:56 +00:00
Romain Tartiere
dd5156a997 Reindent. 2010-12-18 13:32: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
d9b2deebe2 Rework error reporting infrastructure. 2010-10-29 13:10:23 +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
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
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
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
2fc0d76044 Split-out freefare_tag_new() from freefare_get_tags().
Fixes issue 39.
2010-08-24 11:41:33 +00:00
Romain Tartiere
53550cb5ed Do not call directly nfc_initiator_select_passive_target() but rather nfc_initiator_list_passive_targets() in freefare_get_tags(). 2010-08-24 11:15:42 +00:00
Romain Tartiere
890c6e3c2e Enforce target type identification with manufacturer code comparison. 2010-08-04 16:18:12 +00:00
Romain Tartiere
3aee8b560e Do not specify Mifare DESFire target size in it's friendly name: all work the same way. 2010-08-04 16:12:18 +00:00
Romain Tartiere
03da46df65 Enforce target type identification with ATS comparison. 2010-08-04 16:11:09 +00:00
Romain Tartiere
f0e03b99fb Don't check the ATQA to determine tags type, it should not be used. 2010-08-04 12:51:34 +00:00
Romain Tartiere
bef4ec342f Don't keep unsupported tags selected.
Currently, when the libfreefare finds a NFC target, it checks whether it's a
supported one looking at it's ATQA.

If the target's ATQA is not in the supported ATQA list, the target was not
deselected.  While this is buggy, it allowed to detect 2 tags with colliding
ATQA on a single NFC device and still have the ATQA of each tag (on ATQA
collision, the ATQA is set to 0x0000 by the NFC chip, but as the tag is not
deselected, it will have a second chance to tell it's ATQA when it will be idle
again):

 computer             PCD                   PICC1   PICC2
    |                  |             ATQA:  0x1234  0x6789
    |                  |                      |       |
    |- InListTargets ->|                      |       |
    |                  |------ REQA ----->(===============)
    |                  |<---- ATQA 1234 ------|       |      } Both reply
    |                  |<---- ATQA 6789 --------------|      } simultaneously
    |                  |                      S       |
    |                  | // Collision detected PICC1 only is selected because
    |                  | // only a single tag was wanted.  It's ATQA is set
    |                  | // to 0x0000.
    |<-- ATQA 0x0000 --|                      S       |
    | // Unsuported ATQA, skipped             S       |
    |                  |                      S       |
    | // DESELECT IS MISSING HERE!            S       |
    |                  |                      S       |
    |- InListTargets ->|                      S       |
    |                  |------ REQA ----->(===============)
    |                  |<---- ATQA 6789 --------------S // PICC1 won't reply
    |<-- ATQA 0x6789 --|                      |       S // it is still selected
    | // Supported, deselect it               |       S
    |--- InDeselect -->|                      |       S
    |                  |-------- HALT --------------->X
    |                  |                      |       X
    |- InListTargets ->|                      |       X
    |                  |------ REQA ----->(===============)
    |                  |<---- ATQA 1234 ------S       X // PICC2 won't reply
    |<-- ATQA 0x1234 --|                      S       X // it is deselected
    | // Supported, deselect it               S       X
    |--- InDeselect -->|                      S       X
    |                  |-------- HALT ------->X       X
    |                  |                      X       X
    |--- InDeselect -->|                      X       X
    |                  |------ REQA ----->(===============)
    |                  |                      X       X // No reply
    |                  |                      X       X

                                          Tag timeline legend:
                                            | - Target idle
                                            S - Target selected
                                            X - Target deselected

Since PN53x devices can only known about 2 tags simultaneously, presenting 3
targets to the NFC device caused an infinite loop.

This commit prevents this infinite loop to occur, and will be completed later
by another commit for not relying on the ATQA to determine targets type.
2010-08-04 12:08:38 +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
d186bfbaa3 Update after libnfc API change. 2010-07-21 11:41:58 +00:00
Romain Tartiere
5027d69b7e Silent down gcc44 -Wextra warnings. 2010-06-26 13:48:25 +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
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