Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#748754: pcscd: card reader no longer recognized

471 views
Skip to first unread message

Martin-Éric Racine

unread,
May 20, 2014, 9:30:02 AM5/20/14
to
Package: pcscd
Version: 1.8.11-1
Severity: important

May 20 16:10:42 suomi pcscd[21255]: 01259768 commands.c:1477:CCID_Receive Card absent or mute
May 20 16:10:42 suomi pcscd[21255]: 00000064 commands.c:2104:CmdXfrBlockCHAR_T0() CCID_Receive failed
May 20 16:10:42 suomi pcscd[21255]: 00000025 ifdwrapper.c:553:IFDTransmit() Card not transacted: 612
May 20 16:10:42 suomi pcscd[21255]: 00000025 ifdwrapper.c:553:IFDTransmit() Card not transacted: 612
May 20 16:10:42 suomi pcscd[21255]: 00000012 winscard.c:1638:SCardTransmit() Card not transacted: 0x80100016
May 20 16:10:42 suomi pcscd[21255]: 00000012 winscard.c:1638:SCardTransmit() Card not transacted: 0x80100016
May 20 16:10:42 suomi pcscd[21255]: 00026522 commands.c:2161:CmdXfrBlockCHAR_T0() Unrecognized Procedure byte (0xE0) found!
May 20 16:10:42 suomi pcscd[21255]: 00026522 commands.c:2161:CmdXfrBlockCHAR_T0() Unrecognized Procedure byte (0xE0) found!

This is on a DELL D430 laptop using the built-in card reader.

Additional details can be found on bug #743567 against OpenSC.
Given the above, this might, instead, be a pcscd issue.
Feel free to reassign to another package as appropriate.

-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (1001, 'testing'), (1001, 'oldstable'), (101, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.14-1-686-pae (SMP w/1 CPU core)
Locale: LANG=fi_FI.utf8, LC_CTYPE=fi_FI.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pcscd depends on:
ii init-system-helpers 1.18
ii libc6 2.18-5
ii libccid [pcsc-ifd-handler] 1.4.16-1
ii libpcsclite1 1.8.11-1
ii libudev1 204-8
ii lsb-base 4.1+Debian12

pcscd recommends no packages.

Versions of packages pcscd suggests:
ii systemd 204-8

-- no debconf information


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/debian-bugs-dist

Ludovic Rousseau

unread,
May 20, 2014, 1:20:01 PM5/20/14
to
Le 20/05/2014 15:22, Martin-�ric Racine a �crit :
> Package: pcscd
> Version: 1.8.11-1
> Severity: important
>
> May 20 16:10:42 suomi pcscd[21255]: 01259768 commands.c:1477:CCID_Receive Card absent or mute
> May 20 16:10:42 suomi pcscd[21255]: 00000064 commands.c:2104:CmdXfrBlockCHAR_T0() CCID_Receive failed
> May 20 16:10:42 suomi pcscd[21255]: 00000025 ifdwrapper.c:553:IFDTransmit() Card not transacted: 612
> May 20 16:10:42 suomi pcscd[21255]: 00000025 ifdwrapper.c:553:IFDTransmit() Card not transacted: 612
> May 20 16:10:42 suomi pcscd[21255]: 00000012 winscard.c:1638:SCardTransmit() Card not transacted: 0x80100016
> May 20 16:10:42 suomi pcscd[21255]: 00000012 winscard.c:1638:SCardTransmit() Card not transacted: 0x80100016
> May 20 16:10:42 suomi pcscd[21255]: 00026522 commands.c:2161:CmdXfrBlockCHAR_T0() Unrecognized Procedure byte (0xE0) found!
> May 20 16:10:42 suomi pcscd[21255]: 00026522 commands.c:2161:CmdXfrBlockCHAR_T0() Unrecognized Procedure byte (0xE0) found!
>
> This is on a DELL D430 laptop using the built-in card reader.
>
> Additional details can be found on bug #743567 against OpenSC.
> Given the above, this might, instead, be a pcscd issue.
> Feel free to reassign to another package as appropriate.

Please follow http://pcsclite.alioth.debian.org/ccid.html#support to provide more detailed information.

Thanks

--
Dr. Ludovic Rousseau

Martin-Éric Racine

unread,
May 20, 2014, 2:50:02 PM5/20/14
to

2014-05-20 20:08 GMT+03:00 Ludovic Rousseau <ludovic....@gmail.com>:
On Debian/testing, accessing a FinEID card using the D430's internal Oz776 card reader:

libccid 1.4.16-1
libpcsclite1:i386 1.8.11-1
opensc 0.13.0-5

$ opensc-tool --reader 0 --name
SetCOS

$ opensc-explorer
OpenSC Explorer version 0.13.0
Using reader with a card: O2 Micro Oz776 00 00
unable to select MF: Transmit failed

$ lsusb | grep 776
Bus 003 Device 009: ID 0b97:7762 O2 Micro, Inc. Oz776 SmartCard Reader
Bus 003 Device 004: ID 0b97:7761 O2 Micro, Inc. Oz776 1.1 Hub

$ sudo pcscd --version
pcsc-lite version 1.8.11.
Copyright (C) 1999-2002 by David Corcoran <corc...@musclecard.com>.
Copyright (C) 2001-2011 by Ludovic Rousseau <ludovic....@free.fr>.
Copyright (C) 2003-2004 by Damien Sauveron <sauv...@labri.fr>.
Report bugs to <mus...@lists.musclecard.com>.
Enabled features: Linux i486-pc-linux-gnu serial usb libudev usbdropdir=/usr/lib/pcsc/drivers ipcdir=/var/run/pcscd configdir=/etc/reader.conf.d

(log attached)

-- Martin-Éric
log.txt

Ludovic Rousseau

unread,
May 24, 2014, 9:40:02 AM5/24/14
to
Le 20/05/2014 20:35, Martin-Éric Racine a écrit :
>
> 2014-05-20 20:08 GMT+03:00 Ludovic Rousseau <ludovic....@gmail.com>:
>> Please follow http://pcsclite.alioth.debian.org/ccid.html#support to provide
>> more detailed information.
>
> On Debian/testing, accessing a FinEID card using the D430's internal Oz776 card reader:

Thanks for the details.

I can't find any problem in the log you sent.
You need to generate the log when you run the program causing the problem. In your case you need to start the log and then run "opensc-explorer" as that is the command that fails with an error.

Bye

Martin-Éric Racine

unread,
Dec 26, 2015, 4:40:04 AM12/26/15
to
2015-12-26 10:29 GMT+02:00 Ludovic Rousseau <ludovic....@free.fr>:
> Hello Martin-Éric,
>
> Le 24/05/2014 15:37, Ludovic Rousseau a écrit :
>>
>> Le 20/05/2014 20:35, Martin-Éric Racine a écrit :
>>>
>>>
>>> 2014-05-20 20:08 GMT+03:00 Ludovic Rousseau <ludovic....@gmail.com>:
>>>>
>>>> Please follow http://pcsclite.alioth.debian.org/ccid.html#support to
>>>> provide
>>>> more detailed information.
>>>
>>>
>>> On Debian/testing, accessing a FinEID card using the D430's internal
>>> Oz776 card reader:
>>
>>
>> Thanks for the details.
>>
>> I can't find any problem in the log you sent.
>> You need to generate the log when you run the program causing the problem.
>> In your case you need to start the log and then run "opensc-explorer" as
>> that is the command that fails with an error.
>>
>> Bye
>>
>
> I got no news about this bug report since more than 1 year.

In case it was not clear back then, there was no specific program
causing the issue. The card reader fails as previously show _always_
with recent OpenSC versions.

Martin-Éric

Martin-Éric Racine

unread,
Dec 26, 2015, 4:50:03 AM12/26/15
to
Hello Ludovic,

For some reason, the message below never was delivered to the bug. Resending.

---------- Forwarded message ----------
From: Martin-Éric Racine <martin-er...@iki.fi>
Date: 2014-05-24 17:23 GMT+03:00
Subject: Re: Bug#748754: pcscd: card reader no longer recognized
To: 748...@bugs.debian.org



2014-05-24 16:37 GMT+03:00 Ludovic Rousseau <ludovic....@gmail.com>:
> Le 20/05/2014 20:35, Martin-Éric Racine a écrit :
>>
>>
>> 2014-05-20 20:08 GMT+03:00 Ludovic Rousseau <ludovic....@gmail.com>:
>>>
>>> Please follow http://pcsclite.alioth.debian.org/ccid.html#support to
>>> provide
>>> more detailed information.
>>
>>
>> On Debian/testing, accessing a FinEID card using the D430's internal Oz776
>> card reader:
>
>
> Thanks for the details.
>
> I can't find any problem in the log you sent.

I ran the same logging sequence, this time trying to access the card
with 1) opensc-explorer 2) opensc-tools and 3) the OpenSC pluging via
Iceweasel. Attached.

Martin-Éric
log2.txt

Ludovic Rousseau

unread,
Dec 26, 2015, 7:50:03 AM12/26/15
to
Every thing goes fine
00000159 ifdhandler.c:1122:IFDHPowerICC() action: PowerUp, usb:0b97/7762:libudev:0:/dev/bus/usb/001/008 (lun: 0)
00000163 -> 000000 62 00 00 00 00 00 0C 01 00 00
00972736 <- 000000 80 10 00 00 00 00 0C 00 00 00 3B 7B 94 00 00 80 62 12 51 56 46 69 6E 45 49 44
00000034 winscard.c:336:SCardConnect() power up complete.
00000018 Card ATR: 3B 7B 94 00 00 80 62 12 51 56 46 69 6E 45 49 44

Until the first command is sent to the card:
00000021 APDU: 00 A4 04 0C 0C A0 00 00 00 63 50 4B 43 53 2D 31 35
00000011 ifdhandler.c:1266:IFDHTransmitToICC() usb:0b97/7762:libudev:0:/dev/bus/usb/001/008 (lun: 0)
00000023 commands.c:1966:CmdXfrBlockCHAR_T0() T=0: 17 bytes
00000020 -> 000000 6F 05 00 00 00 00 0E 00 01 00 00 A4 04 0C 0C
01230094 <- 000000 80 00 00 00 00 00 0E 40 FE 00
00000066 commands.c:1477:CCID_Receive Card absent or mute
00000013 commands.c:2104:CmdXfrBlockCHAR_T0() CCID_Receive failed
00000016 SW:

Your O2Micro reader is listed in the "Unsupported or partly supported CCID readers" list [1] so I am not too surprised to see a problem with this reader.

Also your reader uses "Character level exchange". Readers using this mode of communication are very rare. Only 1.51% [2] of the readers in my list use this mode.

Can you try the same card with another reader?

Bye

[1] https://pcsclite.alioth.debian.org/ccid/unsupported.html#0x0B970x7762
[2] https://pcsclite.alioth.debian.org/select_readers/?dwFeatures=11

--
Dr. Ludovic Rousseau

Martin-Éric Racine

unread,
Dec 26, 2015, 8:00:03 AM12/26/15
to
Considering that it was working fine until recent versions, I am very
surprised to see that it no longer works.

> Also your reader uses "Character level exchange". Readers using this mode of
> communication are very rare. Only 1.51% [2] of the readers in my list use
> this mode.

Could be. I wouldn't know.

> Can you try the same card with another reader?

The same card works fine with an external USB reader, but it defeats
the whole purpose of having a built-in card reader.

Martin-Éric

Ludovic Rousseau

unread,
Dec 26, 2015, 8:20:03 AM12/26/15
to
Interesting. So it is a regression.
Do you know with what version of libccid your reader was working?

I am not the author of the code for "Character level exchange". I do not remember having made a change in this code. It may be a side effect of another change.

Using git bisect would greatly help find the source of the problem.
The CCID driver git repository is available from https://pcsclite.alioth.debian.org/ccid.html

>> Also your reader uses "Character level exchange". Readers using this mode of
>> communication are very rare. Only 1.51% [2] of the readers in my list use
>> this mode.
>
> Could be. I wouldn't know.
>
>> Can you try the same card with another reader?
>
> The same card works fine with an external USB reader, but it defeats
> the whole purpose of having a built-in card reader.

I understand.

Martin-Éric Racine

unread,
Dec 26, 2015, 9:00:03 AM12/26/15
to
.2015-12-26 15:11 GMT+02:00 Ludovic Rousseau <ludovic....@gmail.com>:
My initial bug report said so, already in the Subject line.

> Do you know with what version of libccid your reader was working?

Something just prior to when the initial bug report was filed. Please
also see Bug #743567.

> I am not the author of the code for "Character level exchange". I do not
> remember having made a change in this code. It may be a side effect of
> another change.

Quite possible.

> Using git bisect would greatly help find the source of the problem.
> The CCID driver git repository is available from
> https://pcsclite.alioth.debian.org/ccid.html

Noted. This being said, can you confirm whether the most probable
cause would be changes in CCID or in OPENSC?

Martin-Éric

Ludovic Rousseau

unread,
Dec 26, 2015, 9:50:03 AM12/26/15
to
Most probably a change in the CCID driver.

What would help me a lot is a pcscd trace with a working CCID driver so I can compare the 2 traces.
Can you try to install older libccid packages until you find one that works for you?

In your initial bug report you used libccid 1.4.16-1
wheezy (oldstable) has version 1.4.7-1. This should be a good candidate.

Martin-Éric Racine

unread,
Dec 26, 2015, 10:30:03 AM12/26/15
to
Same log generation method as above, but with an older libccid?

Is the API/ABI the same or do I need to re-compile anything against
that 1.4.7-1 version?

Martin-Éric

Martin-Éric Racine

unread,
Dec 26, 2015, 11:40:06 AM12/26/15
to
1.4.7-1 worked: 'pkcs15-tool --list-keys' correctly shows both of the
RSA certificates.

I visited the snapshot host ( http://snapshot.debian.org/package/ccid/
) and gradually upgraded until I found the culprit:

Setting up libccid (1.4.15-1) ...
Installing new version of config file /etc/libccid_Info.plist ...
Installing new version of config file /etc/reader.conf.d/libccidtwin ...

This version installs a new version of libccidtwin and that is what
seemingly breaks it.

The log under 1.4.14-1 (last known good version) is attached. Actions
performed during this trace:

1. launch the pcsd daemon in debug mode.
2. insert card.
3. execute 'pkcs15-tool --list-keys' on another terminal.
4. remove card.
5. terminate the pcsd daemon.

I hope this helps.

Martin-Éric
libccdi_1.4.14-1_log.txt

Ludovic Rousseau

unread,
Dec 26, 2015, 12:10:03 PM12/26/15
to
Le 26/12/2015 17:37, Martin-Éric Racine a écrit :
> 1.4.7-1 worked: 'pkcs15-tool --list-keys' correctly shows both of the
> RSA certificates.
>
> I visited the snapshot host ( http://snapshot.debian.org/package/ccid/
> ) and gradually upgraded until I found the culprit:
>
> Setting up libccid (1.4.15-1) ...
> Installing new version of config file /etc/libccid_Info.plist ...
> Installing new version of config file /etc/reader.conf.d/libccidtwin ...
>
> This version installs a new version of libccidtwin and that is what
> seemingly breaks it.
>
> The log under 1.4.14-1 (last known good version) is attached. Actions
> performed during this trace:
>
> 1. launch the pcsd daemon in debug mode.
> 2. insert card.
> 3. execute 'pkcs15-tool --list-keys' on another terminal.
> 4. remove card.
> 5. terminate the pcsd daemon.
>
> I hope this helps.

Yes, it greatly helped.

Your problem should be already solved in CCID version 1.4.20.
Just for info, the upstream commit is https://anonscm.debian.org/cgit/pcsclite/CCID.git/commit/?id=205e4657b87aa9367af755f28461436ab43696d5

Debian testing has the CCID driver version 1.4.21.

Can you try with this version and confirm the bug is fixed?

Martin-Éric Racine

unread,
Dec 26, 2015, 12:40:03 PM12/26/15
to
2015-12-26 19:04 GMT+02:00 Ludovic Rousseau <ludovic....@gmail.com>:
> Le 26/12/2015 17:37, Martin-Éric Racine a écrit :
>>
>> 1.4.7-1 worked: 'pkcs15-tool --list-keys' correctly shows both of the
>> RSA certificates.
>>
>> I visited the snapshot host ( http://snapshot.debian.org/package/ccid/
>> ) and gradually upgraded until I found the culprit:
>>
>> Setting up libccid (1.4.15-1) ...
>> Installing new version of config file /etc/libccid_Info.plist ...
>> Installing new version of config file /etc/reader.conf.d/libccidtwin ...
>>
>> This version installs a new version of libccidtwin and that is what
>> seemingly breaks it.
>>
>> The log under 1.4.14-1 (last known good version) is attached. Actions
>> performed during this trace:
>>
>> 1. launch the pcsd daemon in debug mode.
>> 2. insert card.
>> 3. execute 'pkcs15-tool --list-keys' on another terminal.
>> 4. remove card.
>> 5. terminate the pcsd daemon.
>>
>> I hope this helps.
>
>
> Yes, it greatly helped.
>
> Your problem should be already solved in CCID version 1.4.20.
> Just for info, the upstream commit is
> https://anonscm.debian.org/cgit/pcsclite/CCID.git/commit/?id=205e4657b87aa9367af755f28461436ab43696d5

Visited snaphost again:

1.4.19-1 fails,
1.4.20-1 works.

> Debian testing has the CCID driver version 1.4.21.
>
> Can you try with this version and confirm the bug is fixed?

1.4.21-1 works too.

Could the fix please be pushed into STABLE as 1.4.18-1+deb8u1 too?

Thanks!
Martin-Éric

Ludovic Rousseau

unread,
Dec 26, 2015, 1:20:03 PM12/26/15
to
Le 26/12/2015 18:29, Martin-Éric Racine a écrit :
> 2015-12-26 19:04 GMT+02:00 Ludovic Rousseau <ludovic....@gmail.com>:
>> Your problem should be already solved in CCID version 1.4.20.
>> Just for info, the upstream commit is
>> https://anonscm.debian.org/cgit/pcsclite/CCID.git/commit/?id=205e4657b87aa9367af755f28461436ab43696d5
>
> Visited snaphost again:
>
> 1.4.19-1 fails,
> 1.4.20-1 works.

Good.

>> Debian testing has the CCID driver version 1.4.21.
>>
>> Can you try with this version and confirm the bug is fixed?
>
> 1.4.21-1 works too.
>
> Could the fix please be pushed into STABLE as 1.4.18-1+deb8u1 too?

It is not a security issue. I am not sure I can push this fix into stable.

Martin-Éric Racine

unread,
Dec 26, 2015, 1:40:03 PM12/26/15
to
True, but it IS a regression from the previous stable release AND a
simple one-line fix. I have a hard time thinking how RM could
possibly deny this one.

Martin-Éric
0 new messages