Hello community, here is the log from the commit of package pcsc-ccid for openSUSE:Factory checked in at 2013-08-23 11:06:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pcsc-ccid (Old) and /work/SRC/openSUSE:Factory/.pcsc-ccid.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pcsc-ccid" Changes: -------- --- /work/SRC/openSUSE:Factory/pcsc-ccid/pcsc-ccid.changes 2013-06-13 17:29:48.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.pcsc-ccid.new/pcsc-ccid.changes 2013-08-23 11:06:10.000000000 +0200 @@ -1,0 +2,18 @@ +Tue Aug 13 18:16:31 UTC 2013 - [email protected] + +- Updated to version 1.4.12 + * Add support of + HID OMNIKEY 5127 CK + HID OMNIKEY 5326 DFR + HID OMNIKEY 5427 CK + Ingenico WITEO USB Smart Card Reader (Base and Badge) + SecuTech SecuTech Token + * Add support of card movement notifications for multi-slot readers + * Check libusb is at least at version 1.0.8 + * Get the serialconfdir value from pcsc-lite pkg config instead of + using $(DESTDIR)/$(sysconfdir)/reader.conf.d/ if not specified + (pcsc-lite does not provide that information yet so the value + is set manually + * some minor bugs removed + +------------------------------------------------------------------- Old: ---- ccid-1.4.11.tar.bz2 ccid-1.4.11.tar.bz2.asc New: ---- ccid-1.4.12.tar.bz2 ccid-1.4.12.tar.bz2.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pcsc-ccid.spec ++++++ --- /var/tmp/diff_new_pack.926w9P/_old 2013-08-23 11:06:11.000000000 +0200 +++ /var/tmp/diff_new_pack.926w9P/_new 2013-08-23 11:06:11.000000000 +0200 @@ -32,7 +32,7 @@ %if %suse_version > 1220 BuildRequires: gpg-offline %endif -Version: 1.4.11 +Version: 1.4.12 Release: 0 Url: http://pcsclite.alioth.debian.org/ccid.html Summary: PCSC Driver for CCID Based Smart Card Readers and GemPC Twin Serial Reader @@ -79,7 +79,8 @@ # not needed ATM #./bootstrap %configure\ - --enable-twinserial + --enable-twinserial \ + --enable-serialconfdir=%{_sysconfdir}/reader.conf.d/ make %{?jobs:-j%jobs} %install ++++++ ccid-1.4.11.tar.bz2 -> ccid-1.4.12.tar.bz2 ++++++ ++++ 2030 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ccid-1.4.11/ChangeLog new/ccid-1.4.12/ChangeLog --- old/ccid-1.4.11/ChangeLog 2013-05-11 14:06:01.000000000 +0200 +++ new/ccid-1.4.12/ChangeLog 2013-08-12 23:46:05.000000000 +0200 @@ -1,3 +1,413 @@ +2013-08-12 Ludovic Rousseau + + * [r6729] README, configure.ac: Release 1.4.12 + * [r6728] readers/SecuTech_Token.txt, + readers/supported_readers.txt: Add SecuTech SecuTech Token + +2013-08-08 Ludovic Rousseau + + * [r6720] readers/HID_OMNIKEY_5427_CK.txt, + readers/supported_readers.txt: Add HID OMNIKEY 5427 CK + +2013-08-05 Ludovic Rousseau + + * [r6715] readers/Ingenico_WITEO_badge.txt, + readers/Ingenico_WITEO_base.txt, readers/supported_readers.txt: + Add Ingenico WITEO USB Smart Card Reader (Base and Badge) + * [r6714] readers/supported_readers.txt: Regenerate without the + duplicates as entries + +2013-08-02 Ludovic Rousseau + + * [r6705] readers/Lenovo2.txt, readers/supported_readers.txt: Add + Lenovo Lenovo USB Smartcard Keyboard + +2013-07-28 Ludovic Rousseau + + * [r6689] readers/HID_OMNIKEY_5326_DFR.txt, + readers/supported_readers.txt: Add HID OMNIKEY 5326 DFR + +2013-07-06 Ludovic Rousseau + + * [r6688] readers/ACR122U_PICC.txt: Firmware upgrade + * [r6686] readers/Omnikey_5127_CK.txt, + readers/supported_readers.txt: Add HID OMNIKEY 5127 CK + +2013-07-05 Ludovic Rousseau + + * [r6685] src/ifdhandler.c: CreateChannelByNameOrChannel(): + correctly fails if the reader disapears + + If we get the error IFD_NO_SUCH_DEVICE then we must exit using + the error path and not directly with a return. We need to unlock + a mutex and free allocated resources. + + Thanks to coverity. + * [r6684] src/towitoko/atr.c: ATR_InitFromArray(): avoid a possible + buffer overflow + + Increment the protocol index _before_ checking it is too big. + +2013-07-01 Ludovic Rousseau + + * [r6682] src/ccid_usb.c: Code factorisation + * [r6681] src/ccid_usb.c: CloseUSB(): free + arrayOfSupportedDataRates on the last slot close + + Do free .ccid.arrayOfSupportedDataRates array only when the last + slot is closed. + + Multi-slot readers share the same .ccid.arrayOfSupportedDataRates + array. + + The GEMCOREPOSPRO and GEMCORESIMPRO are an exception and are not + correctly managed by this patch (memory may leak). + +2013-06-30 Ludovic Rousseau + + * [r6678] src/ccid_usb.c, src/ifdhandler.c: Add support of + multi-slot readers + + Thanks to Johann Dantant for the initial patch + * [r6677] src/ccid_usb.c: ReadUSB(): check libusb return value for + LIBUSB_ERROR_NO_DEVICE + + Same change as in revision 6676 but for ReadUSB(). + * [r6676] src/ccid_usb.c: WriteUSB(): check return value for + LIBUSB_ERROR_NO_DEVICE + + If the device is removed we check for ENODEV == errno and now + also for LIBUSB_ERROR_NO_DEVICE == rv (libusb_bulk_transfer() + return value) + + Only the value returned by libusb_bulk_transfer() should be used + in the futur. + +2013-06-28 Ludovic Rousseau + + * [r6675] src/ccid_usb.c: close_libusb_if_needed(): Reset ctx value + to NULL + + Make sure libusb_init() will be called for the next reader. + + This was not a real problem since pcscd will unload the driver + when no more reader is using it. + * [r6674] src/ccid_usb.c: Call libusb_exit() when needed + + Starting with libusbx 1.0.16 a hotplug thread is created by + libusb. We must cleanly stop the thread or bad thing can happen + (crash on Mac OS X for exampple) + * [r6673] configure.ac: Check libusb is at least at version 1.0.8 + + The driver will need to use libusb_exit() for libusbx >= 1.0.16 + because of the libusb hotplug thread. + + libusb_exit() was not working correctly in libusb < 1.0.8. + + So we check the libusb library used will at least provide a + working libusb_exit() function. + * [r6672] configure.ac: Remove libusb-config use + + libusb-config was provided by libusb-0.1. We do not use this + version of the libusb API since version libccid 1.4.0 (August + 2010) + +2013-06-20 Ludovic Rousseau + + * [r6667] MacOSX/configure: Update the bundle name template to + include the vendor name + + The bundle name template is now ifd-ccid-vendor-reader.bundle + * [r6666] MacOSX/configure: Disable class driver on Mac OS X + + - we are building for a specific reader - pcsc-lite on Mac OS X + do not yet support "class" driver + +2013-06-18 Ludovic Rousseau + + * [r6664] configure.ac, src/Makefile.am: Use serialconfdir from + pcsc-lite + + Get the serialconfdir value from pcsc-lite pkg config instead of + using $(DESTDIR)/$(sysconfdir)/reader.conf.d/ + +2013-06-12 Ludovic Rousseau + + * [r6661] ylwrap: Update from automake 1.13 + * [r6659] README, configure.ac: Release 1.4.11 + +2013-06-11 Ludovic Rousseau + + * [r6658] readers/supported_readers.txt: Move Gemalto IDBridge + K3000 from "should work" to "supported" + +2013-06-10 Ludovic Rousseau + + * [r6656] readers/supported_readers.txt: Move Gemalto IDBridge CT30 + from "unsupported" to "should work" list + * [r6655] readers/supported_readers.txt: Add Gemalto IDBridge K30 + * [r6652] readers/Gemalto_IDBridge_K30.txt: New firmware and new + name of the Gemalto USB Shell Token V2 + * [r6651] readers/DellSCRK.txt: New firmware (2.0) + * [r6650] src/ccid.c, src/ccid.h, src/ccid_serial.c, + src/ccid_usb.c: Add Zero Length Packet (ZLP) support for Gemalto + IDBridge CT30 and K30 + + The Gemalto IDBridge CT30 and IDBridge K30 readers may send a ZLP + after some commands when connected on a USB3 bus. Only the + readers with firmware 2.00 have the problem. + + The solution is to use a short read before every USB write. + +2013-06-03 Ludovic Rousseau + + * [r6646] src/debug.c: Reset color after time value + + Fix a bug introduced in revision 6644. + * [r6645] src/debug.c: Do not do colorization when not available. + + Check code was missing in revision 6644. + * [r6644] src/debug.c: Add colorization of logs + + This log API is used when pcsc-lite do not provide it i.e. on Mac + OS X. + + The colorization should happen only when the logs are displayed + on a terminal and not when sent in a log file. The main use is + with the handler_test application. + +2013-05-31 Ludovic Rousseau + + * [r6643] src/ccid_usb.c: get_ccid_device_descriptor(): check + endpoint[] before access + + Some non-CCID devices with bInterfaceClass = 0xFF may make the + code crash because they do not have endpoints. + + This may happens using 'parse -p' to parse non CCID devices. + * [r6641] readers/ACR122U.txt, readers/ACR122U_PICC.txt, + readers/ACR38U-CCID.txt, readers/ACS_ACR100.txt, + readers/ACS_ACR101.txt, readers/ACS_ACR38_plugin.txt, + readers/ACS_AET65.txt, readers/ACS_APG8201.txt, + readers/ACS_APG8201_v2.txt, readers/ACS_CryptoMate64.txt, + readers/ASEDrive_IIIe_KB.txt, readers/ASE_IIIe.txt, + readers/ATMEL_AT90SCR050.txt, readers/ATMEL_AT90SCR100.txt, + readers/ATMEL_AT91SC192192CT-USB.txt, readers/ATMEL_AT91SO.txt, + readers/ATMEL_AT98SC032CT.txt, readers/ATMEL_VaultIC420.txt, + readers/ATMEL_VaultIC440.txt, readers/ATMEL_VaultIC460.txt, + readers/AU9520.txt, readers/AU9540.txt, readers/ActivCardV2.txt, + readers/ActivCardV3.txt, readers/ActivkeySim.txt, + readers/Akasa_AK-CR-03.txt, readers/Aktiv_Rutoken_ECP.txt, + readers/Aktiv_Rutoken_Lite.txt, + readers/Aktiv_Rutoken_Magistra.txt, + readers/Aladdin_eToken_PRO_USB_72K_Java.txt, + readers/AlcorMicro_AU9522.txt, readers/Alcor_SCR001.txt, + readers/Alya.txt, readers/Ask_CPL108.txt, + readers/Athena_IDProtect_Key.txt, + readers/Avtor_SC_Reader_371.txt, readers/Avtor_SecureToken.txt, + readers/AxaltoV3.txt, readers/BIFIT_USB-Token_iBank2key.txt, + readers/BIFIT_iBank2key.txt, readers/BZH_uKeyCI800-K1.txt, + readers/BludriveII.txt, readers/Broadcom_5880.txt, + readers/Broadcom_5880v2.txt, readers/Broadcom_5880v3.txt, + readers/Broadcom_5880v4.txt, readers/C3PO_KBR36.txt, + readers/C3PO_LTC32_USBv2.txt, readers/C3PO_TLTC2USB.txt, + readers/CCB_eSafeLD.txt, readers/CardMan1021.txt, + readers/CardMan3021.txt, readers/CardMan3121.txt, + readers/CardMan3621.txt, readers/CardMan3821.txt, + readers/CardMan4321.txt, readers/CardMan5121.txt, + readers/CardMan5125.txt, readers/CardMan5321.txt, + readers/CardMan6121.txt, readers/Charismathics.txt, + readers/CherryST1044U.txt, readers/CherrySmartBoardXX1X.txt, + readers/CherrySmartTerminalST2XXX.txt, + readers/CherrySmartTerminalXX1X.txt, + readers/CherrySmartTerminalXX7X.txt, readers/CherryXX33.txt, + readers/CherryXX44.txt, readers/Covadis_Auriga.txt, + readers/CryptoIdentity.txt, readers/Dectel_CI692.txt, + readers/DellSCRK.txt, readers/DellSK-3106.txt, + readers/Eutron_CryptoIdentity.txt, + readers/Eutron_Digipass_860.txt, + readers/Eutron_SIM_Pocket_Combo_(Card_Reader).txt, + readers/Eutron_SIM_Pocket_Combo_(SIM_Reader).txt, + readers/Eutron_Smart_Pocket.txt, readers/Feitian_SCR301.txt, + readers/Feitian_SCR310.txt, readers/Feitian_ePass2003_PKI.txt, + readers/Fsij_gnuk.txt, + readers/FujitsuSiemens_SmartCard_Keyboard_USB_2A.txt, + readers/FujitsuSiemens_SmartCard_USB_2A.txt, + readers/FujitsuTechnologySolutions_SmartCase_KB_SCR_eSIG.txt, + readers/GIS_SmartMouse.txt, readers/GPFCryptoStick.txt, + readers/GemCorePOSPro.txt, readers/GemCoreSIMPro.txt, + readers/GemPC433_SL.txt, readers/GemPCKey.txt, + readers/GemPCPinpad.txt, readers/GemPCPinpadv2.txt, + readers/GemPCTwin.txt, readers/GemPC_Express.txt, + readers/GemProxDU.txt, readers/GemProxSU.txt, + readers/Gem_e-SealPro.txt, + readers/GemaltoSmartEnterpriseGuardian.txt, + readers/Gemalto_Ezio_Branch.txt, readers/Gemalto_Ezio_CB+.txt, + readers/Gemalto_Ezio_Shield.txt, + readers/Gemalto_Ezio_Shield_PinPad.txt, + readers/Gemalto_HybridSmartcardReader.txt, + readers/Gemalto_IDBridge_CT30.txt, + readers/Gemalto_IDBridge_K3000.txt, readers/Gemalto_PDT.txt, + readers/Gemalto_SA_dotNet_Dual.txt, readers/Gemalto_SG.txt, + readers/GnD_StarSignCardToken350.txt, + readers/GnD_StarSignCardToken550.txt, + readers/GnD_StarSign_CUT.txt, readers/GoldKey_PIV_Token.txt, + readers/HPUSBSmartCardKeyboard.txt, + readers/HPUSBSmartCardReader.txt, + readers/HP_MFP_SmartCardReader.txt, readers/HP_kus-0133.txt, + readers/Identive_CLOUD_2700_F.txt, + readers/Identive_CLOUD_2700_R.txt, + readers/Identive_CLOUD_4500_F.txt, + readers/Identive_CLOUD_4510_F.txt, + readers/Identive_CLOUD_4700_F.txt, + readers/Identive_CLOUD_4710_F.txt, + readers/Inside_Secure_AT90SCR050.txt, + readers/Inside_Secure_AT90SCR100.txt, + readers/Inside_Secure_AT90SCR200.txt, + readers/Inside_Secure_VaultIC_420.txt, + readers/Inside_Secure_VaultIC_440.txt, + readers/Inside_Secure_VaultIC_460_Smart_Object.txt, + readers/JCOP41V221.txt, readers/KAAN_Advanced.txt, + readers/KAAN_Base.txt, readers/KAAN_SIM_III.txt, + readers/KEBTechnology_KONA_USB_SmartCard.txt, + readers/Kingtrust_Multi-Reader.txt, readers/Kobil_EMV_CAP.txt, + readers/Kobil_IDToken.txt, readers/Kobil_Smart_Token.txt, + readers/Kobil_mIDentity_4smart.txt, + readers/Kobil_mIDentity_4smart_AES.txt, + readers/Kobil_mIDentity_fullsize.txt, + readers/Kobil_mIDentity_fullsize_AES.txt, + readers/Kobil_mIDentity_visual.txt, readers/LTC31.txt, + readers/LTC31v2.txt, readers/LTC36.txt, readers/Lenovo.txt, + readers/MSI_StarReader_SMART.txt, + readers/MX5_SMART_CCID_DRIVER.txt, + readers/Macally_NFC_CCID_eNetPad.txt, readers/Morpho_MSO1350.txt, + readers/Morpho_MSO350.txt, readers/MySmartPad.txt, + readers/NXP_PR533.txt, readers/Neowave_Weneo.txt, + readers/Neowave_Weneo2.txt, readers/Neowave_Weneo3.txt, + readers/Neowave_Weneo4.txt, readers/Oberthur-CosmoCard.txt, + readers/Oberthur-CosmoCard1.txt, + readers/Oberthur-ID-ONE_token_slim_v2.txt, + readers/Omnikey_6321.txt, readers/Omnikey_noname1.txt, + readers/Oz776S.txt, readers/Oz776_7772.txt, + readers/Panasonic_USB_Smart_Card_Reader_7A-Smart.txt, + readers/Philips_SmartMX.txt, readers/Precise_200_MC.txt, + readers/Precise_250_MC.txt, readers/Precise_Sense_MC.txt, + readers/Raritan_D2CIM-DVUSB.txt, readers/ReinerSCT.txt, + readers/ReinerSCT_cyberJack_RFID_basis.txt, + readers/ReinerSCT_cyberJack_go.txt, + readers/Rutoken_PINPad_ex.txt, readers/Rutoken_PINPad_in.txt, + readers/SCL010.txt, readers/SCL01x.txt, readers/SCM_SCL010.txt, + readers/SCM_SCL011.txt, readers/SCM_SDI011.txt, + readers/SCM_SDI011_512C.txt, readers/SCR331-DI-NTTCom.txt, + readers/SCR331-DI.txt, readers/SCR331.txt, + readers/SCR3310-NTTCom.txt, readers/SCR3310.txt, + readers/SCR3310_2.txt, readers/SCR3311.txt, readers/SCR3320.txt, + readers/SCR333.txt, readers/SCR3340.txt, readers/SCR335.txt, + readers/SCR3500.txt, readers/SCR355.txt, readers/SDI010.txt, + readers/SDS4ID_DominoKeyPro_100.txt, readers/SPR532.txt, + readers/SafeTech_SafeTouch.txt, readers/Sitecom_MD-010.txt, + readers/Smart_SBV280.txt, readers/Softforum_XecureHSM.txt, + readers/SpringCard_CSB6_Basic.txt, + readers/SpringCard_CSB6_Secure.txt, + readers/SpringCard_CSB6_Ultimate.txt, + readers/SpringCard_CrazyWriter.txt, + readers/SpringCard_EasyFinger_Standard.txt, + readers/SpringCard_EasyFinger_Ultimate.txt, + readers/SpringCard_H512_Series.txt, + readers/SpringCard_H663_Series.txt, + readers/SpringCard_NFC_Roll.txt, + readers/SpringCard_Prox_N_Roll.txt, readers/Synnix_STD200.txt, + readers/Teo.txt, readers/Teridian_TSC12xxFV.09.txt, + readers/TianYu_CCID_SmartKey.txt, + readers/Tianyu_Smart_Card_Reader.txt, + readers/Todos_AGM2_CCID.txt, readers/Todos_Cx00.txt, + readers/Ubisys_RFID.txt, readers/VMware_Virtual_USB_CCID.txt, + readers/Validy_TokenA.txt, + readers/Vasco_DIGIPASS_KEY_202_0120.txt, + readers/Vasco_DIGIPASS_KEY_202_0122.txt, readers/Vasco_DP200.txt, + readers/Vasco_DP855.txt, readers/Vasco_DP860.txt, + readers/Vasco_DP865.txt, readers/Vasco_DP905.txt, + readers/Vasco_DPKey101.txt, readers/Vasco_DPKey200.txt, + readers/Vasco_DPKey860.txt, readers/Vasco_Digipass920.txt, + readers/Vega-Alpha.txt, + readers/Verisign_secure_storage_token.txt, + readers/Verisign_secure_token.txt, readers/Winbond.txt, + readers/Xiring_Leov2.txt, readers/Xiring_MyLeo.txt, + readers/Xiring_XI-SIGN.txt, readers/Xiring_XI-SIGN_6000.txt, + readers/Yubico_Yubikey_neo.txt, + readers/Yubico_Yubikey_neo_otp.txt, readers/bit4id_cryptokey.txt, + readers/bit4id_iam.txt, readers/bit4id_key4.txt, + readers/bit4id_minilector-s.txt, readers/bit4id_minilector.txt, + readers/e-gate.txt, readers/iDream.txt, readers/iMONO.txt, + readers/id3_CL1356A_HID.txt, readers/id3_CL1356T.txt, + readers/id3_CL1356T5.txt, readers/jNet_jToken_s1.txt, + readers/mIDentity.txt, readers/mIDentityXL.txt, + readers/sid800.txt: Fix typo + + bClassEnveloppe: -> bClassEnvelope: only one 'p' + +2013-05-30 Ludovic Rousseau + + * [r6640] src/ccid_usb.c: Fix typo in comment + +2013-05-24 Ludovic Rousseau + + * [r6635] src/ccid_usb.c: CloseUSB(): free the + gemalto_firmware_features only on the last slot + + All the slots of a same reader use the same + gemalto_firmware_features structure. We should only free the + structure when the last slot is closing. + * [r6634] src/ccid_usb.c: Replace doubles spaces by tabulations + +2013-05-22 Ludovic Rousseau + + * [r6633] src/parse.c: Fix typo in field name + + bClassEnveloppe -> bClassEnvelope (only 1 'p') + +2013-05-17 Ludovic Rousseau + + * [r6632] readers/SCM_SDI011_512C.txt, + readers/supported_readers.txt: Add SCM Microsystems Inc. SDI011 + Contactless Reader + + This SDI011 has a new idProduct: 0x512C + +2013-05-16 Ludovic Rousseau + + * [r6631] src/ccid_usb.c: ReadUSB: Zero Length Packet (ZLP) support + + The Gemalto IDBridge CT30 and IDBridge K30 readers may send a ZLP + after some commands when connected on a USB3 bus + +2013-05-15 Ludovic Rousseau + + * [r6630] src/parse.c: Do not exit if a device with class 0xFF is + not accessible + + Maybe the device is NOT a CCID reader and the parsing should + continue. + + Thanks to Jaidev Bhattacharjee for the bug report + +2013-05-13 Ludovic Rousseau + + * [r6627] src/parse.c: parse: make the use of -p argument more + explicit + + The error message now displays: "use ./parse -p" (or whatever the + program name is) + +2013-05-11 Ludovic Rousseau + + * [r6626] readers/SCM_SCL010.txt, readers/supported_readers.txt, + src/ccid_usb.c: Add SCM Microsystems Inc. SCL010 Contactless + Reader + + A new firmware version 1.12 seems to make the reader usable as a + CCID readers in contacless mode. + 2013-05-08 Ludovic Rousseau * [r6624] src/ifdhandler.c: CreateChannelByNameOrChannel(): fix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ccid-1.4.11/README new/ccid-1.4.12/README --- old/ccid-1.4.11/README 2013-06-12 13:56:24.000000000 +0200 +++ new/ccid-1.4.12/README 2013-08-12 23:44:09.000000000 +0200 @@ -118,6 +118,22 @@ History: ======== +1.4.12 - 12 August 2013, Ludovic Rousseau + - Add support of + . HID OMNIKEY 5127 CK + . HID OMNIKEY 5326 DFR + . HID OMNIKEY 5427 CK + . Ingenico WITEO USB Smart Card Reader (Base and Badge) + . SecuTech SecuTech Token + - Add support of card movement notifications for multi-slot readers + - Check libusb is at least at version 1.0.8 + - Get the serialconfdir value from pcsc-lite pkg config instead of + using $(DESTDIR)/$(sysconfdir)/reader.conf.d/ + - Disable class driver on Mac OS X + - Update the bundle name template to include the vendor name + - some minor bugs removed + + 1.4.11 - 12 June 2013, Ludovic Rousseau - Add support of . Gemalto IDBridge CT30 @@ -817,6 +833,6 @@ - First public release -$Id: README 6659 2013-06-12 11:55:52Z rousseau $ +$Id: README 6729 2013-08-12 21:43:09Z rousseau $ vim:ts=20 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ccid-1.4.11/configure.ac new/ccid-1.4.12/configure.ac --- old/ccid-1.4.11/configure.ac 2013-06-12 13:56:24.000000000 +0200 +++ new/ccid-1.4.12/configure.ac 2013-08-12 23:44:09.000000000 +0200 @@ -1,12 +1,12 @@ # Process this file with autoconf to produce a configure script. # You may need to use autoconf 2.56 or newer -# $Id: configure.ac 6659 2013-06-12 11:55:52Z rousseau $ +# $Id: configure.ac 6729 2013-08-12 21:43:09Z rousseau $ # Require autoconf 2.61 AC_PREREQ([2.69]) -AC_INIT([ccid],[1.4.11]) +AC_INIT([ccid],[1.4.12]) AC_CONFIG_SRCDIR(src/ifdhandler.c) AC_CONFIG_AUX_DIR([.]) AM_INIT_AUTOMAKE(1.8 dist-bzip2 no-dist-gzip) @@ -101,18 +101,12 @@ [ use_libusb="${enableval}" ], [ use_libusb=yes ] ) # check if libusb is used +LIBUSB_NEEDED_VERSION="1.0.8" if test "x$use_libusb" != xno ; then PKG_CHECK_EXISTS([libusb-1.0], [ - PKG_CHECK_MODULES(LIBUSB, libusb-1.0, [], + PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= $LIBUSB_NEEDED_VERSION, [], [ - AC_CHECK_PROG([LIBUSBCONFIG], [libusb-config], [yes]) - - if test "$LIBUSBCONFIG" = "yes" ; then - LIBUSB_CFLAGS="$LIBUSB_CFLAGS `libusb-config --cflags`" - LIBUSB_LIBS="$LIBUSB_LIBS `libusb-config --libs`" - else - AC_MSG_WARN([libusb-config not found.]) - fi + AC_MSG_WARN([install libusb $LIBUSB_NEEDED_VERSION or later]) ]) ]) @@ -211,6 +205,15 @@ ccidtwindir=$usbdropdir/serial fi +# --enable-serialconfdir=DIR +AC_ARG_ENABLE(serialconfdir, + AS_HELP_STRING([--enable-serialconfdir=dir],[directory containing + serial drivers (default to pcscd config)]), + [serialconfdir="${enableval}"], [serialconfdir=false]) +if test "${serialconfdir}" = false ; then + serialconfdir=`$PKG_CONFIG libpcsclite --variable=serialconfdir` +fi + # --disable-pcsclite AC_ARG_ENABLE(pcsclite, AS_HELP_STRING([--disable-pcsclite],[do not use pcsc-lite debug support]), @@ -256,6 +259,7 @@ AC_SUBST(bundle) AC_SUBST(usbdropdir) AC_SUBST(ccidtwindir) +AC_SUBST(serialconfdir) AS_AC_EXPAND(bindir_exp,$bindir) AS_AC_EXPAND(sysconfdir_exp,$sysconfdir) @@ -294,6 +298,7 @@ USB drop directory: ${usbdropdir} serial Twin support: ${twinserial} serial twin install dir: ${ccidtwindir} +serial config directory: ${serialconfdir} compiled for pcsc-lite: ${pcsclite} class driver: ${class} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ccid-1.4.11/readers/supported_readers.txt new/ccid-1.4.12/readers/supported_readers.txt --- old/ccid-1.4.11/readers/supported_readers.txt 2013-06-12 13:56:24.000000000 +0200 +++ new/ccid-1.4.12/readers/supported_readers.txt 2013-08-12 23:33:38.000000000 +0200 @@ -1,6 +1,6 @@ # # List of readers supported by the CCID driver -# Generated: 2013-06-11 +# Generated: 2013-08-12 # # DO NOT EDIT BY HAND @@ -46,7 +46,6 @@ 0x073D:0x0008:Eutron CryptoIdentity CCID 0x073D:0x0B00:Eutron Digipass 860 0x073D:0x0C00:Eutron Card Reader -0x073D:0x0C00:Eutron SIM Reader 0x073D:0x0C01:Eutron Smart Pocket # Feitian @@ -62,8 +61,6 @@ 0x08E6:0x34C3:Gemalto EZIO CB+ 0x08E6:0x4433:Gemalto Gemplus USB SmartCard Reader 433-Swap 0x08E6:0x5503:Gemalto Prox Dual USB PC LinkReader -0x08E6:0x5503:Gemalto Prox Dual USB PC LinkReader -0x08E6:0x5504:Gemalto Prox SU USB PC LinkReader 0x08E6:0x5504:Gemalto Prox SU USB PC LinkReader 0x08E6:0x8000:Gemalto Smart Enterprise Guardian Secure USB Device 0x08E6:0x8141:Gemalto IDBridge K3000 @@ -74,6 +71,9 @@ # id3 Semiconductors 0x0B81:0x0200:id3 Semiconductors CL1356T +# Ingenico +0x0F14:0x003D:Ingenico WITEO USB Smart Card Reader + # KOBIL 0x0D46:0x3001:KOBIL KAAN Base 0x0D46:0x3002:KOBIL KAAN Advanced @@ -112,7 +112,6 @@ 0x0F14:0x0011:XIRING XI-SIGN USB V2 0x0F14:0x0037:XIRING MyLeo 0x0F14:0x0038:XIRING Leo v2 -0x076B:0xA022:XIRING Teo ########################## # section: shouldwork @@ -122,14 +121,9 @@ 0x072F:0x1204:ACS ACR101 ICC Reader 0x072F:0x8201:ACS APG8201 PINhandy 1 0x072F:0x8202:ACS APG8201 USB Reader -0x072F:0x90CC:ACS ACR122U -0x072F:0x90CC:ACS ACR100 -0x072F:0x90CC:ACS ACR38 plugin -0x072F:0x90CC:ACS AET65 0x072F:0x90DB:ACS CryptoMate64 # Akasa -0x058F:0x9520:Akasa AK-CR-03 # Aktiv 0x0A89:0x0025:Aktiv Rutoken lite @@ -141,7 +135,6 @@ 0x0A89:0x0060:Aktiv Co., ProgramPark Rutoken Magistra # Alcor Micro -0x058F:0x9520:Alcor Micro SCR001 0x058F:0x9522:Alcor Micro AU9522 # ASK-RFID @@ -183,8 +176,6 @@ # Broadcom Corp 0x0A5C:0x5800:Broadcom Corp 5880 0x0A5C:0x5802:Broadcom Corp 5880 -0x0A5C:0x5802:Broadcom Corp 5880 -0x0A5C:0x5802:Broadcom Corp 5880 # C3PO 0x0783:0x0007:C3PO TLTC2USB @@ -225,9 +216,6 @@ # Gemalto 0x08E6:0x2202:Gemalto Gem e-Seal Pro USB Token -0x08E6:0x3437:Gemalto IDBridge CT30 -0x08E6:0x3438:Gemalto IDBridge K30 -0x08E6:0x3478:Gemalto USB GemPCPinpad SmartCard Reader 0x08E6:0x34C2:Gemalto Ezio Shield 0x08E6:0x34C5:Gemalto Ezio Shield Branch Reader 0x08E6:0x34EC:Gemalto GemPC Express @@ -260,20 +248,18 @@ # Hewlett Packard 0x03F0:0x2924:Hewlett Packard MFP Smart Card Reader +# HID OMNIKEY +0x076B:0x5127:HID OMNIKEY 5127 CK +0x076B:0x5326:HID OMNIKEY 5326 DFR +0x076B:0x5427:HID OMNIKEY 5427 CK + # id3 Semiconductors -0x0B81:0x0200:id3 Semiconductors CL1356T5 0x0B81:0x0220:id3 Semiconductors CL1356A_HID # Identive 0x04E6:0x5710:Identive CLOUD 2700 F Smart Card Reader 0x04E6:0x5720:Identive Identive CLOUD 4500 F Dual Interface Reader -0x04E6:0x5720:Identive Identive CLOUD 4500 F Dual Interface Reader -0x04E6:0x5720:Identive Identive CLOUD 4700 F Dual Interface Reader -0x04E6:0x5720:Identive Identive CLOUD 4700 F Dual Interface Reader 0x04E6:0x5721:Identive Identive CLOUD 4510 F Contactless + SAM Reader -0x04E6:0x5721:Identive Identive CLOUD 4510 F Contactless + SAM Reader -0x04E6:0x5721:Identive Identive CLOUD 4710 F Contactless + SAM Reader -0x04E6:0x5721:Identive Identive CLOUD 4710 F Contactless + SAM Reader 0x04E6:0x5810:Identive CLOUD 2700 R Smart Card Reader # Inside Secure @@ -299,6 +285,9 @@ 0x0D46:0x4389:KOBIL Systems mIDentity fullsize 0x0D46:0x43A9:KOBIL Systems mIDentity fullsize AES +# Lenovo +0x17EF:0x6007:Lenovo Lenovo USB Smartcard Keyboard + # Macally 0x08AE:0x0BDF:Macally NFC CCID eNetPad @@ -334,7 +323,6 @@ 0x076B:0x6321:OMNIKEY 6321 CLi USB # OMNIKEY AG -0x076B:0x3021:OMNIKEY AG CardMan 3021 0x076B:0x3621:OMNIKEY AG CardMan 3621 0x076B:0x3821:OMNIKEY AG CardMan 3821 0x076B:0x5121:OMNIKEY AG CardMan 5121 @@ -374,11 +362,13 @@ 0x04E6:0x512C:SCM Microsystems Inc. SDI011 Contactless Reader 0x04E6:0x5291:SCM Microsystems Inc. SCL010 Contactless Reader 0x04E6:0x5293:SCM Microsystems Inc. SCL01x Contactless Reader -0x04E6:0x5410:SCM Microsystems Inc. SCR35xx v2.0 USB SC Reader # Secure Device Solutions 0x0B81:0x8007:Secure Device Solutions DOMINO-Key TWIN +# SecuTech +0x0403:0xC587:SecuTech SecuTech Token + # Sitecom 0x0DF6:0x800A:Sitecom Sitecom USB simcard reader MD-010 @@ -436,7 +426,6 @@ 0x0416:0x3815:Winbond CCID SmartCard Controller # XIRING -0x0F14:0x0011:XIRING XI-SIGN USB V2 # Yubico 0x1050:0x0111:Yubico Yubikey NEO OTP+CCID @@ -460,7 +449,6 @@ # Broadcom Corp 0x0A5C:0x5801:Broadcom Corp 5880 -0x0A5C:0x5801:Broadcom Corp 5880 # C3PO 0x0783:0x0003:C3PO LTC3x USB @@ -507,7 +495,6 @@ #0x0C4B:0x0300:Reiner-SCT cyberJack pinpad(a) # SCM Microsystems Inc. -#0x04E6:0x5291:SCM Microsystems Inc. SCL010 Contactless Reader #0x04E6:0x5292:SCM Microsystems Inc. SCL01x Contactless Reader # SMART @@ -579,3 +566,6 @@ #0x0F14:0x0011:XIRING XI-SIGN USB V2 (Xiring_XI-SIGN.txt) #0x0F14:0x0011:XIRING XI-SIGN USB V2 (Xiring_XI-SIGN_6000.txt) +#0x0F14:0x003D:Ingenico WITEO USB Smart Card Reader (Ingenico_WITEO_badge.txt) +#0x0F14:0x003D:Ingenico WITEO USB Smart Card Reader (Ingenico_WITEO_base.txt) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ccid-1.4.11/src/Makefile.am new/ccid-1.4.12/src/Makefile.am --- old/ccid-1.4.11/src/Makefile.am 2013-01-27 12:21:25.000000000 +0100 +++ new/ccid-1.4.12/src/Makefile.am 2013-06-29 19:51:45.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: Makefile.am 6518 2013-01-27 11:21:23Z rousseau $ +# $Id: Makefile.am 6664 2013-06-18 09:07:58Z rousseau $ CCID_BUNDLE = $(bundle) CCID_LIB = libccid.$(DYN_LIB_EXT) @@ -91,8 +91,8 @@ install_ccidtwin: libccidtwin.la $(mkinstalldirs) $(DESTDIR)$(ccidtwindir) cp .libs/$(CCIDTWIN_LIB) $(DESTDIR)$(ccidtwindir)/$(CCIDTWIN_LIB) - $(mkinstalldirs) $(DESTDIR)/$(sysconfdir)/reader.conf.d ; \ - perl -ne "s|TARGET|$(ccidtwindir)/$(CCIDTWIN_LIB)| ; print" $(srcdir)/reader.conf.in > $(DESTDIR)/$(sysconfdir)/reader.conf.d/libccidtwin + $(mkinstalldirs) $(DESTDIR)/$(serialconfdir) ; \ + perl -ne "s|TARGET|$(ccidtwindir)/$(CCIDTWIN_LIB)| ; print" $(srcdir)/reader.conf.in > $(DESTDIR)/$(serialconfdir)/libccidtwin # do not uninstall the serial driver by default # use explicitely 'make uninstall_ccidtwin' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ccid-1.4.11/src/ccid_usb.c new/ccid-1.4.12/src/ccid_usb.c --- old/ccid-1.4.11/src/ccid_usb.c 2013-06-12 13:56:24.000000000 +0200 +++ new/ccid-1.4.12/src/ccid_usb.c 2013-07-31 19:13:55.000000000 +0200 @@ -18,7 +18,7 @@ */ /* - * $Id: ccid_usb.c 6650 2013-06-10 08:43:24Z rousseau $ + * $Id: ccid_usb.c 6682 2013-07-01 08:56:09Z rousseau $ */ #define __CCID_USB__ @@ -31,6 +31,8 @@ # endif #include <libusb.h> #include <stdlib.h> +#include <pthread.h> +#include <sys/time.h> #include <ifdhandler.h> #include "config.h" @@ -62,6 +64,22 @@ /* #define ctx NULL */ libusb_context *ctx = NULL; +#define CCID_INTERRUPT_SIZE 8 + +struct usbDevice_MultiSlot_Extension +{ + int reader_index; + + /* The multi-threaded polling part */ + int terminated; + int status; + unsigned char buffer[CCID_INTERRUPT_SIZE]; + pthread_t thread_proc; + pthread_mutex_t mutex; + pthread_cond_t condition; + struct libusb_transfer *transfer; +}; + typedef struct { libusb_device_handle *dev_handle; @@ -88,11 +106,21 @@ /* libusb transfer for the polling (or NULL) */ struct libusb_transfer *polling_transfer; + /* pointer to the multislot extension (if any) */ + struct usbDevice_MultiSlot_Extension *multislot_extension; + } _usbDevice; /* The _usbDevice structure must be defined before including ccid_usb.h */ #include "ccid_usb.h" +/* Specific hooks for multislot readers */ +static int Multi_InterruptRead(int reader_index, int timeout /* in ms */); +static void Multi_InterruptStop(int reader_index); +static struct usbDevice_MultiSlot_Extension *Multi_CreateFirstSlot(int reader_index); +static struct usbDevice_MultiSlot_Extension *Multi_CreateNextSlot(int physical_reader_index); +static void Multi_PollingTerminate(struct usbDevice_MultiSlot_Extension *msExt); + static int get_end_points(struct libusb_config_descriptor *desc, _usbDevice *usbdevice, int num); int ccid_check_firmware(struct libusb_device_descriptor *desc); @@ -142,6 +170,29 @@ /* data rates supported by the secondary slots on the GemCore Pos Pro & SIM Pro */ unsigned int SerialCustomDataRates[] = { GEMPLUS_CUSTOM_DATA_RATES, 0 }; +/***************************************************************************** + * + * close_libusb_if_needed + * + ****************************************************************************/ +static void close_libusb_if_needed(void) +{ + int i, to_exit = TRUE; + + /* if at least 1 reader is still in use we do not exit libusb */ + for (i=0; i<CCID_DRIVER_MAX_READERS; i++) + { + if (usbDevice[i].dev_handle != NULL) + to_exit = FALSE; + } + + if (to_exit) + { + DEBUG_INFO("libusb_exit"); + libusb_exit(ctx); + ctx = NULL; + } +} /* close_libusb_if_needed */ /***************************************************************************** * @@ -335,9 +386,7 @@ int interface; int num = 0; const unsigned char *device_descriptor; -#if defined(USE_COMPOSITE_AS_MULTISLOT) || defined(__APPLE__) int readerID = (vendorID << 16) + productID; -#endif #ifdef USE_COMPOSITE_AS_MULTISLOT static int static_interface = 1; @@ -399,8 +448,8 @@ * and the reader is multi-slot */ usbDevice[reader_index] = usbDevice[previous_reader_index]; /* the other slots do not have the same data rates */ - if ((GEMCOREPOSPRO == usbDevice[reader_index].ccid.readerID) - || (GEMCORESIMPRO == usbDevice[reader_index].ccid.readerID)) + if ((GEMCOREPOSPRO == readerID) + || (GEMCORESIMPRO == readerID)) { usbDevice[reader_index].ccid.arrayOfSupportedDataRates = SerialCustomDataRates; usbDevice[reader_index].ccid.dwMaxDataRate = 125000; @@ -412,6 +461,10 @@ IFD_ICC_PRESENT; DEBUG_INFO2("Opening slot: %d", usbDevice[reader_index].ccid.bCurrentSlotIndex); + + /* This is a multislot reader + * Init the multislot stuff for this next slot */ + usbDevice[reader_index].multislot_extension = Multi_CreateNextSlot(previous_reader_index); goto end; } else @@ -605,6 +658,13 @@ } usbDevice[reader_index].ccid.IFD_bcdDevice = desc.bcdDevice; + + /* If this is a multislot reader, init the multislot stuff */ + if (usbDevice[reader_index].ccid.bMaxSlotIndex) + usbDevice[reader_index].multislot_extension = Multi_CreateFirstSlot(reader_index); + else + usbDevice[reader_index].multislot_extension = NULL; + goto end; } } @@ -612,8 +672,7 @@ end: if (usbDevice[reader_index].dev_handle == NULL) { - /* does not work for libusb <= 1.0.8 */ - /* libusb_exit(ctx); */ + close_libusb_if_needed(); if (claim_failed) return STATUS_COMM_ERROR; return STATUS_NO_SUCH_DEVICE; @@ -672,7 +731,7 @@ usbDevice[reader_index].bus_number, usbDevice[reader_index].device_address, rv, strerror(errno)); - if (ENODEV == errno) + if ((ENODEV == errno) || (LIBUSB_ERROR_NO_DEVICE == rv)) return STATUS_NO_SUCH_DEVICE; return STATUS_UNSUCCESSFUL; @@ -711,7 +770,7 @@ usbDevice[reader_index].bus_number, usbDevice[reader_index].device_address, rv, strerror(errno)); - if (ENODEV == errno) + if ((ENODEV == errno) || (LIBUSB_ERROR_NO_DEVICE == rv)) return STATUS_NO_SUCH_DEVICE; return STATUS_UNSUCCESSFUL; @@ -754,21 +813,34 @@ usbDevice[reader_index].bus_number, usbDevice[reader_index].device_address); - if (usbDevice[reader_index].ccid.arrayOfSupportedDataRates - && (usbDevice[reader_index].ccid.bCurrentSlotIndex == 0)) - { - free(usbDevice[reader_index].ccid.arrayOfSupportedDataRates); - usbDevice[reader_index].ccid.arrayOfSupportedDataRates = NULL; - } - /* one slot closed */ (*usbDevice[reader_index].nb_opened_slots)--; /* release the allocated ressources for the last slot only */ if (0 == *usbDevice[reader_index].nb_opened_slots) { + struct usbDevice_MultiSlot_Extension *msExt; + DEBUG_COMM("Last slot closed. Release resources"); + msExt = usbDevice[reader_index].multislot_extension; + /* If this is a multislot reader, close using the multislot stuff */ + if (msExt) + { + /* terminate the interrupt waiter thread */ + Multi_PollingTerminate(msExt); + + /* wait for the thread to actually terminate */ + pthread_join(msExt->thread_proc, NULL); + + /* release the shared objects */ + pthread_cond_destroy(&msExt->condition); + pthread_mutex_destroy(&msExt->mutex); + + /* Deallocate the extension itself */ + free(msExt); + } + if (usbDevice[reader_index].ccid.gemalto_firmware_features) free(usbDevice[reader_index].ccid.gemalto_firmware_features); @@ -782,18 +854,20 @@ if (DriverOptions & DRIVER_OPTION_RESET_ON_CLOSE) (void)libusb_reset_device(usbDevice[reader_index].dev_handle); + if (usbDevice[reader_index].ccid.arrayOfSupportedDataRates) + free(usbDevice[reader_index].ccid.arrayOfSupportedDataRates); + (void)libusb_release_interface(usbDevice[reader_index].dev_handle, usbDevice[reader_index].interface); (void)libusb_close(usbDevice[reader_index].dev_handle); - - /* does not work for libusb <= 1.0.8 */ - /* libusb_exit(ctx); */ } /* mark the resource unused */ usbDevice[reader_index].dev_handle = NULL; usbDevice[reader_index].interface = 0; + close_libusb_if_needed(); + return STATUS_SUCCESS; } /* CloseUSB */ @@ -1098,6 +1172,10 @@ struct libusb_transfer *transfer; int completed = 0; + /* Multislot reader: redirect to Multi_InterrupRead */ + if (usbDevice[reader_index].multislot_extension != NULL) + return Multi_InterruptRead(reader_index, timeout); + DEBUG_PERIODIC2("before (%d)", reader_index); transfer = libusb_alloc_transfer(0); @@ -1172,6 +1250,13 @@ { struct libusb_transfer *transfer; + /* Multislot reader: redirect to Multi_InterrupStop */ + if (usbDevice[reader_index].multislot_extension != NULL) + { + Multi_InterruptStop(reader_index); + return; + } + transfer = usbDevice[reader_index].polling_transfer; usbDevice[reader_index].polling_transfer = NULL; if (transfer) @@ -1184,3 +1269,369 @@ } } /* InterruptStop */ + +/***************************************************************************** + * + * Multi_PollingProc + * + ****************************************************************************/ +static void *Multi_PollingProc(void *p_ext) +{ + struct usbDevice_MultiSlot_Extension *msExt = p_ext; + int rv, status, actual_length; + unsigned char buffer[CCID_INTERRUPT_SIZE]; + struct libusb_transfer *transfer; + int completed; + + DEBUG_COMM3("Multi_PollingProc (%d/%d): thread starting", + usbDevice[msExt->reader_index].bus_number, + usbDevice[msExt->reader_index].device_address); + + rv = 0; + while (!msExt->terminated) + { + DEBUG_COMM3("Multi_PollingProc (%d/%d): waiting", + usbDevice[msExt->reader_index].bus_number, + usbDevice[msExt->reader_index].device_address); + + transfer = libusb_alloc_transfer(0); + if (NULL == transfer) + { + rv = LIBUSB_ERROR_NO_MEM; + DEBUG_COMM2("libusb_alloc_transfer err %d", rv); + break; + } + + libusb_fill_bulk_transfer(transfer, + usbDevice[msExt->reader_index].dev_handle, + usbDevice[msExt->reader_index].interrupt, + buffer, CCID_INTERRUPT_SIZE, + bulk_transfer_cb, &completed, 0); /* No timeout ! */ + + transfer->type = LIBUSB_TRANSFER_TYPE_INTERRUPT; + + rv = libusb_submit_transfer(transfer); + if (rv) + { + DEBUG_COMM2("libusb_submit_transfer err %d", rv); + break; + } + + usbDevice[msExt->reader_index].polling_transfer = transfer; + + completed = 0; + while (!completed && !msExt->terminated) + { + rv = libusb_handle_events(ctx); + if (rv < 0) + { + DEBUG_COMM2("libusb_handle_events err %d", rv); + + if (rv == LIBUSB_ERROR_INTERRUPTED) + continue; + + libusb_cancel_transfer(transfer); + + while (!completed && !msExt->terminated) + { + if (libusb_handle_events(ctx) < 0) + break; + } + + break; + } + } + + usbDevice[msExt->reader_index].polling_transfer = NULL; + + if (rv < 0) + libusb_free_transfer(transfer); + else + { + int b, slot; + + actual_length = transfer->actual_length; + status = transfer->status; + + libusb_free_transfer(transfer); + + switch (status) + { + case LIBUSB_TRANSFER_COMPLETED: + DEBUG_COMM3("Multi_PollingProc (%d/%d): OK", + usbDevice[msExt->reader_index].bus_number, + usbDevice[msExt->reader_index].device_address); + DEBUG_XXD("NotifySlotChange: ", buffer, actual_length); + + /* log the RDR_to_PC_NotifySlotChange data */ + slot = 0; + for (b=0; b<actual_length-1; b++) + { + int s; + + /* 4 slots per byte */ + for (s=0; s<4; s++) + { + /* 2 bits per slot */ + int slot_status = ((buffer[1+b] >> (s*2)) & 3); + const char *present, *change; + + present = (slot_status & 1) ? "present" : "absent"; + change = (slot_status & 2) ? "status changed" : "no change"; + + DEBUG_COMM3("slot %d status: %d", + s + b*4, slot_status); + DEBUG_COMM3("ICC %s, %s", present, change); + } + slot += 4; + } + break; + + case LIBUSB_TRANSFER_TIMED_OUT: + DEBUG_COMM3("Multi_PollingProc (%d/%d): Timeout", + usbDevice[msExt->reader_index].bus_number, + usbDevice[msExt->reader_index].device_address); + break; + + default: + /* if libusb_interrupt_transfer() times out + * we get EILSEQ or EAGAIN */ + DEBUG_COMM4("Multi_PollingProc (%d/%d): %d", + usbDevice[msExt->reader_index].bus_number, + usbDevice[msExt->reader_index].device_address, + status); + } + + /* Tell other slots that there's a new interrupt buffer */ + DEBUG_COMM3("Multi_PollingProc (%d/%d): Broadcast to slot(s)", + usbDevice[msExt->reader_index].bus_number, + usbDevice[msExt->reader_index].device_address); + + /* Lock the mutex */ + pthread_mutex_lock(&msExt->mutex); + + /* Set the status and the interrupt buffer */ + msExt->status = status; + memset(msExt->buffer, 0, sizeof msExt->buffer); + memcpy(msExt->buffer, buffer, actual_length); + + /* Broadcast the condition and unlock */ + pthread_cond_broadcast(&msExt->condition); + pthread_mutex_unlock(&msExt->mutex); + } + } + + msExt->terminated = TRUE; + + if (rv < 0) + { + DEBUG_CRITICAL4("Multi_PollingProc (%d/%d): error %d", + usbDevice[msExt->reader_index].bus_number, + usbDevice[msExt->reader_index].device_address, rv); + } + + /* Wake up the slot threads so they will exit as well */ + + /* Lock the mutex */ + pthread_mutex_lock(&msExt->mutex); + + /* Set the status and fill-in the interrupt buffer */ + msExt->status = 0; + memset(msExt->buffer, 0xFF, sizeof msExt->buffer); + + /* Broadcast the condition */ + pthread_cond_broadcast(&msExt->condition); + + /* Unlock */ + pthread_mutex_unlock(&msExt->mutex); + + /* Now exit */ + DEBUG_COMM3("Multi_PollingProc (%d/%d): Thread terminated", + usbDevice[msExt->reader_index].bus_number, + usbDevice[msExt->reader_index].device_address); + + pthread_exit(NULL); + return NULL; +} /* Multi_PollingProc */ + + +/***************************************************************************** + * + * Multi_PollingTerminate + * + ****************************************************************************/ +static void Multi_PollingTerminate(struct usbDevice_MultiSlot_Extension *msExt) +{ + struct libusb_transfer *transfer; + + if (msExt && !msExt->terminated) + { + msExt->terminated = TRUE; + + transfer = usbDevice[msExt->reader_index].polling_transfer; + + if (transfer) + { + int ret; + + ret = libusb_cancel_transfer(transfer); + if (ret < 0) + DEBUG_CRITICAL2("libusb_cancel_transfer failed: %d", ret); + } + } +} /* Multi_PollingTerminate */ + + +/***************************************************************************** + * + * Multi_InterruptRead + * + ****************************************************************************/ +static int Multi_InterruptRead(int reader_index, int timeout /* in ms */) +{ + struct usbDevice_MultiSlot_Extension *msExt; + unsigned char buffer[CCID_INTERRUPT_SIZE]; + struct timespec cond_wait_until; + struct timeval local_time; + int rv, status, interrupt_byte, interrupt_mask; + + msExt = usbDevice[reader_index].multislot_extension; + + /* When stopped, return 0 so IFDHPolling will return IFD_NO_SUCH_DEVICE */ + if ((msExt == NULL) || msExt->terminated) + return 0; + + DEBUG_PERIODIC3("Multi_InterruptRead (%d), timeout: %d ms", + reader_index, timeout); + + /* Select the relevant bit in the interrupt buffer */ + interrupt_byte = (usbDevice[reader_index].ccid.bCurrentSlotIndex / 4) + 1; + interrupt_mask = 0x02 << (2 * (usbDevice[reader_index].ccid.bCurrentSlotIndex % 4)); + + /* Wait until the condition is signaled or a timeout occurs */ + pthread_mutex_lock(&msExt->mutex); + gettimeofday(&local_time, NULL); + cond_wait_until.tv_sec = local_time.tv_sec; + cond_wait_until.tv_nsec = local_time.tv_usec * 1000; + + cond_wait_until.tv_sec += timeout / 1000; + cond_wait_until.tv_nsec += 1000000 * (timeout % 1000); + +again: + rv = pthread_cond_timedwait(&msExt->condition, &msExt->mutex, + &cond_wait_until); + + if (0 == rv) + { + /* Retrieve interrupt buffer and request result */ + memcpy(buffer, msExt->buffer, sizeof buffer); + status = msExt->status; + } + else + if (rv == ETIMEDOUT) + status = LIBUSB_TRANSFER_TIMED_OUT; + else + status = -1; + + /* Don't forget to unlock the mutex */ + pthread_mutex_unlock(&msExt->mutex); + + /* When stopped, return 0 so IFDHPolling will return IFD_NO_SUCH_DEVICE */ + if (msExt->terminated) + return 0; + + /* Not stopped */ + if (status == LIBUSB_TRANSFER_COMPLETED) + { + if (0 == (buffer[interrupt_byte] & interrupt_mask)) + { + DEBUG_PERIODIC2("Multi_InterruptRead (%d) -- skipped", reader_index); + goto again; + } + DEBUG_PERIODIC2("Multi_InterruptRead (%d), got an interrupt", reader_index); + } + else + { + DEBUG_PERIODIC3("Multi_InterruptRead (%d), status=%d", reader_index, status); + } + + return status; +} /* Multi_InterruptRead */ + + +/***************************************************************************** + * + * Multi_InterruptStop + * + ****************************************************************************/ +static void Multi_InterruptStop(int reader_index) +{ + struct usbDevice_MultiSlot_Extension *msExt; + int interrupt_byte, interrupt_mask; + + msExt = usbDevice[reader_index].multislot_extension; + + /* Already stopped ? */ + if ((NULL == msExt) || msExt->terminated) + return; + + DEBUG_PERIODIC2("Stop (%d)", reader_index); + + /* Stop the slot */ + usbDevice[reader_index].multislot_extension = NULL; + + interrupt_byte = (usbDevice[reader_index].ccid.bCurrentSlotIndex / 4) + 1; + interrupt_mask = 0x02 << (2 * (usbDevice[reader_index].ccid.bCurrentSlotIndex % 4)); + + pthread_mutex_lock(&msExt->mutex); + + /* Broacast an interrupt to wake-up the slot's thread */ + msExt->buffer[interrupt_byte] |= interrupt_mask; + pthread_cond_broadcast(&msExt->condition); + pthread_mutex_unlock(&msExt->mutex); +} /* Multi_InterruptStop */ + + +/***************************************************************************** + * + * Multi_CreateFirstSlot + * + ****************************************************************************/ +static struct usbDevice_MultiSlot_Extension *Multi_CreateFirstSlot(int reader_index) +{ + struct usbDevice_MultiSlot_Extension *msExt; + + /* Allocate a new extension buffer */ + msExt = malloc(sizeof(struct usbDevice_MultiSlot_Extension)); + if (NULL == msExt) + return NULL; + + /* Remember the index */ + msExt->reader_index = reader_index; + + msExt->terminated = FALSE; + msExt->status = 0; + msExt->transfer = NULL; + + /* Create mutex and condition object for the interrupt polling */ + pthread_mutex_init(&msExt->mutex, NULL); + pthread_cond_init(&msExt->condition, NULL); + + /* create the thread in charge of the interrupt polling */ + pthread_create(&msExt->thread_proc, NULL, Multi_PollingProc, msExt); + + return msExt; +} /* Multi_CreateFirstSlot */ + + +/***************************************************************************** + * + * Multi_CreateNextSlot + * + ****************************************************************************/ +static struct usbDevice_MultiSlot_Extension *Multi_CreateNextSlot(int physical_reader_index) +{ + /* Take the extension buffer from the main slot */ + return usbDevice[physical_reader_index].multislot_extension; +} /* Multi_CreateNextSlot */ + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ccid-1.4.11/src/ifdhandler.c new/ccid-1.4.12/src/ifdhandler.c --- old/ccid-1.4.11/src/ifdhandler.c 2013-05-11 14:05:49.000000000 +0200 +++ new/ccid-1.4.12/src/ifdhandler.c 2013-07-31 19:13:55.000000000 +0200 @@ -17,7 +17,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/* $Id: ifdhandler.c 6624 2013-05-08 11:45:06Z rousseau $ */ +/* $Id: ifdhandler.c 6685 2013-07-05 07:17:05Z rousseau $ */ #include <stdio.h> #include <string.h> @@ -141,7 +141,10 @@ /* The reader may have to start here so give it some time */ cmd_ret = CmdGetSlotStatus(reader_index, pcbuffer); if (IFD_NO_SUCH_DEVICE == cmd_ret) - return cmd_ret; + { + return_value = cmd_ret; + goto error; + } /* save the current read timeout computed from card capabilities */ oldReadTimeout = ccid_descriptor->readTimeout; @@ -506,10 +509,6 @@ ccid_desc = get_ccid_descriptor(reader_index); - /* more than one slot is not supported */ - if (ccid_desc -> bMaxSlotIndex > 0) - break; - /* CCID and not ICCD */ if ((PROTOCOL_CCID == ccid_desc -> bInterfaceProtocol) /* 3 end points */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ccid-1.4.11/src/tokenparser.c new/ccid-1.4.12/src/tokenparser.c --- old/ccid-1.4.11/src/tokenparser.c 2013-01-16 16:38:55.000000000 +0100 +++ new/ccid-1.4.12/src/tokenparser.c 2013-08-12 23:37:16.000000000 +0200 @@ -491,7 +491,7 @@ * Copyright (C) 2003-2010 * Ludovic Rousseau <[email protected]> * - * $Id: tokenparser.l 6504 2013-01-16 14:22:26Z rousseau $ + * $Id: tokenparser.l 6712 2013-08-05 19:11:47Z rousseau $ */ /** * @file @@ -1941,6 +1941,7 @@ { (void)yylex(); } while (!feof(file)); + yylex_destroy(); (void)fclose(file); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ccid-1.4.11/src/tokenparser.l new/ccid-1.4.12/src/tokenparser.l --- old/ccid-1.4.11/src/tokenparser.l 2013-01-16 15:31:51.000000000 +0100 +++ new/ccid-1.4.12/src/tokenparser.l 2013-08-05 21:18:44.000000000 +0200 @@ -8,7 +8,7 @@ * Copyright (C) 2003-2010 * Ludovic Rousseau <[email protected]> * - * $Id: tokenparser.l 6504 2013-01-16 14:22:26Z rousseau $ + * $Id: tokenparser.l 6712 2013-08-05 19:11:47Z rousseau $ */ /** @@ -203,6 +203,7 @@ { (void)yylex(); } while (!feof(file)); + yylex_destroy(); (void)fclose(file); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ccid-1.4.11/src/towitoko/atr.c new/ccid-1.4.12/src/towitoko/atr.c --- old/ccid-1.4.11/src/towitoko/atr.c 2008-11-18 22:48:42.000000000 +0100 +++ new/ccid-1.4.12/src/towitoko/atr.c 2013-07-31 19:13:55.000000000 +0200 @@ -127,9 +127,9 @@ TDi = atr->ib[pn][ATR_INTERFACE_BYTE_TD].value = atr_buffer[pointer]; atr->ib[pn][ATR_INTERFACE_BYTE_TD].present = TRUE; (atr->TCK).present = ((TDi & 0x0F) != ATR_PROTOCOL_TYPE_T0); + pn++; if (pn >= ATR_MAX_PROTOCOLS) return (ATR_MALFORMED); - pn++; } else { -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
