[pkg-gnupg-maint] Bug#814584: gnupg2: gpg2 --card-status fail on armel / Raspberry Pi - "Card error"

Petter Reinholdtsen pere at hungry.com
Sat Jun 11 19:51:53 UTC 2016


Hi, and sorry it took so long before I had time to revisit this issue.

[NIIBE Yutaka 2016-04-26]
> Here are some information and somethings to try.
> 
> (1) Power consumption of smartcard readers/token is small.  For
>     example, it's just a few mA for Gnuk Token.  So, I don't think
>     power consumption matters.

I agree.  I borrowed a USB power meter and it could not measure the
power consumption from the card as it was too low.

> (2) On the other hand, the root hub of RPi matters.  It is good idea
>     to use USB hub with independent power supply to figure out the USB
>     problem.  Or, I found the boot cmdline option of "dwc_otg.speed=1"
>     for RPi to specify the USB speed to 12Mbps.

I tried a powered HUB, without any changes.  Did not yet try
dwc_otg.speed=1.
 
> (3) We don't need to use pcscd.  We can just use internal CCID driver
>     of GnuPG and I think it is better because software components
>     become simpler.  At least, simpler is better when debugging.  Try
>     with "service pcscd stop" or "apt-get remove pcscd".

Right.  It is not running on my test RPi.

> (4) To debug scdaemon, please have the following configuration file.
>     Note that it may log your PIN information, so, don't send the log
>     when you do authenticate the card (or change your PIN before your
>     experiment and debug).

I did this, and got this content in /run/user/1000/scd.log when I ran
'gpg2 --card-status':

2016-06-11 21:46:26 scdaemon[16023] listening on socket `/tmp/gpg-x5maJc/S.scdaemon'
2016-06-11 21:46:26 scdaemon[16023] handler for fd -1 started
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver: using CCID reader 0 (ID=08E6:3438:X:0)
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver: idVendor: 08E6  idProduct: 3438  bcdDevice: 0200
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver: ChipCard Interface Descriptor:
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bLength                54
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bDescriptorType        33
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bcdCCID              1.01  (Warning: Only accurate for version 1.0)
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   nMaxSlotIndex           0
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bVoltageSupport         7  ?
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwProtocols             3  T=0 T=1
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwDefaultClock       4800
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwMaxiumumClock      4800
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bNumClockSupported      0
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwDataRate          12903 bps
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwMaxDataRate      825806 bps
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bNumDataRatesSupp.     53
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwMaxIFSD             254
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwSyncProtocols  00000000 
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwMechanical     00000000 
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwFeatures       00010230
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:     Auto clock change
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:     Auto baud rate change
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:     NAD value other than 0x00 accepted
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:     TPDU level exchange
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwMaxCCIDMsgLen       271
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bClassGetResponse      00
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bClassEnvelope         00
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   wlcdLayout           none
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bPINSupport             0 
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bMaxCCIDBusySlots       1
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver: usb_claim_interface failed: -1
2016-06-11 21:46:26 scdaemon[16023] PC/SC OPEN failed: no service (0x8010001d)
scdaemon[16023]: chan_7 -> OK GNU Privacy Guard's Smartcard server ready
scdaemon[16023]: chan_7 <- GETINFO socket_name
scdaemon[16023]: chan_7 -> D /tmp/gpg-x5maJc/S.scdaemon
scdaemon[16023]: chan_7 -> OK
scdaemon[16023]: chan_7 <- SERIALNO openpgp
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver: using CCID reader 0 (ID=08E6:3438:X:0)
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver: idVendor: 08E6  idProduct: 3438  bcdDevice: 0200
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver: ChipCard Interface Descriptor:
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bLength                54
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bDescriptorType        33
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bcdCCID              1.01  (Warning: Only accurate for version 1.0)
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   nMaxSlotIndex           0
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bVoltageSupport         7  ?
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwProtocols             3  T=0 T=1
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwDefaultClock       4800
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwMaxiumumClock      4800
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bNumClockSupported      0
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwDataRate          12903 bps
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwMaxDataRate      825806 bps
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bNumDataRatesSupp.     53
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwMaxIFSD             254
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwSyncProtocols  00000000 
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwMechanical     00000000 
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwFeatures       00010230
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:     Auto clock change
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:     Auto baud rate change
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:     NAD value other than 0x00 accepted
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:     TPDU level exchange
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   dwMaxCCIDMsgLen       271
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bClassGetResponse      00
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bClassEnvelope         00
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   wlcdLayout           none
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bPINSupport             0 
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver:   bMaxCCIDBusySlots       1
2016-06-11 21:46:26 scdaemon[16023] DBG: ccid-driver: usb_claim_interface failed: -1
2016-06-11 21:46:26 scdaemon[16023] PC/SC OPEN failed: no service (0x8010001d)
scdaemon[16023]: chan_7 -> ERR 100663404 Card error <SCD>
scdaemon[16023]: chan_7 <- RESTART
scdaemon[16023]: chan_7 -> OK
scdaemon[16023]: chan_7 <- [eof]
2016-06-11 21:46:26 scdaemon[16023] handler for fd -1 terminated
2016-06-11 21:46:27 scdaemon[16023] scdaemon (GnuPG) 2.0.26 stopped

Did not tell me much, but perhaps you see anything wrong with it?

> I use Gnuk Token daily with Wandboard (armhf) and Orange PI PC (armhf)
> through a USB hub on the USB keyboard.  I have been using a variant of
> SheevaPlug (armel) for the development of NeuG (when I let the device
> generate 64GiB of output) with a USB hub.  All work well.

Right.  Good to know.

-- 
Happy hacking
Petter Reinholdtsen



More information about the pkg-gnupg-maint mailing list