Monday, March 25, 2019

PySCard 1.9.8 released

I just released a new version 1.9.8 of pyscard. PySCard is a python module adding smart cards support (PC/SC) to Python.

The PySCard project is available at:

Changes

1.9.8 (March 2018)

  • SmartcardException: store the PC/SC return code in hresult
  • CardMonitoring: stop the looping only if PCSC exited
  • setup: support build on OpenBSD, and other BSD
  • Fix Windows 10 SCARD_E_SERVICE_STOPPED from SCardListReaders()
  • Minor documentation improvements

New version of pcsc-lite: 1.8.25

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

Changes
1.8.25: Ludovic Rousseau
25 March 2019
  • Fix a socket issue when pcscd is used inside LXC container
  • pcsc-spy: always provide a total time of execution
  • Fix resource leak if SCardEstablishContext() fails
  • Fix realloc(3) error handling (possible memory leak)
  • Remove usage of function chmod(2) to use fchmod(2) (fix race condition)

Sunday, March 17, 2019

ATR statistics: TA4

Article from the series "ATR statistics"

TA4

The first TA for T=15 encodes the clock stop indicator (X) and the class indicator (Y). The default values are X = "clock stop not supported" and Y = "only class A supported".

bits 8 and 7 indicate whether the card supports clock stop (≠ 00) or not (= 00) and, when supported, which state is preferred on the electrical circuit CLK when the clock is stopped.
  • 00b: Clock stop not supported
  • 01b: State L
  • 10b: State H
  • 11b: No preference

bits 6 to 1 indicate the classes of operating conditions accepted by the card. Each bit represents a class: bit 1 for class A, bit 2 for class B and bit 3 for class C.
  • 00 0001b: A only
  • 00 0010b: B only
  • 00 0100b: C only
  • 00 0011b: A and B
  • 00 0110b: B and C
  • 00 0111b: A, B and C
  • Any other value: RFU

TA4#%
200996.96 %
0x03271.30 %
0x83150.72 %
0xC3120.58 %
0x0760.29 %
0x4320.10 %
0xC710.05 %



Clock stop#%
not supported3352.38 %
state L23.17 %
state H1523.81 %
no preference1320.63 %

The class defines the current voltage the card can use:
  • class A: 5 V
  • class B: 3 V
  • class C: 1.8 V
Some readers can't provide a tension of 5V. For example the Gemalto CT1100 reader does only provide 3 V. The default value for TA4 is "only class A supported". Some (old) cards require a voltage of 5 V to work and will not work with a CT1100. That can be surprising.

Class#%
A & B5688.89 %
A & B & C711.11 %

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#%
200996.96 %
0x1F612.94 %
0x3F20.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#%
201797.35 %
0x00552.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.

Tuesday, January 29, 2019

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.

Tuesday, January 1, 2019

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

YearTotal number of messages Progression
2009603
2010718+19 %
2011999+39 %
2012207-79 %
2013198-4 %
2014194-2 %
2014194-2 %
2015120-38 %
2016125+4 %
2017128+2 %
201866-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 
1ludovic.rousseau@gmail.com25 39.06 %
2dennis.rieks@agido.com3 4.69 %
3umberto.rustichelli@gt50.org3 4.69 %
4fhoerni@free.fr3 4.69 %
5martin@martinpaljak.net3 4.69 %
6trenta.sis@gmail.com2 3.12 %
7ludovic.rousseau@free.fr2 3.12 %
8rimarko@libero.it2 3.12 %
9fguzmayon@gmail.com2 3.12 %
10yusufgurkan.bor@gmail.com2 3.12 %
11wrosenauer@gmail.com2 3.12 %
12mamikhajjlov@ipmce.ru2 3.12 %
13te.mlists@googlemail.com2 3.12 %
14frankmorgner@gmail.com2 3.12 %
15jras@dia.uned.es1 1.56 %
16corcordt@me.com1 1.56 %
17tomaz.solc@tablix.org1 1.56 %
18emaxx@google.com1 1.56 %
19scolby33@gmail.com1 1.56 %
20Maximilian.Stein@secunet.com1 1.56 %
21smalder73@gmail.com1 1.56 %
22frantisek.rezac@calavera.info1 1.56 %
23andrea@gravityblast.com1 1.56 %
 other0 0.00 %

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

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

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

  Author  bytes 
1yusufgurkan.bor@gmail.com37179
2corcordt@me.com15865
3ludovic.rousseau@gmail.com13549
4frantisek.rezac@calavera.info12714
5jras@dia.uned.es12006
6frankmorgner@gmail.com11521
7ludovic.rousseau@free.fr11184
8dennis.rieks@agido.com10687
9tomaz.solc@tablix.org10091
10fguzmayon@gmail.com9986
11trenta.sis@gmail.com9155
12wrosenauer@gmail.com5131
13rimarko@libero.it5012
14fhoerni@free.fr4925
15martin@martinpaljak.net2952
16mamikhajjlov@ipmce.ru2482
17smalder73@gmail.com1796
18te.mlists@googlemail.com1635
19scolby33@gmail.com1583
20Maximilian.Stein@secunet.com1574
21emaxx@google.com1504
22umberto.rustichelli@gt50.org1396
23andrea@gravityblast.com1126

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 %
23MUSCLE web sites moved to .apdu.fr
1 1.56 %
24New 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 %
 other6 9.38 %

Most used email clients:

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

Table of maximal quoting:

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

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
12345678910111213141516171819202122232425262728293031

Graph showing number of messages written during days of week:

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

MonTueWedThuFriSatSun

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