Parent Directory
|
Revision Log
| Links to HEAD: | (view) (download) (annotate) |
| Sticky Revision: |
IFDHCreateChannelByName(): increase the timeout from 100ms to 1000ms to give more time to the reader to setup and answer. 100ms is too short for the Kobil KAAN Base for example.
Use TAG_IFD_POLLING_THREAD_WITH_TIMEOUT instead of TAG_IFD_POLLING_THREAD to support the auto power off feature introduced in pcsc-lite revision 5328
Remove two useless static function declarations
get_IFSC(): 0xFF is not a valid value for IFSC according to ISO 7816-3, CCID and MasterCard standards. The maximum value is 0xFE. The "TIVU SAT" from ITALY www.tivu.tv card has such an IFSC in its ATR: 3F FF 95 00 FF 91 81 71 FF 47 00 54 49 47 45 52 30 30 33 20 52 65 76 32 35 30 64
ifdhandler.c: In function ‘IFDHPolling’: ifdhandler.c:328: warning: unused variable ‘ret’
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
IFDHSetCapabilities(): remove dead comments
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
add get_IFSC() to get the IFSC value from the ATR. IFSC is not just the value of TAi (i>2) For example "3B 80 81 1F 07 19" has a TA3 but it is not the IFSC since T=15 is defined in TD2 so before TA3
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 PROTOCOL_CCID instead of 0 when checking bInterfaceProtocol
Rename ICCD_A in PROTOCOL_ICCD_A, ICCD_B in PROTOCOL_ICCD_B and add PROTOCOL_CCID for plain CCID
Use libusb-1.0 instead of libusb-0.1
update copyright date
Add support of SCARD_ATTR_VENDOR_IFD_SERIAL_NO
IFDHCreateChannelByName() & IFDHCreateChannel(): use the low level CmdGetSlotStatus() instead of IFDHICCPresence() to be able to fix the read timeout. We use a read timeout of 100 milliseconds instead of 2 secondes. The maximum wait time is now 200 milliseconds instead of 4 seconds. This increases the startup time a lot (up to 95%) when pcscd is auto started.
change read timeout from second to millisecond unit to have a sub-second control
IFDHControl(): set PCSCv2_PART10_PROPERTY_bEntryValidationCondition specific value only for the Gemalto PC Pinpad V1 & Covadis Véga-Alpha readers.
IFDHControl(): The Covadis Véga-Alpha share the same firmware with the Gemalto PC Pinpad V1
IFDHControl(): add comments
IFDHControl(): add support of IOCTL_FEATURE_GET_TLV_PROPERTIES bMinPINSize & bMaxPINSize for Gemalto Pinpad V1
IFDHControl(): reuse ccid_descriptor variable when available
FEATURE_MCT_READER_DIRECT is also supported by the Kobil mIDentity visual
Fix Studio CC warning "ifdhandler.c", line 1275: warning: initializer does not fit or is out of range: 248
Fix Sun Studio CC warnings "ifdhandler.c", line 910: warning: initializer does not fit or is out of range: 250 "ifdhandler.c", line 910: warning: initializer does not fit or is out of range: 255 "ifdhandler.c", line 910: warning: initializer does not fit or is out of range: 129 "ifdhandler.c", line 911: warning: initializer does not fit or is out of range: 128 "ifdhandler.c", line 911: warning: initializer does not fit or is out of range: 193 "ifdhandler.c", line 911: warning: initializer does not fit or is out of range: 192 "ifdhandler.c", line 912: warning: initializer does not fit or is out of range: 144 "ifdhandler.c", line 912: warning: initializer does not fit or is out of range: 177
add support of FEATURE_GET_TLV_PROPERTIES
remove spaces and tabs at end of line
ifdhandler.c: In function ‘IFDHSetCapabilities’: ifdhandler.c:553: warning: unused parameter ‘Length’ ifdhandler.c:553: warning: unused parameter ‘Value’ ifdhandler.c: In function ‘IFDHTransmitToICC’: ifdhandler.c:1171: warning: unused parameter ‘RecvPci’
rename FEATURE_MCT_READERDIRECT in FEATURE_MCT_READER_DIRECT
FDHPowerICC(): use the exact length for the PowerOn output buffer
FDHGetCapabilities(): add support of SCARD_ATTR_ICC_PRESENCE Required to support the Windows middleware that's used for French Healthcar cards. Thanks to David Markowitz for the patch.
FDHGetCapabilities(): add support of SCARD_ATTR_ICC_INTERFACE_STATUS Required to support the Windows middleware that's used for French Healthcar cards. Thanks to David Markowitz for the patch.
IFDHControl(): do not check if FEATURE_IFD_PIN_PROPERTIES is defined since we now require pcsc-lite >= 1.5.6 (with FEATURE_IFD_PIN_PROPERTIES defined)
IFDHGetCapabilities() & IFDHControl(): return IFD_ERROR_INSUFFICIENT_BUFFER when appropriate
revert change in revision 4414. It is a bug in the reader not the driver
IFDHSetProtocolParameters(): with a T=1 card, do not try to negociate IFSD if the reader works in APDU mode
IFDHControl(): typo in comment
IFDHControl(): PIN_PROPERTIES_STRUCTURE structure do not have the wLcdMaxCharacters and wLcdMaxLines fields anymore. Conform with Revision 2.02.06, April 2009 of PCSCv2 part 10. Modified in pcsc-lite > 1.5.5 (revision 4378, 2009-09-08)
IFDHPowerICC(): remove a useless ;
IFDHControl(): return IFD_ERROR_NOT_SUPPORTED instead of IFD_COMMUNICATION_ERROR if the dwControlCode value is not supported
IFDHControl(): the (proprietary) switch interface escape command is allowed on the Gemalto GemProx DU
IFDHControl(): the (proprietary) get firmware version escape command is allowed with a Gemalto reader
change InterruptRead() to add a timeout parameter. We need a short timeout in ccid_open_hack_pre()
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
IFDHControl(): add support of FEATURE_MCT_READERDIRECT Only the Kobil TriB@nk reader supports this feature for now. This is used for the Secoder functionality in connected mode.
IFDHControl(): use the correct return size for IOCTL_FEATURE_IFD_PIN_PROPERTIES
IFDHCreateChannelByname() & IFDHCreateChannel(): do not call ccid_open_hack_post() if the 3 IFDHICCPresence() failed and we closed the reader
split ccid_open_hack() in ccid_open_hack_pre() and ccid_open_hack_post() before and after the empirical "warm up" sequence The problem is the USB toggle bit. I could not find a simple way to reset it. So when the driver is started again the reader and the host may not be in sync. The few first CCID commands may fail.
IFDHCreateChannel(): use the same empirical hack as in IFDHCreateChannelByName() to recover the reader after pcscd is restarted. The problem is that USB frames have a toggle bit
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
IFDHSetProtocolParameters(): rename atr in openpgp_atr ifdhandler.c:822: warning: declaration of ‘atr’ shadows a previous local ifdhandler.c:527: warning: shadowed declaration is here
IFDHSetProtocolParameters(): add a hack to support the bogus OpenGPG card. The card declares a BWI=4 (1.4s) but, sometimes, do not send a WTX (time request) in time and the on board key generation then fails. The patch uses BWI=7 (11s) Thanks to Jan Suhr for helping tracking the bug
typo in comment
IFDHSetProtocolParameters(): correct parameter Protocol documentation Thanks to Joachim Breitner for the bug report
rename t1_negociate_ifsd() in t1_negotiate_ifsd() to be in sync with OpenCT
ICCD devices do not use usb_interrupt_read() but sleep(). So there is no problem killing the polling thread and sleep for 10 minutes instead of just 5 seconds
disable support of the contcatless part of SDI010 and SCR331DI
explicitly cast result in void when not used (reported by the splint tool)
IFDHSetProtocolParameters(): convert protocol from ATR_PROTOCOL_TYPE_T? to SCARD_PROTOCOL_T? in case of O2MICRO_OZ776_PATCH Thanks to Jim Dawson for the bug report
defs.h: add readerName field ifdhandler.c: also log reader name instead of just Lun
IFDHCreateChannelByName(): call ClosePort() to release resources if the 3 IFDHICCPresence() fails
IFDHPowerICC(): use a very long timeout for PowerUp since the card can be very slow to send the full ATR (up to 30 seconds at 4 MHz)
IFDHSleep(): just sleep for 5 seconds since the polling thread is NOT killable so pcscd event thread must loop to exit cleanly Once the driver (libusb in fact) will support TAG_IFD_POLLING_THREAD_KILLABLE then we could use a much longer delay and be killed before pcscd exits
IFDHPolling(): log only if DEBUG_LEVEL_PERIODIC is set
do not include the release number in the Info.plist to avoid a diff of a configuration file when upgrading the package. Thanks to Benoit Gonzalvo for the bug report
update Free Software Foundation mail address
init_driver(): use the environment variable LIBCCID_ifdLogLevel to overwrite the value of ifdLogLevel read from the Info.plist file Thanks to Alon Bar-Lev for the idea
Simulate card absence for the GemCore SIM Pro
use defined(USE_USB_INTERRUPT) instead of just USE_USB_INTERRUPT ifdhandler.c:60:66: warning: "USE_USB_INTERRUPT" is not defined
IFDHSetProtocolParameters(): store the protocol used in ccid_desc->cardProtocol even if the reader has CCID_CLASS_AUTO_PPS_PROP. Correct a potential bug in SecurePINVerify()/SecurePINModify(). Thanks to Jim Dawson for the bug report
IFDHSetProtocolParameters(): O2Micro OZ776 does not support a protocol change to T=1 for dual protocol cards https://www.opensc-project.org/opensc/ticket/172 https://bugs.launchpad.net/ubuntu/+bug/163072
use usb_interrupt_read() only if libusb > 0.1.12 or --enable-usb-interrupt is used
IFDHPolling() and IFDHPolling() are defined if TWIN_SERIAL is not defined and also if HAVE_DECL_TAG_IFD_POLLING_THREAD is set to 1
do not declare IFDHPolling() and IFDHSleep() when building for the serial reader
IFDHSleep(): add a log call
on an ICCD device the card is always inserted so no card movement will ever happen: just do nothing in the TAG_IFD_POLLING_THREAD thread
HAVE_DECL_TAG_IFD_POLLING_THREAD is always defined but is set to 0 or 1
add a prototype for IFDHPolling()
add support of TAG_IFD_POLLING_THREAD using IFDHPolling() to detect asynchronous card movements
add support for Mac OS X Leopard (10.5.1)
typo in log message
move #include of config.h before pcsclite.h and reader.h
In case of error set the received length to 0 in IFDHTransmitToICC() and IFDHControl() instead of in all the lower level commands
IFDHControl(): log the Rx and Rx buffers
warning: initialization discards qualifiers from pointer target type
set IFSC in the SetParameters argument for T=1 if TAi (i>2) is present: IFSC Thanks to Stefan Neis for the bug report and patch
IFDHICCPresence(): return the error code returned by CmdGetSlotStatus() instead of using IFD_COMMUNICATION_ERROR
IFDHGetCapabilities(): add support of SCARD_ATTR_MAXINPUT to get the maximal APDU size (dwMaxCCIDMessageLength -10)
IFDHICCPresence(): the patch in revision 2150 was not correct. SCardReconnect(..., SCARD_UNPOWER_CARD, ...) failed since the card was reported as non present after the power off
IFDHPowerICC(): log the action performed (PowerUp, PowerDown, Reset)
IFDHGetCapabilities(): add support of SCARD_ATTR_VENDOR_NAME
add support for SCARD_ATTR_VENDOR_IFD_VERSION tag used by SCardGetAttrib()
remove trailing spaces at end of lines
IFDHICCPresence(): correctly support the removal and insertion between two consecutive IFDHICCPresence() calls
IFDHCreateChannelByName(): add a "warm up" sequence. This sequence is sometimes needed when pcscd is restarted with the reader already connected. We get some "usb_bulk_read: Resource temporarily unavailable" on the first few tries. It is an empirical hack
IFDHICCPresence(): check the value returned by CmdEscape() in the SCR331-DI contactless reader familly code. Byg detected by using __attribute__((warn_unused_result)) also used as __must_check by the Linux kernel
use ntohl/htonl from arpa/inet.h since the tag value for IOCTL_FEATURE_VERIFY_PIN_DIRECT and IOCTL_FEATURE_MODIFY_PIN_DIRECT _shall_ be encoded in big endian as documented in PCSC v2 part 10 ch 2.2 page 2. The applications using this feature shall be updated (to respect the PCSC specification) Thanks to Ulrich Vogl for the bug report
use LPSTR instead of LPTSTR (deprecated)
declare the functions to export as EXTERNAL
#include "misc.h" so that ifdhandler.h functions are declared EXTERNAL
add support for SCM SDI 010 contactless reader thanks to Oleg Makarenko for the patch
IFDHSetProtocolParameters(): if the card is in specific mode and request a speed not supported by the reader we return IFD_COMMUNICATION_ERROR instead of IFD_PROTOCOL_NOT_SUPPORTED so that pcsc-lite do not try to talk to the card
IFDHSetProtocolParameters(): store the card protocol in ccid_desc->cardProtocol
IFDHSetProtocolParameters(): exit the while if you find a correct speed in the case of a card too fast
IFDHSetProtocolParameters(): if the card is faster than the reader (TA1=97 for example) we try to use a no so bad speed (corresponding to TA1=96, 95 or 94) instead of the default speed of TA1=11
allow to select the power on voltage using Info.plist instead of recompiling the source code
typo in a comment
Avoid a possible division by 0 if f or d parameter is null. This could happen only with non-ISO cards with TA1=0x00 or other undefined values
remove PCSC/ from the pcsc-lite #include header files since the PCSC/ part is already given by `pkg-config --cflags libpcsclite`
IFDHGetCapabilities(): use info instead of comm debug level to print the number of slots supported by the reader
IFDHControl(): use sizeof(PCSC_TLV_STRUCTURE) instead of 6
add support of PC/SC v2 part 10 CM_IOCTL_GET_FEATURE_REQUEST add support of FEATURE_VERIFY_PIN_DIRECT and FEATURE_MODIFY_PIN_DIRECT remove support of IOCTL_SMARTCARD_VENDOR_VERIFY_PIN (now obsoleted)
IFDHControl(): having a NULL RxBuffer is not an error since it is enough to send the code in dwControlCode Thanks to Martin Paljak for the patch
#include <PCSC/reader.h>
do not #include <math.h> since we now use +1 instead of ceil() to round
the calculated timeouts to the upper integer
- we do not need an mathematical exact value. the {usb,serial}read must
just not timeout before the reader firmware timeouts
- we avoid a dependency/link on the math library
T0_card_timeout(): use intermediate variables EGT, BWT, CWT, etu to improve code readability
T0_card_timeout(): declare EGT, WWT as double instead of int to have some precision We also calculate EGT and WWT in milliseconds instead of seconds
IFDHCreateChannelByName(), T0_card_timeout(), T1_card_timeout(): also include other card parameters (TC1 for T=0, TC1 and CWI for T=1) in the timeout formula
IFDHICCPresence(): add support of SCR331-DI NTTCom Thanks to Takuto Matsuu fro the patch
T0_card_timeout()/T1_card_timeout(): use ceil() to round the timeout
IFDHSetProtocolParameters(): check if the baud rate is present in the baud rates list only if the list is present. Otherwise we use the old behavior.
IFDHSetProtocolParameters(): we do not check if (card_baudrate <= ccid_desc->dwMaxDataRate) since find_baud_rate() will tell us if the speed is supported or not by the reader
calculate and store the read timeout according to the card ATR instead of using a fixed value of 60 seconds
add T0_card_timeout() and T1_card_timeout()
IFDHSetProtocolParameters(): only use a data rate supported by the reader in the PPS negociation, otherwise we stay at the default speed.
extra_egt(): rewrite the function comment
extra_egt(): reuse the same baud rate calculation formula
extra_egt(): change two if() in one
change comments: TBi (i>2) is BWI/CWI not BWI/BCI
extra_egt(): some (bogus) cards require an extra EGT but the ATR does not say so. We try to detect the bogus cards and set TC1=2
light code reformating
init_driver(): use DEBUG_INFO2() instead of debug_msg()
change licence from GNU GPL to GNU LGPL
use ATR_t instead of ATR
IFDHSetProtocolParameters(): return immediately if the reader has the bit CCID_CLASS_AUTO_PPS_PROP set since he will perform PPS and SetParameters himself
IFDHSetProtocolParameters(): calculate the value of pps[2] (TA1) even if CCID_CLASS_AUTO_PPS_CUR bit is set and no PPS will be generated by the driver since this value is also used later by the SetParameters()
IFDHSetProtocolParameters(): use "card_baudrate <= ccid_desc->dwMaxDataRate" instead of "card_baudrate < ccid_desc->dwMaxDataRate" to not miss the maximum speed value
mask bStatus to get the ICC state since bSatus may also indicate an error in b6-b7
IFDHSetProtocolParameters(): return the result value of SetParameters() in case of error instead of always IFD_COMMUNICATION_ERROR. This will allow to return IFD_NOT_SUPPORTED in some cases and avoid a PTS negociation failure (and card ignored) in pcscd.
IFDHSetProtocolParameters(): the bmTCCKST bits shall be _set_ not cleared
IFDHSetProtocolParameters(): we shall indicate the T=1 checksum used (LRC/CRC) in the SetParameters() command
IFDHICCPresence(): periodic debug message indicating the card presence/absence
use a much cleaner way to check presence of a contactless card with a multislot SCR331-DI reader
IFDHICCPresence(): call get_ccid_descriptor() on reader_index instead of Lun
FDHGetCapabilities() tag TAG_IFD_SLOT_THREAD_SAFE: Can NOT talk to multiple slots at the same time (at least until it is fully validated)
IFDHCreateChannel()/IFDHCreateChannelByName(): if the OpenPort() call fails we ReleaseReaderIndex() and do not call ccid_open_hack()
remove defaultFeatures management (was used for SCR331-DI hack)
use reader_index instead of lun as reader identification allocate (in IFDHCreateChannel*) and release (in IFDHCloseChannel)
hack to support the SCR331-DI contactless interface
update IFDHControl() prototype to replace LPVOID by PUCHAR (prototype changed in pcsc-lite-1.2.9-beta5)
BUG: I forgot to initialise the t1.lun field. It failed to work with more than one readers and a T=1 card in a TPDU reader.
init_driver(): 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)
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).
explicitely cast the returned value as (void) if we don't use it
IFDHSetProtocolParameters(): test the return value of SetParameters()
mark unused arguments as /*@unused@*/ for splint
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
if DEBUG_LEVEL_PERIODIC is not set we temporaily remove DEBUG_LEVEL_COMM in IFDHICCPresence() to avoid having the low level debug every time pcscd test the card presence
- removed CardUp() and CardDown() - all the reader initialisation/negotiation is now done in IFDHSetProtocolParameters() (that's why you need pcsc-lite-1.2.9beta3)
add support for SCardGetAttrib(.., IOCTL_SMARTCARD_VENDOR_VERIFY_PIN, ..) to know if the reader supports SCardControl(.., IOCTL_SMARTCARD_VENDOR_VERIFY_PIN, ..)
recompile using gcc -pedantic and correct: - some C++ syntax comments - many signedness "problems"
add support for Secure PIN through SCardControl() (see sample code in examples/)
in CardUp():SetParameters() the default TA1 is 0x11
- add support of IOCTL_SMARTCARD_VENDOR_IFD_EXCHANGE in IFDHControl() - read ifdDriverOptions from Info.plist to limit the use of IOCTL_SMARTCARD_VENDOR_IFD_EXCHANGE (idea from Peter Williams)
in IFDHPowerICC() IFD_POWER_DOWN is just power down without a power up. Changed to be compliant with IFD Handler specifications.
reset ATR string (length = 0) when the card is powered down or not present
add SCARD_ATTR_ATR_STRING in addition to TAG_IFD_ATR in IFDHGetCapabilities()
new IFDHControl() API
during the first IFDHCreateChannel*() init_debug() is called to read the value of ifdLogLevel from the Info.plist
do not return before pthread_mutex_unlock() in IFDHCreateChannelByName()
also call ccid_open_hack() in IFDHCreateChannelByName()
T=1 context is initialized in CardUp(), not in IFDHCreateChannel()
revert to nearly previous version. - IFD_POWER_DOWN is power down and power up (cold reset) - IFD_RESET is power up (warm reset) - IFD_POWER_UP is power up
Reset action is power off and power on, not just power on
huge rework of CardUp()
Perform PPS and IFSD only if the reader does not do it automatically
use Protocol_T1_Negociate_IFSD() in CardUp()
add CardUp() and CardDown() for PowerOn and PowerOff actions
removed useless function name in debug messages since we use __FUNCTION__
add support of IFDHCreateChannelByName
add support of T=1 in TPDU mode
call ccid_open_hack() in IFDHCreateChannel() instead of in each OpenPort()
use an (int *) instead of a PDWORD for rx_length argument
add get_ccid_slot() function
remove function name from debug message since __FUNCTION__ is now used in DEBUG_* macro definition
return IFD_NOT_SUPPORTED instead of IFD_SUCCESS in functions doing nothing (yet) (IFDHSetCapabilities, IFDHSetProtocolParameters, IFDHControl);
set the result buffer length to 0 in IFDHControl()
use a updated version of acx_pthread.m4 needed for FreeBSD
add support of thread safe (APDU multiplexing on different readers)
use OpenPort instead of OpenUSB. move the complex TPDU management in commands.c (and use it only if reader does not support APDU mode)
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 |