may it be similar to the following poblema http://www.natisbad.org/E4300/? The link propose a patch to remove a sequence of NULL
Quote: After some debugging at opensc level, it seems that the reader returns (via openct) some APDU with leading NULL bytes (more precisely, 252 of those NULL bytes). I wrote a small temporary fix (below) for opensc package but the problem should probably be corrected at a lower level level. Index: opensc-0.11.4/src/libopensc/apdu.c =================================================================== --- opensc-0.11.4.orig/src/libopensc/apdu.c 2008-12-26 09:37:55.000000000 +0100 +++ opensc-0.11.4/src/libopensc/apdu.c 2008-12-26 09:41:36.000000000 +0100 @@ -455,6 +455,25 @@ return SC_ERROR_NOT_SUPPORTED; } +#define BROADCOM_E4300_BUG_APDU_DROP 252 + if (apdu->resplen >= BROADCOM_E4300_BUG_APDU_DROP) { + int i, allzero=1; + u8 *tmp = apdu->resp; + + for (i=0; i < BROADCOM_E4300_BUG_APDU_DROP; i++) { + if (tmp[i] != 0) { + allzero = 0; + break; + } + } + + if (allzero) { + memmove(tmp, tmp + BROADCOM_E4300_BUG_APDU_DROP, + apdu->resplen - BROADCOM_E4300_BUG_APDU_DROP); + apdu->resplen -= BROADCOM_E4300_BUG_APDU_DROP; + } + } + /* if the command already returned some data * append the new data to the end of the buffer */ -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to pcsc-lite in Ubuntu. https://bugs.launchpad.net/bugs/1596662 Title: pcscd fails to read CAC card data, errors out Status in pcsc-lite package in Ubuntu: Confirmed Bug description: When I use Firefox to try and access a website using my CAC card, with a Broadcom Corp 5880 [Contacted SmartCard] smart card reader on a Dell Precision 7510 and libcackey, my web browser hangs for a bit, then fails, and looking at pcscd's log shows the following (note the lines: "00000026 ifdwrapper.c:348:IFDStatusICC() Card not transacted: 612 00000002 winscard.c:592:SCardReconnect() Error resetting card." Ubuntu 14.04.4, kernel 4.2.0-38-generic. See below: winscard.c:1632:SCardTransmit() UnrefReader() count was: 2 00000003 winscard_svc.c:608:ContextThread() TRANSMIT rv=0x0 for client 15 00000039 winscard_svc.c:319:ContextThread() Received command: TRANSMIT from client 15 00000008 readerfactory.c:772:RFReaderInfoById() RefReader() count was: 1 00000003 winscard.c:1587:SCardTransmit() Send Protocol: T=0 00000003 APDU: 00 C0 00 00 BA 00000003 ifdhandler.c:1266:IFDHTransmitToICC() usb:0a5c/5800:libudev:1:/dev/bus/usb/001/005 (lun: 0) 00014006 commands.c:1456:CCID_Receive() Can't read all data (54 out of 188 expected) 00000012 SW: 00000003 ifdwrapper.c:527:IFDTransmit() Card not transacted: 612 00000003 winscard.c:1612:SCardTransmit() Card not transacted: 0x80100016 00000002 winscard.c:1632:SCardTransmit() UnrefReader() count was: 2 00000003 winscard_svc.c:608:ContextThread() TRANSMIT rv=0x80100016 for client 15 00000038 winscard_svc.c:319:ContextThread() Received command: RECONNECT from client 15 00000007 winscard.c:504:SCardReconnect() Attempting reconnect to token. 00000003 readerfactory.c:772:RFReaderInfoById() RefReader() count was: 1 00230568 ccid_usb.c:790:ReadUSB() read failed (1/5): -8 Resource temporarily unavailable 00000026 ifdwrapper.c:348:IFDStatusICC() Card not transacted: 612 00000002 winscard.c:592:SCardReconnect() Error resetting card. 00000002 winscard.c:793:SCardReconnect() UnrefReader() count was: 2 00000003 winscard_svc.c:472:ContextThread() RECONNECT rv=0x80100066 for client 15 00000049 winscard_svc.c:319:ContextThread() Received command: TRANSMIT from client 15 00000007 readerfactory.c:772:RFReaderInfoById() RefReader() count was: 1 00000002 winscard.c:1632:SCardTransmit() UnrefReader() count was: 2 00000001 winscard_svc.c:608:ContextThread() TRANSMIT rv=0x80100068 for client 15 00000014 winscard_svc.c:319:ContextThread() Received command: DISCONNECT from client 15 00000004 readerfactory.c:772:RFReaderInfoById() RefReader() count was: 1 00000002 winscard.c:850:SCardDisconnect() Active Contexts: 1 00000002 winscard.c:851:SCardDisconnect() dwDisposition: 0 00000001 winscard.c:1016:SCardDisconnect() powerState: POWER_STATE_GRACE_PERIOD 00000003 ifdhandler.c:362:IFDHGetCapabilities() tag: 0xFB2, usb:0a5c/5800:libudev:1:/dev/bus/usb/001/005 (lun: 0) 00000002 winscard.c:1030:SCardDisconnect() Stopping polling thread 00000014 ifdhandler.c:327:IFDHStopPolling() usb:0a5c/5800:libudev:1:/dev/bus/usb/001/005 (lun: 0) 00000147 winscard.c:1043:SCardDisconnect() UnrefReader() count was: 2 00000007 winscard_svc.c:490:ContextThread() DISCONNECT rv=0x0 for client 15 00000049 winscard_svc.c:319:ContextThread() Received command: CONNECT from client 15 00000024 winscard.c:235:SCardConnect() Attempting Connect to Broadcom Corp 5880 [Contacted SmartCard] (0123456789ABCD) 00 00 using protocol: 3 00000002 readerfactory.c:745:RFReaderInfo() RefReader() count was: 1 00000002 winscard.c:322:SCardConnect() Card Not Powered To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/pcsc-lite/+bug/1596662/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp