Parent Directory
|
Revision Log
| Links to HEAD: | (view) (download) (annotate) |
| Sticky Revision: |
Add and use get_ccid_device_descriptor() to get the CCID descriptor including a fix for bogus readers (Oz776, Reiner SCT and bludrive II) Thanks to Diego Elio Pettenò and Dario Leone for the patch
OpenUSBByName(): return STATUS_COMM_ERROR instead of STATUS_NO_SUCH_DEVICE if the cause of the failure is libusb_claim_interface(). The main cause if the use of OpenCT. The OpenCT detection code in pcsc-lite is not triggered if the driver returns STATUS_NO_SUCH_DEVICE. So the driver must return someting else in that case.
OpenUSBByName(): use the correct type to fix compiler warning ccid_usb.c: In function `OpenUSBByName': ccid_usb.c:294: warning: comparison between signed and unsigned integer expressions
Athena IDProtect Key v1 was bogus. The v2 should work.
Convert the return value from libusb code to IFD_* in InterruptRead() instead of IFDHPolling(). We do not return IFD_NO_SUCH_DEVICE any more. This value will be returned by the next libusb_*() call
Include config.h before any other local includes to the configuration defined in config.h is used. This is just a preventive change.
Use the new Info.plist parser API
Do not hardcode the libusb-1.0 include header path (remove the libusb-1.0/ part)
libusb <= 1.0.8 does not implement a reference counter in libusb_init()/libusb_exit() for the default context. We then use our own and unique libusb context.
OpenUSBByName(): use DEBUG_CRITICAL() instead of printf() to log an error
WriteUSB() & ReadUSB(): also display the value returned by libusb. The error is not always reported by the kernel so errno is not significant.
Add support of TAG_IFD_STOP_POLLING_THREAD and use of the asynchronous libusb API to be able to stop a transfer. We are now "polling" for card movements every 1 hour or once an event is detected on the interrupt endpoint of the device. Another gain is that the driver will terminate "instantly" after pcscd request instead of after a maximum of 2 seconds (previous polling timeout).
Use ctx instead of NULL to keep the information that this parameter is the libusb context.
OpenUSBByName(): call libusb_exit() if we can't use the reader CloseUSB(): call libusb_exit() before exiting
OpenUSBByName(): free the libusb allocated list & devices when we are done with it
OpenUSBByName(): call libusb_init() just before the next libusb call
get_end_points(): use LIBUSB_ENDPOINT_DIR_MASK instead of LIBUSB_TRANSFER_TYPE_MASK to get the direction of an endpoint. .bulk_out field were never set and then not working (No such file or directory)
WriteUSB() & ReadUSB(): the same function libusb_bulk_transfer() is now ued to read and write to a USB device. So I use "write failed" and "read failed" instead of the libusb function name to log an error.
WriteUSB(), ReadUSB() & InterruptRead(): display strerror(errno) instead of just the code returned by the libusb_*_transfer() function
use libusb-1.0/libusb.h instead of usb.h (from libusb-0.1)
Use libusb-1.0 instead of libusb-0.1
update copyright date
OpenUSBByName(): allow the combination of USE_COMPOSITE_AS_MULTISLOT and libhal. It does work so do not prevent its use.
Add support of SCARD_ATTR_VENDOR_IFD_SERIAL_NO
change read timeout from second to millisecond unit to have a sub-second control
Fix 1 compiler warning ccid_usb.c: In function ‘InterruptRead’: ccid_usb.c:987: warning: pointer targets in passing argument 3 of ‘log_xxd’ differ in signedness /usr/include/PCSC/debuglog.h:83: note: expected ‘const unsigned char *’ but argument is of type ‘char *’
Fix a compiler warning ccid_usb.c: In function ‘OpenUSB’: ccid_usb.c:138: warning: unused parameter ‘Channel’
Todos Argos Mini II with firmware before 1.01 has a bogus CCID descriptor: "Automatic IFSD exchange as first exchange (T=1)" is missing. You can't use a T=1 card with this reader.
Precise Biometrics Precise 250 MC with firmware before 50.00 is bogus: time extension requests are not sent back to the host
Precise Biometrics Precise 200 MC with firmware before 50.00 is bogus: time extension requests are not sent back to the host
Use usb_strerror() instead of strerror(errno) to also get the libusb specifc error messages
OpenUSBByName(): make the libhal scheme parsing more robust. Readers serial "numbers" may contain '_' characters
change InterruptRead() to add a timeout parameter. We need a short timeout in ccid_open_hack_pre()
InterruptRead(): also log reader_index (instead of Lun) for debug
OpenUSBByName(): do not modify the device name. The same pointer is used by pcscd
InterruptRead(): use usb_strerror() to display the error message in text instead of just decimal
If the driver fails to open a device (wrong interface number in the libhal scheme for example) then return IFD_NO_SUCH_DEVICE instead of the generic error IFD_COMMUNICATION_ERROR
InterruptRead(): use PERIODIC instead of COMM debug level to not pollute to much the logs for this _periodic_ call
ccid_check_firmware(): reindent a line
OpenUSBByName(): no need to get a pointer on the device serial number from the HAL string
ACS ACR122U-WB-R with firmware < 2.06 are bogus: APDU with 0x7B (123) bytes expected do not work with a 14443 card. The reader returns SW=63 00 instead.
do not power up a card with a voltage not supported by the reader
OpenUSBByName(): static_interface variable is used only with USE_COMPOSITE_AS_MULTISLOT
OpenUSBByName(): only increase the interface number for the next "slot" if the previous interface was opened correctly It is now posible to use 2 composite readers without libusb and libhal scheme
OpenUSBByName(): support more than one composite or composite-as-multislot readers
add support of a composite device as multi-slots device
add support of PIN_PROPERTIES_STRUCTURE structure and FEATURE_IFD_PIN_PROPERTIES Thanks to Martin Paljak for the patch
OpenUSBByName(): support more than one CCID interface per USB device with the libhal scheme
allow to list more than one CCID interface per USB device
OpenUSBByName(): device_vendor and device_product varioables are not used on Mac OS X.
use snprintf() instead of sprintf() to avoid potential buffer overflow
explicitly cast result in void when not used (reported by the splint tool)
InterruptRead(): do not log the error if errno == ENODEV since that happens in canse of timeout
InterruptRead(): do not cache if the reader has failed previously since this state was stored in a static variable global to all the readers managed by the driver and was not per reader. Without this mechanism we may have a bit more error messages logged but the driver will work in a multi-reader configuration.
InterruptRead(): remove a \n in a log
InterruptRead(): use a 2 seconds timeout since it is not possible for pcscd to kill the polling thread. See thread on libusb-devel http://sourceforge.net/mailarchive/forum.php?thread_name=baabf6440805290726s228bce20r5073d55d8d56241b%40mail.gmail.com&forum_name=libusb-devel
update Free Software Foundation mail address
Simulate card absence for the GemCore SIM Pro
ccid_check_firmware(): use unsigned int instead of int ccid_usb.c:720: warning: comparison between signed and unsigned
InterruptRead(): in case of timeout we can also get EAGAIN (Resource temporarily unavailable)
add support for Bludrive II CCID
add InterruptRead() to read the interrupt pipe use by asynchronous card movements
add comments
add interrupt end point field in _usbDevice structure
add bNumEndpoints field in _ccid_descriptor structure
ReadUSB(): return an error if we get more than 10 duplicate frames error in one read. Avoids an infinite loop with some buggy readers.
add support for Mac OS X Leopard (10.5.1)
remove Reiner-SCT cyberJack pinpad(a) from bogus firmware list since yhe bug is just a missing management of time requests
move the readers without a correct firmware together at the end of the list of bogus firmwares
add Reiner-SCT cyberJack pinpad(a) in the list of bogus firmwares
add support for Reiner SCT
get_end_points(): check that dev->config is not NULL before dereferencing dev->config->bNumInterfaces Avoid a crash on Mac OS X
add support of the O2Micro oz776 (ProductID 0x7772)
get_end_points(): avoid a double free on close for the O2MICRO_OZ776 special case. " In ccid_usb.c you move the extra descriptor from the endpoint 2 descriptor to the interface descriptor. The problem is, when libusb try to free the descriptors associated to this device on shutdown or if the device disappears, it tries to free the same buffer twice. For me it means the pcscd is killed with a glibc detected "double free". " Thanks to Michael Wegner for the patch
add support of ICCD version A and B
ControlUSB(): add some debug: request value and data send/received
get_end_points(): change parameter name from usb_device to usbdevice to avoid: warning: declaration of 'usb_device' shadows a global declaration /usr/include/usb.h:329: warning: shadowed declaration is here
ControlUSB(): explicit cast to avoid warning: pointer targets in passing argument 6 of 'usb_control_msg' differ in signedness
get_data_rates(): use ControlUSB() instead of usb_control_msg()
add ControlUSB() declaration and implementation
get_end_points(): correct bug in revision 2392
get_end_points(): use usb_interface->altsetting->bNumEndpoints instead of the hardcoded value 3
Bogus_firmwares[]: the driver now contains patches to circumvent the Oz776 reader. It is then declared bogus only if O2MICRO_OZ776_PATCH is not defined
move #define O2MICRO_OZ776_PATCH from ccid_usb.c to ccid.h so we can use it in other .c files
CloseUSB(): free .dirname and .filename only for the last slot
OpenUSBByName(): move the "Checking device: " log message out of the usbDevice[] loop since we display info of the new device and not of a device from usbDevice[]
struct _usbDevice: replace struct usb_device *dev; by char *dirname; and char *filename; since the libusb structure can be modified at any time by libusb (this structure is reused for another USB device when the USB device is removed)
get_data_rates() now has a struct usb_device *dev parameter to avoid storing it in struct _usbDevice
remove unused get_desc() function
revert revisions 2289 and 2290 It is not the correct solution to the problem
WriteUSB()/ReadUSB(): check that the device entry is still valid before using it
WriteUSB()/ReadUSB(): call CloseUSB() as soon as the device disapears (ENODEV) since the libusb structures pointed by usbDevice[] may be reused by another USB device
WriteUSB() & ReadUSB(): return STATUS_NO_SUCH_DEVICE if read() or write() fails with ENODEV
Bogus_firm[]: firmware 1.01 for Alcor AU9520 is bogus. The time request of the card is not forwarded to the host by the reader.
remove trailing spaces at end of lines
ReadUSB(): check that usbDevice[reader_index].dev->bus is still non-NULL (as we do in WriteUSB()) before dereferencing it in the debug message. Thanks to Michael Wegner for the patch
correct a typo in a comment
ReadUSB(): be sure we have read enough bytes before checking for frame detectation
ReadUSB(): detect and ignore duplicated CCID frames
SCM SPR 532 with firmware < 5.10 has problems
declare get_ccid_usb_interface() as EXTERNAL since this function is used by src/parse
firmwares for Athena ASE IIIe USBv2 and ASE IIIe KB USB were bogus.
the ActivCard V2 is bogus (problem with wMaxPacketSize size frames)
get_ccid_usb_interface(): use the same code for a device with 1 or >1 interfaces
add support of GemCore SIM Pro and GemCore POS Pro (serial and USB).
CloseUSB(): free the allocated arrayOfSupportedDataRates only for the pimary slot. The other slots of the same reader either point to the same array or point to a statically allocated array.
OpenUSBByName(): check that usbDevice[previous_reader_index].dev is still valid before dereferencing it Thanks to Martin Paljak for the bug report
OpenUSBByName(): use log level INFO instead of CRITICAL to display copyright information
release the allocated ressources only when the last slot of a multi-slot reader is closed
OpenUSBByName(): do not (re)set the usbDevice[].ccid.pbSeq field since we just copied the complete structure just before
remove #ifdef DEBUG_LEVEL_COMM since DEBUG_LEVEL_COMM is a numeric value and not a compilation flag anymore. Debug is always active and filtered by pcscd.
get_data_rates(): check the response size only if bNumDataRatesSupported is non zero
CloseUSB(): call usb_reset() only if DRIVER_OPTION_RESET_ON_CLOSE is set. The problem was that a device reset also disconnects the keyboard on a keyboard + reader device.
get_data_rates(): check that we do not get more data rates than the reader supports
OpenUSBByName(): call usb_close() if the device can't be used
OpenUSBByName(): vendorID, productID are unsigned avoids a "comparison between signed and unsigned" warning
WriteUSB(): do not parse usbDevice[reader_index].dev->bus if it is a NULL pointer (the device has been removed for example)
get_data_rates(): if the reader do not support GET DATA RATES we return NULL instead of a manually constructed/fake list
Open*ByName(): initialise dwMaxDataRate field
get_data_rates(): check that the reader sends a DATA RATES list size multiple of 4 othewise it is an error
Open*ByName: do not initialise the now disappeared .dwMaxDataRate field
get_data_rates(): if the CCID command GET DATA RATES is nto supported the array of supported rates contains only the default and max data rates
get_data_rates(): test if int_array is NULL (and not buffer)
get_data_rates(): use the real interface number instead of 0
get_data_rates(): buffer argument of usb_control_msg is (char *) and not (unsigned char *)
get_data_rates() returns an unsigned int [] (not just int [])
use the calculated read timeout instead of a fixed value
OpenUSBByName(): get the list of data rates the reader supports See 3.7.3 Get Data Rates (page 25) from CCID spec 1.00
change licence from GNU GPL to GNU LGPL
add an "interface field" in _usbDevice. This value is set in OpenUSB() and used in CloseUSB(). The struct usb_device structure is half "corrupted" after the USB device is removed and we wanted to use it when when closing the driver after a reader removal. This caused a crash with libusb 0.1.10.
Bogus_firmwares[]: add Kobil KAAN Base & KAAN Advanced readers
Bogus_firmwares[]: the 3 SMC readers had the same (cut-n-paste) USB identification
SPR 532 firmware previous to 5.04 is bogus regarding min/max pin lengths
check firmware version to avoid firmwares with bugs. You can still use a bigus firmware by setting DRIVER_OPTION_USE_BOGUS_FIRMWARE in Info.plist
the first argument of get_desc() is lun instead of channel and the function uses LunToReaderIndex() to get the reader index
get_ccid_usb_interface(): the O2Micro OZ776S reader has a wrong USB descriptor. The extra[] field is associated with the last endpoint instead of the main USB descriptor.
for multi-slots readers IFDHCreateChannel*()/OpenUSB is called for each slot. If we are opening a new slot of an already opened reader we reuse the same data (same libusb structures) and share the same pbSeq.
use pbSeq instead of bSeq
remove defaultFeatures management (was used for SCR331-DI hack)
use reader_index instead of lun as reader identification
initialise ccid.defaultFeatures field
initialise bMaxSlotIndex and ccid.bCurrentSlotIndex fields
OpenUSBByName(): use base 0 instead of 16 in strtoul() so that you can express the decimal value 15 as: 15 (decimal), 0xF (hex) or 017 (octal). It is not really needed since the reader descriptions in Info.plist are all in hex.
rename PCSCLITE_MAX_READERS in CCID_DRIVER_MAX_READERS This value is not defined by pcsc-lite but is internal to the CCID driver. By default pcsc-lite supports the same number of readers (16).
mark potentially null values as /*@null@*/ for splint
mark unused arguments as /*@unused@*/ for splint
include <sys/types.h> so splint can parse the file
lun is (unsigned int) so reader = LunToReaderIndex(lun) is also (unsigned int)
lun is (unsigned int) instead of (int) Avoid a warning by splint in #define LunToReaderIndex(Lun) (Lun>>16) Left operand of >> may be negative (int): lun >> 16
add support for SCardGetAttrib(.., IOCTL_SMARTCARD_VENDOR_VERIFY_PIN, ..) to know if the reader supports SCardControl(.., IOCTL_SMARTCARD_VENDOR_VERIFY_PIN, ..)
set length to 0 when a usb_bulk_read() error is returned
recompile using gcc -pedantic and correct: - some C++ syntax comments - many signedness "problems"
do not export get_end_points() declaration and make the function static
add support for the libusb naming scheme: usb:%04x/%04x:libusb:%s
add { } to avoid ambiguities now that DEBUG_* are "if (x) y" constructions
define ALLOW_PROPRIETARY_CLASS by default Proprietary USB Class (0xFF) are (or are not) accepted A proprietary class is used for devices released before the final CCID specifications were ready. We should not have problems with non CCID devices becasue the Manufacturer and Product ID are also used to identify the device */
allow proprietary CCID Class byte but only if ALLOW_PROPRIETARY_CLASS is defined. You should know what you do. Only useful for pre-CCID devices.
fill dwDefaultClock and dwMaxDataRate according to the reader descriptor
first bSeq is 0 (even if 1 works ok)
usb_reset() the device before usb_close()
add dwMaxIFSD field
- remove device_name[] from struct _usbDevice - use naming scheme usb:vendor/product - simplify (a bit) the code
use DEBUG_CRITICAL2() instead of DEBUG_CRITICAL()
add support of USB devices with multiple interfaces (like the Silitek SK-3105 keyboard)
add support of IFDHCreateChannelByName
call ccid_open_hack() in IFDHCreateChannel() instead of in each OpenPort()
remove function name from debug message since __FUNCTION__ is now used in DEBUG_* macro definition
the USB extra field length shall be exactly 54 bytes to be CCID.
add a test on the USB extra field length to avoid a crash and print an error message. This occurs when the reader is _not_ CCID and the CCID driver is used (wrong Info.plist for example).
read and write timeouts are not symmetric. write timout can be shorter since the reader and card is not supposed to do anything before receiving (write) a command.
correctly use the device name in a debug message instead of a not yet initialised field.
redesign to separate communication media and CCID protocol. call ccid_open_hack() upon open to do some reader dependent magic.
do not duplicate the Info.plist filename but "calculate" it once
use a 1 minute USB timeout instead of the 1 second used for debug
Initial revision
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
| ViewVC Help | |
| Powered by ViewVC 1.1.5 |