[Pcsclite-muscle] SCardConnect() returns unresponsive card

Francois Grieu fgrieu at gmail.com
Thu May 18 12:10:30 UTC 2017


On 2017-05-18 at 12:10, Gökçenur CANLI wrote:
 > (..) New log file is attached.

This log contains
00000016 Card ATR: 3B 9F 96 81 31 FE 45 80 65 54 43 12 21 08 31 C0 73 F6 21 80 
81 05 9A
In this TA1 is 96h, meaning the card suggests that the reader attempts a PPS/PTS 
negociatione to use of an F/D ratio of 512/32=16, that is a bit rate 1/16 of the 
clock, which is usually between 3.5 to 5MHz, thus a bit rate on the tune of 250 
kbit/s. The log shows that the reader attempts to do this, and it fails:
00019824 prothandler.c:124:PHSetProtocol() PTS failed (612), using T=1


On 2017-05-17 at 15:52, Gökçenur CANLI wrote:
 > I am having trouble with SCardTransmit() when using Microchip SEC1110 smart 
card reader.
 > I sent  APDU commands to smart card sequentially. After a while,  Linux 
"select()" function in MessageReceive(in winscard_msg.c) blocks my program and 
never remove blocking when using SCardTransmit.

This is consistent with unreliable operation of the smart card reader at high 
communication speed. Notice that it has been formally certified to meet EMV 
specifications ( EMV 4.3 book 1, available at no charge at 
http://www.emvco.com/specifications.aspx?id=223 ), but these specify only TA1 of 
11h, 12h, or 13h; that is F/D of 372, 186, or 93; and the certification report ( 
http://ww1.microchip.com/downloads/en/DeviceDoc/EMV%20report%20-%20CETECOM.PDF ) 
shows the tests did not explore lower F/D / higher communications speeds. There 
are quite a few hardware and a lot of software resons that ISO 7816-3 
reader/card communication can fail at high speed; reader implementors get it 
right only after many years; and most often they move to other priorities before 
that (based on observation of the industry since ISO 7816-3:1989 was still a draft).

Possible ways to save the day:
- use another reader;
- manage to reconfigure the card to ask for a lower speed (TA1 of 11h, 12h, or 
13h) or skip TA1 altogether;
- reconfigure the reader (or its driver) to not attempt PPS/PTS negociation, or 
attempt TA1 = 13h even though the card suggests otherwise.

If their is a way to do any of the later point with Pcsclite, I want to learn how!

   Francois Grieu



More information about the Pcsclite-muscle mailing list