[Pcsclite-muscle] Bug in CCID library

Ludovic Rousseau ludovic.rousseau at gmail.com
Wed Oct 5 08:52:08 UTC 2016


Hello,
Thanks Godfrey for pointing to your version of the driver. I found the
patch in:
https://github.com/acshk/acsccid/commit/4a7631d014781d36a2d21210b0b8768c07ef8c6d

I propose a simpler version.
Abraham can you test with the attached patch?

Bye

2016-10-05 9:53 GMT+02:00 Abraham Macias Paredes <amacias at solutia-it.es>:

> Hi, my reader is not an ACS one, is a C3PO LTC31 v2.
>
> You can see more details in http://pcsclite.alioth.debian.
> org/ccid/supported.html
>
>
>
>
>
> Thanks Godfrey.
>
>
>
> *De:* Pcsclite-muscle [mailto:pcsclite-muscle-bounces+amacias=
> solutia-it.es at lists.alioth.debian.org] *En nombre de *Godfrey Chung
> *Enviado el:* miércoles, 5 de octubre de 2016 9:27
> *Para:* Talks about MUSCLE <pcsclite-muscle at lists.alioth.debian.org>
> *Asunto:* Re: [Pcsclite-muscle] Bug in CCID library
>
>
>
> Hi Abraham
>
> If you are using ACS readers, you can try acsccid driver and it already
> contains a fix for this issue.
>
>
>
> On Wed, Oct 5, 2016 at 2:44 PM, Abraham Macias Paredes <
> amacias at solutia-it.es> wrote:
>
>
>
> But this sets the speed to 125000 bauds. How can I set the speed to 230400
> bps (the reader maximum data rate)?
>
>
> It depends on F/D values from the card. It cannot be set 230400 bps
> directly.
>
>
>
> Regards
>
> Godfrey
>
> _______________________________________________
> Pcsclite-muscle mailing list
> Pcsclite-muscle at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
>



-- 
 Dr. Ludovic Rousseau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pcsclite-muscle/attachments/20161005/0d66336d/attachment.html>
-------------- next part --------------
--- /var/folders/sg/t7kts8_n6j13n11r6_tgr36r0000gn/T//lKsbAa_ifdhandler.c	2016-10-05 10:51:04.000000000 +0200
+++ src/ifdhandler.c	2016-10-05 10:47:53.000000000 +0200
@@ -831,9 +831,7 @@ EXTERNAL RESPONSECODE IFDHSetProtocolPar
 				/* the card is too fast for the reader */
 				if ((card_baudrate > ccid_desc->dwMaxDataRate +2)
 					/* but TA1 <= 97 */
-					&& (atr.ib[0][ATR_INTERFACE_BYTE_TA].value <= 0x97)
-					/* and the reader has a baud rate table */
-					&& ccid_desc->arrayOfSupportedDataRates)
+					&& (atr.ib[0][ATR_INTERFACE_BYTE_TA].value <= 0x97))
 				{
 					unsigned char old_TA1;
 
@@ -850,8 +848,15 @@ EXTERNAL RESPONSECODE IFDHSetProtocolPar
 						card_baudrate = (unsigned int) (1000 *
 							ccid_desc->dwDefaultClock * d / f);
 
-						if (find_baud_rate(card_baudrate,
+						/* the reader has a baud rate table */
+						if ((ccid_desc->arrayOfSupportedDataRates
+							/* and the baud rate is supported */
+							&& find_baud_rate(card_baudrate,
 							ccid_desc->arrayOfSupportedDataRates))
+							/* or the reader has NO baud rate table */
+							|| ((NULL == ccid_desc->arrayOfSupportedDataRates)
+							/* and the baud rate is bellow the limit */
+							&& (card_baudrate <= ccid_desc->dwMaxDataRate)))
 						{
 							pps[1] |= 0x10; /* PTS1 presence */
 							pps[2] = atr.ib[0][ATR_INTERFACE_BYTE_TA].value;


More information about the Pcsclite-muscle mailing list