Important!

Blog moved to https://blog.apdu.fr/

I moved my blog from https://ludovicrousseau.blogspot.com/ to https://blog.apdu.fr/ . Why? I wanted to move away from Blogger (owne...

Friday, April 6, 2012

New version of libccid: 1.4.6

I just released a new version of libccid.

1.4.6 - 6 April 2012, Ludovic Rousseau
  • Add support of
    • Avtor SC Reader 371
    • Avtor SecureToken
    • DIGIPASS KEY 202
    • Fujitsu SmartCase KB SCR eSIG
    • Giesecke & Devrient StarSign CUT
    • Inside Secure VaultIC 460 Smart Object
    • Macally NFC CCID eNetPad reader
    • OmniKey 6321 USB
    • SCM SDI 011
    • Teridian TSC12xxF
    • Vasco DIGIPASS KEY 101
  • Remove support of readers without a USB CCID descriptor file
    • 0x08E6:0x34C1:Gemalto Ezio Shield Secure Channel
    • 0x08E6:0x34C4:Gemalto Ezio Generic
    • 0x04E6:0x511A:SCM SCR 3310 NTTCom
    • 0x0783:0x0008:C3PO LTC32 USBv2 with keyboard support
    • 0x0783:0x9002:C3PO TLTC2USB
    • 0x047B:0x020B:Silitek SK-3105
  • Disable SPE for HP USB CCID Smartcard Keyboard. The reader is bogus and unsafe.
  • Convert "&" in a reader name into "&" to fix a problem on Mac OS X
  • Fix a problem with ICCD type A devices. We now wait for device ready
  • Secure PIN Verify and PIN Modify: set the minimum timeout to 90 seconds
  • Add support of wIdVendor and wIdProduct properties
  • Add support of dwMaxAPDUDataSize
  • Add support of Gemalto firmware features
  • some minor bugs removed

You can download it here.

Thursday, April 5, 2012

Extended APDU support reported by PC/SC (part 2)

In a previous article "Extended APDU support reported by PC/SC" I described a proposal for the PC/SC workgroup to report to the application if a couple reader/driver do support extended APDU or not.

History

The proposal was accepted at the November 2011 meeting.

This feature is implemented in the CCID reader revision 6258 and will be available in the next CCID driver release.

Usage

One of the planed user of this feature is OpenSC. I, sometimes, get bug reports because the OpenSC card driver is sending an extended APDU to a reader that do not support it.

The idea is to use PCSCv2_PART10_PROPERTY_dwMaxAPDUDataSize in OpenSC and display a clear message to the user.

Conclusion

PCSCv2_PART10_PROPERTY_dwMaxAPDUDataSize is now available for you. Use it if/when you need this feature.

Monday, April 2, 2012

Identifying a reader model (part 2)

In a previous article "Identifying a reader model" I described a proposal for the PC/SC workgroup to uniquely identify a (USB) reader.

History

The proposal was accepted at the November 2011 meeting.

I added the needed #define in pcsc-lite version 1.8.3 I just released 2 days ago. The support is also added in my CCID driver and a release is expected soon.

You can find sample code using the new feature in PCSC/UnitaryTests/ directory with FEATURE_CCID_ESC_COMMAND_Xiring.py.

Source code

The code is:

#! /usr/bin/env python

"""
#   FEATURE_CCID_ESC_COMMAND_Xiring.py: Unitary test for
#   FEATURE_CCID_ESC_COMMAND
#   Copyright (C) 2012  Ludovic Rousseau

"""

#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License along
#   with this program; if not, see <http://www.gnu.org/licenses/>.

# You have to enable the use of Escape commands with the
# DRIVER_OPTION_CCID_EXCHANGE_AUTHORIZED bit in the ifdDriverOptions
# option of the CCID driver Info.plist file

from smartcard.System import readers
from smartcard.pcsc.PCSCPart10 import (getFeatureRequest, hasFeature,
    getTlvProperties, FEATURE_CCID_ESC_COMMAND, SCARD_SHARE_DIRECT)

# use the first reader
card_connection = readers()[0].createConnection()
card_connection.connect(mode=SCARD_SHARE_DIRECT)

# get CCID Escape control code
feature_list = getFeatureRequest(card_connection)

ccid_esc_command = hasFeature(feature_list, FEATURE_CCID_ESC_COMMAND)
if ccid_esc_command is None:
    raise Exception("The reader does not support FEATURE_CCID_ESC_COMMAND")

# get the TLV PROPERTIES
tlv = getTlvProperties(card_connection)

# check we are using a Xiring Leo v1 or v2 reader
if tlv['PCSCv2_PART10_PROPERTY_wIdVendor'] == 0x0F14 \
    and (tlv['PCSCv2_PART10_PROPERTY_wIdProduct'] in [0x0037, 0x0038]):

    # proprietary escape command for Xiring Leo readers
    version = [ord(c) for c in "VERSION"]
    res = card_connection.control(ccid_esc_command, version)
    print res
    print "VERSION:", ''.join([chr(x) for x in res])

    serial = [ord(c) for c in "GET_SN"]
    res = card_connection.control(ccid_esc_command, serial)
    print res
    print "GET_SN:", ''.join([chr(x) for x in res])
else:
    print "Xiring Leo reader not found"

Comments

Compared to the example in example in "Identifying a reader model" the name are PCSCv2_PART10_PROPERTY_wIdVendor and PCSCv2_PART10_PROPERTY_wIdProduct instead of PCSCv2_PART10_PROPERTY_idVendor and PCSCv2_PART10_PROPERTY_idProduct. A "w" has been added to suggest a (windows) word type (16 bits).

The names have also been added in pyscard (the PC/SC Python wrapper) in revision 590. But I have no idea of when a new stable version of pyscard will be released.

Conclusion

It is now/soon possible to identify a reader model before sending a, possibly, dangerous command if sent to another reader.

Since the Escape commands are dangerous by default, they are disabled in the CCID driver. You will need to edit the Info.plist file and change the value of ifdDriverOptions to add the DRIVER_OPTION_CCID_EXCHANGE_AUTHORIZED bit.

Friday, March 30, 2012

New version of pcsc-lite: 1.8.3

I just released a new version of pcsc-lite 1.8.3. No big changes.

pcsc-lite-1.8.3: Ludovic Rousseau
30 March 2012
  • ignore directories and hidden (.*) files when parsing a configuration directory (like /etc/reader.conf.d/)
  • add Mac OS X for PC/SC spy tool
  • fix a bug in PC/SC spy tool when loading of the real library fails
  • add PCSCv2_PART10_PROPERTY_dwMaxAPDUDataSize, PCSCv2_PART10_PROPERTY_wIdVendor and PCSCv2_PART10_PROPERTY_wIdProduct from PC/SC v2 part 10 release 2.02.09 (not yet published)
  • Some other minor improvements and bug corrections

Monday, January 30, 2012

10 years as a Debian Developer

In September 2001 I became a Debian Developer. I do not remember the exact date.

October 2001

Of course my first Debian package upload was related to smart card. It is the first upload of the ifd-gempc package:

ifd-gempc (0.5.4-1) unstable; urgency=low
   * Initial Release.
   * close ITP (Closes: #117441)
   * add debconf scripts for gempc410
 -- Ludovic Rousseau <rousseau@debian.org>  Tue, 30 Oct 2001 00:16:54 +0100

June 2002

Not too much later (June 2002) I became the Debian maintainer for pcsc-lite:

pcsc-lite (1.1.1-1) unstable; urgency=low
   * New upstream release (Closes: #150994)
   * New maintainer. Thanks Carlos for your job
   * Use init.d level 50 to start _after_ usbmgr with level 45.
     see the note in /usr/share/doc/pcscd/README.Debian (Closes: #146151)
   * update pcscd(1) manpage
 -- Ludovic Rousseau <rousseau@debian.org>  Sun, 30 Jun 2002 14:52:27 +0200

Now

Since then I maintain some more smart card related Debian packages, also available in Ubuntu and other Debian derivatives.

I try to maintain a list of smart card related packages inside Debian.

Maybe I will still maintain smart card packages in 10 years :-)

Wednesday, January 18, 2012

New version of pcsc-lite: 1.8.2


I just released a new version of pcsc-lite 1.8.2. No big changes except for pcsc-spy I talked about in a previous article "PCSC API spy, third try".

Changelog:
pcsc-lite-1.8.2: Ludovic Rousseau
18 January 2012
  • rename pcsc-spy.py to pcsc-spy and install it as a normal binary (in /usr/local/bin by default)
  • write a pcsc-spy.1 manpage
  • fix a bug with a multi-slot reader
  • Info.plist parser: avoid a buffer read overflow in &amp; management
  • Some Doxygen improvements

Friday, January 6, 2012

OpenSC mailing list statistics for 2011

After the MUSCLE mailing list statistics for 2011 I also did the operation for two OpenSC mailing lists. The opensc-users list has been merged in the opensc-devel mailing list in August 2011. So the statistics presented here represent the sum of both lists.

Comments

Top poster

I am also the top poster on the OpenSC mailing list. I am surprised by this result. Maybe because many questions are related to PCSC?

Number of messages

This list has 3.2 times more messages than the MUSCLE mailing list. I can propose different explanations for that:

  • the MUSCLE project is more mature than OpenSC
  • bugs/issues are reported on the OpenSC mailing list because that is what users use even if the problem is in PCSC or libccid
  • pcsc-lite and libccid are easy to use. No configuration is needed (no more serial port to select) and the same driver (libccid) now can be used by any modern USB reader (no more a specific driver per reader)
  • PKCS#11 use is developing because citizen cards are deployed in "many" countries
  • Problems are more complex to track in OpenSC so more emails are needed to solve them
  • many other reasons

1 person, 2 emails

Some people (like Viktor Tarasov) use 2 different email on the list. So his rank is not correct. I don't think that is a real problem.

Cross posts

From the top 30 threads, 7 threads are cross posted to the MUSCLE list. From the MUSCLE statistics only 1 of the 30 top threads is a cross post.
I don't know how to interpret this result.



Statistics from 1.1.2011 to 31.12.2011
for OpenSC lists


People who have written most messages:

 Author  Msg  Percent 
1ludovic.rousseau@gmail.com43513.53 %
2martin@martinpaljak.net43113.41 %
3jmpoure@gooze.eu2648.21 %
4deengert@anl.gov2036.32 %
5viktor.tarasov@opentrust.com1504.67 %
6viktor.tarasov@gmail.com922.86 %
7andre.zepezauer@student.uni-halle.de822.55 %
8ndk.clanbo@gmail.com772.40 %
9alon.barlev@gmail.com732.27 %
10peter@stuge.se652.02 %
11morgner@informatik.hu-berlin.de461.43 %
12aj@dungeon.inka.de451.40 %
13anders.rundgren@telia.com381.18 %
14jonsito@terra.es341.06 %
15development@aventra.fi341.06 %
16stefw@collabora.co.uk270.84 %
17helpcrypto@gmail.com260.81 %
18Johannes.Becker@hrz.uni-giessen.de220.68 %
19mr.dash.four@googlemail.com210.65 %
20JONSITO@terra.es210.65 %
21squalyl@gmail.com200.62 %
22aquamaniac@gmx.de200.62 %
23B.Thomas@astronautics.com200.62 %
24kalev@smartlink.ee190.59 %
25peter@adpm.de190.59 %
26ruckuus@gmail.com180.56 %
27wrosenauer@gmail.com180.56 %
28William.HOURY@atosorigin.com180.56 %
29kalevlember@gmail.com170.53 %
30mstjohns@comcast.net160.50 %
other84326.23 %

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

 Author  KBytes 
1alon.barlev@gmail.com1538.0
2jmpoure@gooze.eu615.8
3martin@martinpaljak.net560.2
4deengert@anl.gov436.3
5William.HOURY@atosorigin.com398.0
6ludovic.rousseau@gmail.com338.1
7viktor.tarasov@opentrust.com273.2
8hardik.shah@jetmobile.com261.2
9development@aventra.fi249.7
10viktor.tarasov@gmail.com160.2
11andre.zepezauer@student.uni-halle.de157.1
12peter@adpm.de143.0
13jonsito@terra.es136.4
14lk@tms.pl129.8
15ndk.clanbo@gmail.com115.5
16morgner@informatik.hu-berlin.de112.2
17lyall.pearce@hp.com109.7
18business@reebs.org103.7
19kgo@grant-olson.net97.8
20B.Thomas@astronautics.com97.0
21fmb@inf.ufsc.br96.7
22kalev@smartlink.ee85.7
23marc_m@gmx.at83.4
24lyall.pearce@gmail.com83.1
25helpcrypto@gmail.com78.9
26ruckuus@gmail.com78.8
27JONSITO@terra.es78.2
28Alexei.Soloview@intech.natm.ru76.6
29stefw@collabora.co.uk71.9
30mhayk@m2smart.com.br69.4

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

 Author  bytes 
1mgfranco@gmail.com33252
2hardik.shah@jetmobile.com29719
3lyall.pearce@hp.com28091
4felixcodeboy@gmail.com26476
5William.HOURY@atosorigin.com22642
6thorsten.engel@matrix-computer.com21641
7alon.barlev@gmail.com21574
8lyall.pearce@gmail.com21277
9wiking@maeth.com20496
10lk@tms.pl18989
11SERGE.GADIOUX@atosorigin.com18307
12Jonatan =?ISO-8859-1?Q?=C5kerlind?=15755
13marc_m@gmx.at14239
14dom_fischer@web.de13490
15joel.hockey@gmail.com11705
16mescheryakov@rutoken.ru11521
17bendrich@dfn-cert.de11001
18kiefer@flexsecure.de10379
19rolf.wald@lug-balista.de10293
20rrelyea@redhat.com10203
21fgoulart@fmagj.com.br9974
22gblanc@linagora.com9662
23business@reebs.org9654
24mariano.benedettini@qmas.com8632
25benallemand@gmail.com8553
26detlef.graef@yahoo.de8402
27mike@sentex.net8240
28marte@compunet.it8219
29iuridiniz@gmail.com8151
30brenojac@gmail.com7984

Table showing the most successful subjects:

 Subject  Msg  Percent 
1[opensc-devel] sc_ctx_detect_readers patch491.52 %
2[Muscle] Access to multiple contactless cards using PCSC-Lite361.12 %
3[opensc-devel] How to make proper use of sc_card_cache341.06 %
4[opensc-user] Newbie help310.96 %
5[Muscle] PCSC Daemon cannot access Cyberjack reader300.93 %
6[Muscle] PC/SC workgroup, November 2011 meeting300.93 %
7[opensc-devel] Multiple certs on a MyEID card?300.93 %
8[opensc-devel] First Smartcard logon issue on XP SP3 with300.93 %
9[opensc-user] /usr/bin/pkcs15-tool -c failed ..290.90 %
10[opensc-devel] Cardmod: classic form for the container's ID290.90 %
11[opensc-devel] Moving master forward280.87 %
12[opensc-devel] Problem with CardMan4040 and OpenSC270.84 %
13[Muscle] GlobalPlatform Library & GPShell documentation now online260.81 %
14[Muscle] PCSCD got segmentation fault on ARM v5 with uClibc260.81 %
15[opensc-devel] Consistence between the OpenSC and proprietary250.78 %
16[opensc-devel] Feitian PKI speed240.75 %
17[opensc-devel] Status of PINPAD support in OpenSC / libccid240.75 %
18[opensc-devel] Proposed cardmod patch230.72 %
19[opensc-devel] OpenSC shared mode230.72 %
20[opensc-devel] usb p11 token220.68 %
21[opensc-devel] --insecure ?210.65 %
22[opensc-devel] Status installing and using opensc + minidriver210.65 %
23[opensc-devel] Java and pkcs11210.65 %
24[Muscle] Woxter SmartCard reader200.62 %
25[opensc-user] Is ePass2000-FT12 supported?200.62 %
26[opensc-devel] Gnome smartcard manager200.62 %
27[opensc-devel] pkcs15-tool --list-public-keys200.62 %
28[opensc-devel] Static link for opensc-pkcs11.dll190.59 %
29[opensc-devel] Problems with opensc+openvpn builds from Alon190.59 %
30[Muscle] Speed detection patch when reader has no baud rates180.56 %
other243975.89 %

Most used email clients:

 Mailer  Msg  Percent 
1(unknown)124038.58 %
2Mozilla/5.x89027.69 %
3KMail1524.73 %
4Apple Mail (2.1082)1394.32 %
5Apple Mail (2.1084)1263.92 %
6Evolution 2.32.3 882.74 %
7Evolution 2.30.3 812.52 %
8Evolution 2.22.3.1802.49 %
9Evolution 2.32.2 742.30 %
10Microsoft Office Outlook 12.0521.62 %
11Evolution 2.32.2 (2.32.2-1.fc14) 240.75 %
12Apple Mail (2.1244.3)200.62 %
13QUALCOMM Windows Eudora160.50 %
14Lotus Notes Release 8.0150.47 %
15Evolution 3.0.2- 140.44 %
16Evolution 3.0.3-2 130.40 %
17RoundCube Webmail/0.4110.34 %
18Apple Mail (2.936)100.31 %
19Evolution 2.30.3 (2.30.3-1.fc13) 100.31 %
20Mutt100.31 %
21Apple Mail (2.1078)90.28 %
22git-send-email 1.7.5.480.25 %
23Lotus Notes Release 8.570.22 %
24Mew version 6.3.50 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO)60.19 %
25Zarafa 6.40.5-2486060.19 %
26Alpine 2.00 (DEB 1167 2008-08-23)50.16 %
27git-send-email 1.7.3.450.16 %
28Evolution 3.0.3-3 50.16 %
29YahooMailWebService/0.8.113.31361940.12 %
30Thunderbird 2.0.0.24 (Windows/20100228)40.12 %
other902.80 %

Table of maximal quoting:

 Author  Percent 
1karlssoj@arcada.fi98.17 %
2menezes.gabryella@gmail.com90.35 %
3jesus.guerrero.botella@gmail.com81.57 %
4janjust@nikhef.nl79.62 %
5extramrdo@gmail.com75.88 %
6fabeisageek@googlemail.com73.39 %
7david.mattes@boeing.com73.17 %
8s.ferey@wanadoo.fr72.48 %
9andreas.schwier.ml@cardcontact.de72.35 %
10sebastien@lorquet.fr71.47 %
11lionel@mamane.lu68.69 %
12michaelbender@me.com64.76 %
13fundu_1999@yahoo.com63.71 %
14richter@ecos.de62.73 %
15etthom0@gmail.com62.19 %
16edward.middleton@vortorus.net59.70 %
17andreas.schwier@cardcontact.de58.79 %
18resoli@libero.it55.63 %
19peter.ordonez@gmail.com55.37 %
20widerstand@t-online.de54.61 %
21francois.leblanc@cev-sa.com54.28 %
22bjoernk2@googlemail.com53.67 %
23nmav@gnutls.org52.51 %
24opensc@secure-edge.com50.88 %
25weitao@ftsafe.com50.48 %
26tomasg@primekey.se50.10 %
27ffred69@gmail.com50.08 %
28vladimir.davydov@promwad.com49.51 %
29weizhongqiang@gmail.com49.37 %
30Jean-Pierre.Szikora@uclouvain.be48.86 %
average21.77 %

Graph showing number of messages written during hours of day:

msgs64
|
24
|
18
|
15
|
10
|
7
|
12
|
39
|
110
|
241
|
275
|
258
|
186
|
249
|
233
|
258
|
236
|
173
|
171
|
141
|
118
|
118
|
148
|
110
|
hour 01234567891011121314151617181920212223

Graph showing number of messages written during days of month:

msgs72
|
50
|
112
|
126
|
114
|
101
|
108
|
177
|
122
|
120
|
108
|
115
|
122
|
127
|
74
|
98
|
74
|
98
|
94
|
102
|
107
|
106
|
74
|
72
|
165
|
147
|
89
|
110
|
92
|
72
|
66
|
day 12345678910111213141516171819202122232425262728293031

Graph showing number of messages written during days of week:

msgs431
|
568
|
521
|
572
|
626
|
260
|
236
|

MonTueWedThuFriSatSun


Maximal quoting:

Author : alon.barlev@gmail.com
Subject : [opensc-devel] Problems with opensc+openvpn builds from Alon
Date : Wed, 28 Sep 2011 15:40:00 +0300
Quote ratio: 98.91% / 22784 bytes

Longest message:

Author : alon.barlev@gmail.com
Subject : [opensc-devel] Problems with opensc+openvpn builds from Alon
Date : Fri, 30 Sep 2011 18:45:31 +0300
Size : 1402547 bytes

Most successful subject:

Subject : [opensc-devel] sc_ctx_detect_readers patch
No. of msgs: 49
Total size : 191734 bytes

Final summary:

Total number of messages: 3214
Total number of different authors: 241
Total number of different subjects: 687
Total size of messages (w/o headers): 12199358 bytes
Average size of a message: 3795 bytes


Input file last updated: Fri Jan 6 14:45:58 2012Generated by MailListStat v1.3