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
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1596662

Title:
  pcscd fails to read CAC card data, errors out

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pcsc-lite/+bug/1596662/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to