ATR statistics: TD3 - Structural, encodes Y4 and T

Article from the series "ATR statistics"

TD3 - Structural, encodes Y4 and T

The ISO 7816-3 specification is not public. So I can't copy/paste part of the text. I will use Wikipedia instead.

Refer to TD1 - Structural, encodes Y2 and T since the definition of TD3 is identical to TD1.

TD3 # %
2009 96.96 %
0x1F 61 2.94 %
0x3F 2 0.10 %



TD3 (as the other TDi bytes) is structural and indicates:
  • How to interpret the other ATR bytes
  • What communication protocol the card wants to use

For 96.96% of the ATRs no TD3 is present. So no other TA4, TB4, TC4 or TD4 is present and no new protocol is defined so the protocol(s) defined by TD1 and TD2 will be used.

For 2.94% of the ATRs TD3 = 0x1F. The high nibble is 0001b so TA4 is present and T=15 protocol is defined. One such ATR is 3B 94 18 81 B1 80 7D 1F 03 19 C8 00 50 DC.

For 0.10% of the ATRs TD3 = 0x3F. The high nibble is 0001b so TA4 and TB4 are present and T=15 protocol is defined. One such ATR is 3B DE 18 FF 81 F1 FE 43 00 3F 07 83 44 45 53 46 69 72 65 38 20 53 41 4D 2D 58 17.

ATR statistics: TC3

Article from the series "ATR statistics".

TC3

The ISO 7816-3 specification is not public. So I can't copy/paste part of the text. I will use Wikipedia instead.

For T = 1: type of error detection code used

Bit 1 of the first TC for T=1 indicates the error detection code to be used:
  • CRC if bit 1 is set to 1;
  • LRC (default value) if bit 1 is set to 0.
Bits 8 to 2 of the first TC for T=1 are reserved for future use and shall be set to 0.

TC3 # %
2017 97.35 %
0x00 55 2.65 %

In my list of ATR the only redundancy code used if LRC. I found no card using CRC.

LRC is the default algorithm. But 55 cards explicitly set it. I have no explanation for that.

My blog source code license

The blog articles license is Attribution-NonCommercial-ShareAlike 3.0 as documented in My blog messages license.


Source code samples

I got a question about the license of the source code samples. The Creative Commons license is not really adapted to source code. To allow the reuse of my source samples in other Free Software project I decided to use the GNU GPLv3 license for source code on my blog.


Need something else?

If you need a different license or want to reuse part of my work please contact me.

MUSCLE mailing list statistics for 2018

As I did in 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 and 2017 I propose some statistics of the MUSCLE mailing list usage.

Evolution

Year Total number of messages Progression
2009 603
2010 718 +19 %
2011 999 +39 %
2012 207 -79 %
2013 198 -4 %
2014 194 -2 %
2014 194 -2 %
2015 120 -38 %
2016 125 +4 %
2017 128 +2 %
2018 66 -51 %

Comments

Again a decrease in number of messages.
I note that I receive many messages directly by email instead of the mailing list.

My interpretation is that the development of pcsc-lite and related software is now complete. Only rare bugs are reported.
Now users are asking for support or help and the easiest way to contact me is using one of my emails.


Statistics from 8.1.2018 to 2.11.2018
for pcsclite-muscle@lists.infradead.org



People who have written most messages:

   Author   Msg   Percent 
1 ludovic.rousseau@gmail.com 25 39.06 %
2 dennis.rieks@agido.com 3 4.69 %
3 umberto.rustichelli@gt50.org 3 4.69 %
4 fhoerni@free.fr 3 4.69 %
5 martin@martinpaljak.net 3 4.69 %
6 trenta.sis@gmail.com 2 3.12 %
7 ludovic.rousseau@free.fr 2 3.12 %
8 rimarko@libero.it 2 3.12 %
9 fguzmayon@gmail.com 2 3.12 %
10 yusufgurkan.bor@gmail.com 2 3.12 %
11 wrosenauer@gmail.com 2 3.12 %
12 mamikhajjlov@ipmce.ru 2 3.12 %
13 te.mlists@googlemail.com 2 3.12 %
14 frankmorgner@gmail.com 2 3.12 %
15 jras@dia.uned.es 1 1.56 %
16 corcordt@me.com 1 1.56 %
17 tomaz.solc@tablix.org 1 1.56 %
18 emaxx@google.com 1 1.56 %
19 scolby33@gmail.com 1 1.56 %
20 Maximilian.Stein@secunet.com 1 1.56 %
21 smalder73@gmail.com 1 1.56 %
22 frantisek.rezac@calavera.info 1 1.56 %
23 andrea@gravityblast.com 1 1.56 %
  other 0 0.00 %

Best authors, by total size of their messages (w/o quoting):

   Author   KBytes 
1 ludovic.rousseau@gmail.com 330.8
2 yusufgurkan.bor@gmail.com 72.6
3 dennis.rieks@agido.com 31.3
4 frankmorgner@gmail.com 22.5
5 ludovic.rousseau@free.fr 21.8
6 fguzmayon@gmail.com 19.5
7 trenta.sis@gmail.com 17.9
8 corcordt@me.com 15.5
9 fhoerni@free.fr 14.4
10 frantisek.rezac@calavera.info 12.4
11 jras@dia.uned.es 11.7
12 wrosenauer@gmail.com 10.0
13 tomaz.solc@tablix.org 9.9
14 rimarko@libero.it 9.8
15 martin@martinpaljak.net 8.7
16 mamikhajjlov@ipmce.ru 4.8
17 umberto.rustichelli@gt50.org 4.1
18 te.mlists@googlemail.com 3.2
19 smalder73@gmail.com 1.8
20 scolby33@gmail.com 1.5
21 Maximilian.Stein@secunet.com 1.5
22 emaxx@google.com 1.5
23 andrea@gravityblast.com 1.1

Best authors, by average size of their message (w/o quoting):

   Author   bytes 
1 yusufgurkan.bor@gmail.com 37179
2 corcordt@me.com 15865
3 ludovic.rousseau@gmail.com 13549
4 frantisek.rezac@calavera.info 12714
5 jras@dia.uned.es 12006
6 frankmorgner@gmail.com 11521
7 ludovic.rousseau@free.fr 11184
8 dennis.rieks@agido.com 10687
9 tomaz.solc@tablix.org 10091
10 fguzmayon@gmail.com 9986
11 trenta.sis@gmail.com 9155
12 wrosenauer@gmail.com 5131
13 rimarko@libero.it 5012
14 fhoerni@free.fr 4925
15 martin@martinpaljak.net 2952
16 mamikhajjlov@ipmce.ru 2482
17 smalder73@gmail.com 1796
18 te.mlists@googlemail.com 1635
19 scolby33@gmail.com 1583
20 Maximilian.Stein@secunet.com 1574
21 emaxx@google.com 1504
22 umberto.rustichelli@gt50.org 1396
23 andrea@gravityblast.com 1126

Table showing the most successful subjects:

   Subject   Msg   Percent 
1 [Pcsclite-muscle] DUAli DE-620 Smart Card Reader Connection
5 7.81 %
2 [Pcsclite-muscle] Dual Interface Reader
3 4.69 %
3 [Pcsclite-muscle] Rare race condition in SCardGetStatusChange()
3 4.69 %
4 [Pcsclite-muscle] issues with OmniKey 3121 and InCard cards
3 4.69 %
5 [Pcsclite-muscle] closing client cancels ongoing transaction
3 4.69 %
6 [Pcsclite-muscle] nfc on android
3 4.69 %
7 [Pcsclite-muscle] Baudrate change
3 4.69 %
8 [Pcsclite-muscle] Free software SIM card software simulator?
3 4.69 %
9 [Pcsclite-muscle] smartcard
2 3.12 %
10 [Pcsclite-muscle] 20th Anniversary of MUSCLE
2 3.12 %
11 [Pcsclite-muscle] Possible regression with Schlumberger egate
2 3.12 %
12 [Pcsclite-muscle] Help required with Microchip SEC1210 over Serial
2 3.12 %
13 [Pcsclite-muscle] Firefox does not trigger pcsc start
2 3.12 %
14 [Pcsclite-muscle] MUSCLE web sites moved to .apdu.fr
2 3.12 %
15 [Pcsclite-muscle] Problem with EZ100PU reader
2 3.12 %
16 [Pcsclite-muscle] PCSCD partially detecting smart card readers
2 3.12 %
17 [Pcsclite-muscle] New version of libccid: 1.4.30
2 3.12 %
18 [Pcsclite-muscle] NXP NFC Cube on macOS Mojave
2 3.12 %
19 [Pcsclite-muscle] pcsc-lite 1.8.23
1 1.56 %
20 [Pcsclite-muscle] C3PO LTC31-v2 does not have a pinpad as
1 1.56 %
21 [Pcsclite-muscle] SAM ISO7816 connection
1 1.56 %
22 [Pcsclite-muscle] socket activation
1 1.56 %
23 MUSCLE web sites moved to .apdu.fr
1 1.56 %
24 New version of pcsc-tools: 1.5.3
1 1.56 %
25 [Pcsclite-muscle] IDBridge K3000 is not found by pcsc_scan
1 1.56 %
26 [Pcsclite-muscle] CCID has undefined symbol 'yylex' when loaded by
1 1.56 %
27 [Pcsclite-muscle] CCID has undefined symbol 'yylex' when loaded
1 1.56 %
28 [Pcsclite-muscle] Strange gnome/gdm behavior w/ pcsc,
1 1.56 %
29 [Pcsclite-muscle] SCardCancel broken
1 1.56 %
30 [Pcsclite-muscle] Czech official identity card
1 1.56 %
  other 6 9.38 %

Most used email clients:

   Mailer   Msg   Percent 
1 (unknown) 44 68.75 %
2 Mozilla/5.x 11 17.19 %
3 Apple Mail (2.3445.100.39)
3 4.69 %
4 Apple Mail (2.3445.5.20)
2 3.12 %
5 Open-Xchange Mailer v7.8.3-Rev48
2 3.12 %
6 Apple Mail (2.3445.9.1)
1 1.56 %
7 Apple Mail (2.3445.101.1)
1 1.56 %
  other 0 0.00 %

Table of maximal quoting:

   Author   Percent 
1 umberto.rustichelli@gt50.org 53.36 %
2 scolby33@gmail.com 49.14 %
3 emaxx@google.com 38.58 %
4 te.mlists@googlemail.com 38.45 %
5 mamikhajjlov@ipmce.ru 30.34 %
6 Maximilian.Stein@secunet.com 25.43 %
7 fhoerni@free.fr 18.63 %
8 andrea@gravityblast.com 17.62 %
9 martin@martinpaljak.net 15.78 %
10 rimarko@libero.it 9.38 %
11 trenta.sis@gmail.com 4.61 %
12 fguzmayon@gmail.com 4.32 %
13 ludovic.rousseau@gmail.com 3.17 %
14 wrosenauer@gmail.com 3.03 %
15 dennis.rieks@agido.com 0.00 %
16 ludovic.rousseau@free.fr 0.00 %
17 yusufgurkan.bor@gmail.com 0.00 %
18 frankmorgner@gmail.com 0.00 %
19 jras@dia.uned.es 0.00 %
20 corcordt@me.com 0.00 %
21 tomaz.solc@tablix.org 0.00 %
22 smalder73@gmail.com 0.00 %
23 frantisek.rezac@calavera.info 0.00 %
  average 4.68 %

Graph showing number of messages written during hours of day:

msgs
1
|
0
|
0
|
0
|
0
|
0
|
1
|
1
|
1
|
2
|
4
|
4
|
4
|
7
|
6
|
4
|
5
|
7
|
3
|
3
|
2
|
6
|
2
|
1
|
hour
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Graph showing number of messages written during days of month:

msgs
2
|
4
|
2
|
3
|
3
|
1
|
2
|
3
|
4
|
0
|
1
|
3
|
0
|
0
|
1
|
0
|
2
|
4
|
3
|
1
|
2
|
5
|
3
|
0
|
1
|
3
|
0
|
3
|
3
|
2
|
3
|
day
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Graph showing number of messages written during days of week:

msgs
9
|
7
|
14
|
13
|
15
|
3
|
3
|

Mon Tue Wed Thu Fri Sat Sun

Maximal quoting:

Author : ludovic.rousseau@gmail.com
Subject : [Pcsclite-muscle] SCardCancel broken

Date : Thu, 26 Jul 2018 11:09:43 +0200

Quote ratio: 61.36% / 3204 bytes

Longest message:

Author : ludovic.rousseau@gmail.com
Subject : [Pcsclite-muscle] DUAli DE-620 Smart Card Reader Connection
Date : Fri, 31 Aug 2018 17:28:28 +0200
Size : 79832 bytes

Most successful subject:

Subject : [Pcsclite-muscle] DUAli DE-620 Smart Card Reader Connection
No. of msgs: 5
Total size : 172375 bytes

Final summary:

Total number of messages: 64
Total number of different authors: 23
Total number of different subjects: 36
Total size of messages (w/o headers): 675021 bytes
Average size of a message: 10547 bytes

Happy new year 2019

Dear readers,

I wish you a happy new year for 2019.

In 2018 I published 24 articles on this blog (34 in 2017 and 49 in 2016 and 51 in 2015). It is, again, decreasing.

Audience

The number of readers in 2018 is also decreasing by 20% compared to 2017.


A large part of readers came from the USA, France is 2nd, followed by Germany.

The first cities from USA are from California: San Francisco, San Diego, Los Angeles, San Jose, Palo Alto, etc. The second state from USA is Oregon with 94% of Oregon readers from Boardman. Is there a high smart card activity in Bordman/Oregon?

In France 33% of readers comes from Paris. The distribution is more homogeneous in Germany.



Most read articles

Title # %
PCSC sample in C 1 5.71 %
Blog homepage 2 5.50 %
PC/SC sample in different languages 3 4.82 %
PCSC sample in C# 4 4.15 %
PCSC sample in Python 5 3.16 %
PCSC sample in Java 6 2.45 %
pcscd auto start using systemd 7 2.44 %
Level 1 smart card support on Mac OS X 8 2.25 %
PCSC sample in JavaScript (Node.js) 9 1.83 %
Linux NFC driver conflicts with CCID driver for ACS ACR122U 10 1.68 %

PC/SC sample articles are always successful. I wrote them in 2010.
The first article from those I wrote in 2018 is at position 17 and is "How to use SCardGetStatusChange()?".

Thank you

Thank you to you, readers.

This blog has no advertising. If you want to support it you can send me some bitcoins. If you want to send $ or € instead of bitcoins then contact me.

macOS Mojave and smart card source code

Apple released the source code of the open source components they use in Mojave (macOS 10.14, released in September 2018). The components are available at macOS X 10.14 Source.


Many smart card components are now closed source and maintained by Apple for its different OSes. I can cite:

CCID driver

Apple provides my Free Software CCID driver. The source code from Apple is available at:
Version 55017 corresponds to CCID version 1.4.27 and was already present in macOS High Sierra as noted in "macOS High Sierra and smart cards status".

    Tokend

    Apple still provides "support" of the tokend technology even if it is deprecated since OS X Lion (2011). The source code is provided at:
    The version 55111 has not changed since macOS Sierra. see "macOS Sierra and smart card source code".

    Conclusion

    No change in the free software component binaries so also no change in the corresponding component source codes.

    New version of pcsc-tools: 1.5.4

    I just released a new version of pcsc-tools, a suite of tools for PC/SC.

    A big thank you to Lionel Victor, original author of gscriptor, for the port of gscriptor to Gtk+3. My level of Perl programming has diminished since I do not use this language any more.

    Changes:
    1.5.4 - 12 December 2018, Ludovic ROUSSEAU

    • 213 new ATRs
    • pcsc_scan: display the number of events
    • gscriptor: port from Gtk+2 to Gtk+3

    New version of pcsc-lite: 1.8.24

    I just released a new version of pcsc-lite 1.8.24.
    pcsc-lite is a Free Software implementation of the PC/SC (or WinSCard) API for Unix systems.

    Changes
    1.8.24: Ludovic Rousseau
    12 October 2018

    • the project moved to https://pcsclite.apdu.fr/
    • SCardGetStatusChange(): Fix a rare race condition
    • SCardReleaseContext(): do not release a lock owned by another context
    • SCardReconnect(): suspend card auto power off
    • Allow "=" in serial driver filenames
    • Add the thread id in the pcscd log lines
    • pcsc-spy: correctly handle incomplete log file
    • Simclist: avoid to divide by zero in list_findpos()
    • Some other minor improvements

    macOS Mojave and smart cards status

    macOS Mojave (macOS 10.14) is now available since 24th September, 2018.



    API Differences between 10.13 and 10.14

    The differences should be listed in the developer page macOS Mojave 10.14.
    The changes for Mojave are not yet available.

    PC/SC

    Since Yosemite (10.10) the PC/SC layer is no more a fork of pcsc-lite. So comparing versions with pcsc-lite is useless.

    $ cat /System/Library/Frameworks/PCSC.framework/Versions/A/Resources/version.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
     <key>BuildAliasOf</key>
     <string>CryptoTokenKit</string>
     <key>BuildVersion</key>
     <string>163</string>
     <key>CFBundleShortVersionString</key>
     <string>8.0</string>
     <key>CFBundleVersion</key>
     <string>1</string>
     <key>ProjectName</key>
     <string>SmartCardServices</string>
     <key>SourceVersion</key>
     <string>281200021000000</string>
    </dict>
    </plist>
    

    The BuildVersion moved from 10 in Sierra 10.13.6 to 163 in Mojave 10.14.0. Maybe Apple made 163 - 10 = 153 internal/alpha/beta releases?

    The SourceVersion moved from 281050022000000 in High Sierra 10.13.6 to 281200021000000 in Mojave 10.14.0. I have no idea how to parse or use this information.

    PC/SC Bugs fixed

    These bugs were found in High Sierra are now fixed in Mojave:
    • Typo in error message from PC/SC call pcsc_stringify_error(), bug #40995115.
      pcsc_stringify_error() returned "Unkown error" instead of ""UnkNown error" for unknown error codes.
    Maybe some other PC/SC bugs (unknown by me) have been fixed.

    CryptoTokenKit

    CryptoTokenKit is the native smart card API since the complete rewrite in macOS Yosemite 10.10 (OS X Yosemite BETA and smart cards status).

    $ strings /System/Library/Frameworks/CryptoTokenKit.framework/CryptoTokenKit | grep BuildRoot
    /BuildRoot/Library/Caches/com.apple.xbs/Sources/CryptoTokenKit/CryptoTokenKit-281.200.21/CryptoTokenKit/TKToken.m
    /BuildRoot/Library/Caches/com.apple.xbs/Sources/CryptoTokenKit/CryptoTokenKit-281.200.21/CryptoTokenKit/TKSmartCard.m
    /BuildRoot/Library/Caches/com.apple.xbs/Sources/CryptoTokenKit/CryptoTokenKit-281.200.21/CryptoTokenKit/TKTokenSession.m

    In Mojave CryptoTokenKit source code is at version 281.200.21. It was at version 281.1.1 in High Sierra 10.13.0 and 281.50.22 in High Sierra 10.13.6.
    Since the source code is not available I can't write much more than that.

    CCID driver

    Driver version: 1.4.27.

    $ grep -A 1 CFBundleShortVersionString /usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist
     <key>CFBundleShortVersionString</key>
     <string>1.4.27</string>
    

    This is the exact same version as in Hight Sierra 10.13.0.

    Note that the CCID version 1.4.28 was released in October 2017 and version 1.4.29 in February 2018. Apple had plenty of time to upgrade the CCID driver. This is surprising.

    The current version of the CCID driver is 1.4.30. This version was released 5 days before Mojave so I was not expecting to see this version included in Mojave.

    Conclusion

    No much visible changes in the smart card layer in macOS Mojave.

    It is surprising Apple has not upgraded the CCID driver since the previous major version of macOS. I understand this major version of macOS is not a revolution but more a stabilisation of macOS.