Commit graph

2178 commits

Author SHA1 Message Date
Philippe Teuwen
f8b28523d7
Merge pull request #554 from quantum-x/master-UL-4K-DirectWrite-OneTimeWrite
Adding extended Magic Card support
2019-08-21 19:22:24 +03:00
quantum-x
ad695d0a18
Update .travis.yml 2019-08-21 10:06:19 +02:00
Philippe Teuwen
454a8c4d70 remove libcutter from travis as it's not available anymore in the repos 2019-08-19 19:48:16 +02:00
quantum-x
fbdbe6eff3
Update nfc-mfclassic.c
Adding support for extended Magic cards:
 - DirectWrite cards
 - One Time Write cards

Direct Write cards support modification of B0 directly, without any unlock codes. When we are attempting to detect if a card is 'magic', we will attempt to modify B0 directly as an initial check.

One Time Write cards support modification of B0 directly, one time only. They do not respond to magic commands, but have a fixed UID coming out of the factory. We now detect this UID, and if so, deem the card 'magic'.
2019-08-19 19:07:18 +02:00
quantum-x
c109d37783
Update nfc-mfultralight.c
Adding support for "DirectWrite" Ultralight tags.
 - The latest generation of "Magic" Ultralight tags support DirectWrite to B0.
 - Several versions of these cards are bricked if the older 'unlock' command is issued to the card.
 - To avoid this, when detecting if a card is magic, we attempt to modify B0 directly. If this fails, we proceed with an unlock command.
2019-08-19 19:04:52 +02:00
Philippe Teuwen
141907e127
Merge pull request #549 from admo/cmake_config_h
Generate config.h into build instead source directory.
2019-07-19 14:38:47 +02:00
Adam Oleksy
48d5f6b666 Generate config.h into build instead source directory. 2019-07-19 14:34:17 +02:00
Philippe Teuwen
a4af2be66c Fix PN533 hardcoded ednpoints table 2019-07-17 22:29:09 +02:00
Khem Raj
91f7db5b4d usbbus: Include stdint.h for uintX_t
stdint.h is needed for uintX_t typedefs which are
used to replace u_intX_t in libusb API headers in the cmake files

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-05-20 23:50:49 -07:00
rstular
ebb13d8965
Updated function declaration in utils/nfc-mfultralight.c
Updated a function declaration in utils/nfc-mfultralight.c to match the new style of C function declarations.
2019-04-29 09:49:09 +02:00
rstular
c42e2502d4 Fixed a typo in examples/nfc-emulate-uid.1 2019-04-28 13:25:43 -10:00
Romain Tartière
c59219905c Do outsource builds on CI
This helps figurig-out missing -I more easily.
2019-02-08 07:29:42 -10:00
Romain Tartière
ae56188005 Fix outsource build with the autotools 2019-02-08 07:25:55 -10:00
Romain Tartière
a9e4c915f2 Add missing INCLUDES
CC       pn53x-tamashell.o
    pn53x-tamashell.c:48:12: fatal error: 'readline/readline.h' file not found
    #  include <readline/readline.h>
    	   ^~~~~~~~~~~~~~~~~~~~~
    1 error generated.
2019-02-05 08:16:59 -10:00
Mikolaj Stawiski
793d5adde6 Fixed format warnings. 2018-11-25 13:48:04 +11:00
Emmanuel Dreyfus
7ca85a02de Fix typos 2018-11-19 19:16:26 +01:00
Emmanuel Dreyfus
85100c0aae Prefer hardcoded PN533 descriptors to the real ones
PN533 easily corrupts its USB descriptors. We know that and we
already try to detect and even repair them.

However there are situations where lower software layers get
confused before libnfc can help. On Windows, libusb may set
dev->config to NULL, but we can also have a non NULL dev->config
referencing corrupted data.

In order to get more robust, let us replace the Windows libusb
specific (dev->config == NULL) test by an inconditionnal use of
hardcoded descriptors when they are available.
2018-11-19 19:16:26 +01:00
Romuald Conty
ddfe2e648a
Merge pull request #517 from manu0401/timeout1
Add missing timeout
2018-11-13 11:31:54 +01:00
Emmanuel Dreyfus
2418d946a3 Add missing timeout
Add a tiemout in pn53x_initiator_select_passive_target()
so that we do not get stuck forever when pn533 misses a toggle
bit change.
2018-11-12 14:46:31 +00:00
Philippe Teuwen
b5641f8562
Merge pull request #513 from Stean/master
Add undocumented option -s to nfc-relay-picc help
2018-11-07 12:19:08 +01:00
Stean
f93169feb4 Add undocumented option -s to nfc-relay-picc man page 2018-11-04 21:30:35 +01:00
Stean
c52cdb10c8 Add undocumented option -s to usage listing 2018-11-04 21:22:46 +01:00
Markus Werle
4ae4cc86f8
Merge pull request #450 from hph86/2_fix_typo
Fix typo in nfc-mfclassic
2018-10-02 12:32:45 +02:00
Markus Werle
980513f4d1
Merge pull request #506 from nfc-tools/fix-cmake-module-path
fix CMAKE_MODULE_PATH for libnfc as a submodule
2018-10-02 12:22:41 +02:00
Markus Werle
d11db46ddd
fix CMAKE_MODULE_PATH for libnfc as a submodule
This fixes #496
2018-10-02 12:14:29 +02:00
Philippe Teuwen
a9af1927e6
Merge pull request #504 from AdamLaurie/master
Fix handling of NTAG OTP and LOCK bytes
2018-09-18 16:36:13 +02:00
Adam Laurie
25ee3a2f76 Add OTP/Capability Bytes handling to NTAG 2018-09-18 11:14:08 +01:00
Adam Laurie
3ba065f00b Remove redundant EV1 types and rely on NTAG types instead 2018-09-17 21:40:48 +01:00
Adam Laurie
40b54a10d7 Fix NTAG OTP and LOCK BYTES (Dynamic LOCK also applies to MF0UL21). Fix MF0UL21 sizing issue. 2018-09-17 16:58:49 +01:00
Adam Laurie
2229b9ed69 Merge remote-tracking branch 'upstream/master' 2018-09-17 14:40:34 +01:00
Adam Laurie
4c914e67e5 Fix handling of NTAG OTP and LOCK bytes 2018-09-17 14:37:09 +01:00
Philippe Teuwen
7c9a2a8062
Merge pull request #503 from AdamLaurie/master
Add support for Ultralight NTAG213/215/216
2018-09-16 22:37:51 +02:00
Adam Laurie
62f27c1c58 Add support for Ultralight NTAG213/215/216 2018-09-15 16:19:35 +01:00
Hanno Heinrichs
7a0a469c8a add more verbosity to RATS handling 2017-09-17 21:04:33 +02:00
Hanno Heinrichs
df4f9c0fbd fix typo 2017-09-17 21:02:50 +02:00
Hanno Heinrichs
e4ca7f45d2 remove redundant blanks 2017-09-17 21:01:12 +02:00
Philippe Teuwen
216145fba5 Merge pull request #440 from rocco8620/patch-1
Wrong variable names
2017-09-03 22:10:44 +02:00
rocco8620
2b96c9f3c5 Wrong variable names
Wrong variable names (missing dots) on line 269, 270, 271
2017-09-03 21:53:17 +02:00
Romain Tartière
2869ae2eb8 Merge pull request #420 from hramrach/master
nfc-poll: print "Waiting for card removing..." before waiting for card removal
2017-07-19 15:02:43 +02:00
Michal Suchanek
f9417586c0 nfc-poll: print "Waiting for card removing..." before waiting 2017-07-14 16:19:26 +02:00
Philippe Teuwen
14f48d0122 Fix mem leak 2017-05-18 10:40:46 +02:00
Philippe Teuwen
00700bc66d Make Travis happy 2017-05-17 15:56:41 +02:00
Philippe Teuwen
dcdbff0705 New NFC modulation type NMT_BARCODE 2017-05-17 13:58:16 +02:00
Philippe Teuwen
9f1a68530a nfc-barcode: add options -r & -n 2017-05-16 14:35:58 +02:00
Philippe Teuwen
9f4290b61b Add nfc-barcode 2017-05-16 13:22:30 +02:00
Philippe Teuwen
c9ac17c9f5 Fix USB descriptors in SCL3711, NXP_PN533 and ASK LoGO also when corrupted by received data
The problem occurs in the following succession of events:

* Emit commands returning an answer larger than 16 bytes
* Re-enumerate USB devices without power cycle, e.g. a warm reboot of the PC

The bug can be reproduced for testing purposes with usbreset.c from
https://askubuntu.com/questions/645/how-do-you-reset-a-usb-device-from-the-command-line#661

$ lsusb|grep NFC
Bus 001 Device 010: ID 04e6:5591 SCM Microsystems, Inc. SCL3711-NFC&RW
$ sudo ./usbreset /dev/bus/usb/001/010
Resetting USB device /dev/bus/usb/001/010
Reset successful
$ echo -e "4a 01 00\n423000" |pn53x-tamashell
$ sudo ./usbreset /dev/bus/usb/001/010
Resetting USB device /dev/bus/usb/001/010
Error in ioctl: No such device
$ lsusb|grep NFC
... device disappeared

In the example above, reading 4 pages of a MFUL corrupted one single byte.
The entire buffer can be corrupted e.g. with fast-reading a MFUL EV1:
$ echo -e "4a 01 00\n423a0013"|pn53x-tamashell
2017-04-20 09:06:47 +02:00
Philippe Teuwen
1bf542b9e2 cosmetic 2017-04-20 09:06:41 +02:00
Philippe Teuwen
767abe50e2 PN533: Abuse the overflow bug to restore USB descriptors in one go 2017-04-20 08:35:46 +02:00
Philippe Teuwen
38164c49ef Fix USB descriptors in SCL3711, NXP_PN533 and ASK LoGO if needed when closing device
The problem occurs in the following succession of events:

* Emit commands larger than 17 bytes
* Re-enumerate USB devices without power cycle, e.g. a warm reboot of the PC

The bug can be reproduced for testing purposes with usbreset.c from
https://askubuntu.com/questions/645/how-do-you-reset-a-usb-device-from-the-command-line#661

$ lsusb|grep NFC
Bus 001 Device 010: ID 04e6:5591 SCM Microsystems, Inc. SCL3711-NFC&RW
$ sudo ./usbreset /dev/bus/usb/001/010
Resetting USB device /dev/bus/usb/001/010
Reset successful
$ echo 06000000000000000000000000000000000000 |pn53x-tamashell
$ sudo ./usbreset /dev/bus/usb/001/010
Resetting USB device /dev/bus/usb/001/010
Error in ioctl: No such device
$ lsusb|grep NFC
... device disappeared
2017-04-20 01:46:32 +02:00
Philippe Teuwen
c958b2c25d Enable missing USB desc workaround for NXP_PN533 too 2017-04-19 20:24:55 +02:00