Commit graph

2061 commits

Author SHA1 Message Date
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
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
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
Emmanuel Dreyfus
a06bfe50a5 Workaround missing USB config
After a DESfire operation SCL3711 will sometimes enter a state where
libusb-0.x is unable to fill config field in struct usb_device. The
USB device has to be power-cycled to restore a sane state.

This introduce a work around, by using hardcoded values for endpoints
and packet size when they are unavailable.
2017-04-19 19:46:14 +02:00
Philippe Teuwen
6235a8a26b Update example script to support PCard 2017-04-16 00:05:21 +02:00
Philippe Teuwen
b59f8fb3b4 Add more missing files 2017-04-04 13:31:39 +02:00
Philippe Teuwen
fead8d6849 Add missing files to autotools release process 2017-04-04 11:10:46 +02:00
Philippe Teuwen
e41a42cf96 nfc-mfultralight: avoid compilation warning 2017-04-01 01:03:41 +02:00
Philippe Teuwen
024fca9cb7 make style 2017-04-01 00:46:12 +02:00
Philippe Teuwen
3ec9ecf800 nfc-mfultralight: fix support for MF0UL21 2017-04-01 00:25:14 +02:00
Philippe Teuwen
560f6a6413 nfc-mfultralight: better parameters checks 2017-03-31 23:21:17 +02:00
Philippe Teuwen
abae2bb17b Merge remote-tracking branch 'adam/master'
* adam/master:
  allow partial writes. tidy up usage.
  vary expected dump size based on tag type
  read extra mf-ul EV1 blocks
  show EV1 auth PACK (tag/reader trust secret)
  show EV1 storage size
  add EV1 password auth to nfc-mfultralight
2017-03-31 23:00:15 +02:00
Philippe Teuwen
f2457d0559 Add pn53x-* to CMakeLists 2017-03-31 22:46:11 +02:00
Adam Laurie
a9f3e3a2ac allow partial writes. tidy up usage. 2017-03-23 18:19:59 +00:00
Adam Laurie
963eb074ec vary expected dump size based on tag type 2017-03-23 16:42:10 +00:00
Adam Laurie
c04dd91e98 read extra mf-ul EV1 blocks 2017-03-23 16:04:02 +00:00
Adam Laurie
fe04b85678 show EV1 auth PACK (tag/reader trust secret) 2017-03-23 12:03:34 +00:00