[PATCH] Issue 1238 (scdaemon often needs restarting after removing OpenPGP smartcard)

Nedko Arnaudov nedko at arnaudov.name
Fri Oct 22 16:57:59 CEST 2010


I've been hit by this bug and I made a quick (and maybe wrong and
nasty) fix that works for me. The patch is attached to this mail and
also is available here:

http://nedko.arnaudov.name/soft/gnupg-2.0.16-Issue1238.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnupg-2.0.16-Issue1238.patch
Type: text/x-patch
Size: 582 bytes
Desc: not available
URL: </pipermail/attachments/20101022/c7ab9da4/attachment.bin>
-------------- next part --------------

My test case is:

1. start pcscd
2. insert the usb reader
3. start gpg-agent (it starts scdaemon)
4. gpg --card-status
[success, polling of card status starts]
5. remove the reader
[polling of card status continues, scdaemon notices card status change, 7->0]
6. gpg --card-status
[expected failure,
scdaemon logs: "PC/SC RESET failed: invalid value (0x80100011)",
stops the polling and a disconnect message can be seen in the pcscd log]
7. insert the reader
8. gpg --card-status
[failure, but should succeed because the card is available now]

I noticed that if step 6 is skipped, step 8 will succeed.

The patch does the code to not attempt to reset if it is known that card
is not present.

My card reader is Omnikey Cardman 6121
My smartcard is OpenPGP v2
I use the proprietary driver for the reader (ifdokccid_lnx-3.6.0.tar.gz)

scdaemon still does not fully handle card insertions and removals. It
fails permanently if I attempt to access the card before it is inserted
for first time.

-- 
Nedko Arnaudov <GnuPG KeyID: 5D1B58ED>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: </pipermail/attachments/20101022/c7ab9da4/attachment.pgp>


More information about the Gnupg-users mailing list