libnfc/libnfc
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
..
buses astyle 2017-02-18 13:05:59 +01:00
chips Reduce variables scopes 2017-02-18 22:20:15 +01:00
drivers Fix USB descriptors in SCL3711, NXP_PN533 and ASK LoGO also when corrupted by received data 2017-04-20 09:06:47 +02:00
additional-pages.dox Various typos 2013-01-31 21:58:29 +01:00
CMakeLists.txt Some systems (e.g. glibc < 2.17) require librt to get clock_gettime -> CMAKE 2017-03-02 23:42:36 +01:00
conf.c conf: close file 2017-02-18 22:20:15 +01:00
conf.h Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
drivers.h Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
iso7816.h Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
iso14443-subr.c Reduce variables scopes 2017-02-18 22:20:15 +01:00
log-internal.c Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
log-internal.h Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
log.c Revert "Check data from getenv("LIBNFC_LOG_LEVEL") and config file" 2013-09-22 19:55:31 +02:00
log.h Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
Makefile.am Add more missing files 2017-04-04 13:31:39 +02:00
mirror-subr.c Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
mirror-subr.h Remove spurious mirror_uint8_ts declaration, fix issue #375 2017-02-16 23:00:37 +01:00
nfc-device.c nfc_initiator_select_passive_target(): grant NP_INFINITE_SELECT also for ISO14443B* 2014-02-01 02:45:17 +01:00
nfc-emulation.c Remove dead code 2013-09-22 03:13:09 +02:00
nfc-internal.c Remove unneeded test, fix issue #376 2017-02-16 23:05:02 +01:00
nfc-internal.h Better list of supported modulations & baud rates 2014-03-12 00:00:08 +01:00
nfc.c Add asserts to tell static analyzer we know what we're doing... 2017-02-18 18:08:27 +01:00
target-subr.c Fix warning about out-of-bound read 2013-09-19 23:08:06 +02:00
target-subr.h Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00