[Pcsclite-cvs-commit] r3330 - /trunk/Drivers/ccid/src/ifdhandler.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Sun Mar 1 12:49:31 UTC 2009


Author: rousseau
Date: Sun Mar  1 12:49:31 2009
New Revision: 3330

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3330
Log:
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

Modified:
    trunk/Drivers/ccid/src/ifdhandler.c

Modified: trunk/Drivers/ccid/src/ifdhandler.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ifdhandler.c?rev=3330&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ifdhandler.c (original)
+++ trunk/Drivers/ccid/src/ifdhandler.c Sun Mar  1 12:49:31 2009
@@ -817,6 +817,23 @@
 					atr.ib[i][ATR_INTERFACE_BYTE_TB].value);
 				param[3] = atr.ib[i][ATR_INTERFACE_BYTE_TB].value;
 
+				{
+					/* Hack for OpenGPG card */
+					char atr[] = { 0x3B, 0xFA, 0x13, 0x00, 0xFF, 0x81,
+						0x31, 0x80, 0x45, 0x00, 0x31, 0xC1, 0x73, 0xC0,
+						0x01, 0x00, 0x00, 0x90, 0x00, 0xB1 };
+
+					if (0 == memcmp(ccid_slot->pcATRBuffer, atr,
+						ccid_slot->nATRLength))
+						/* change BWI from 4 to 7 to increase BWT from
+						 * 1.4s to 11s and avoid a timeout during on
+						 * board key generation (bogus card) */
+					{
+						param[3] = 0x75;
+						DEBUG_COMM2("OpenPGP hack, using 0x%02X", param[3]);
+					}
+				}
+
 				/* only the first TBi (i>2) must be used */
 				break;
 			}




More information about the Pcsclite-cvs-commit mailing list