Patch for scdaemon and reader/smartcard combo devices

Grant Olson kgo at grant-olson.net
Fri Jan 21 05:08:29 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/20/2011 10:56 PM, NIIBE Yutaka wrote:
> 2011-01-21 10:09, Grant Olson wrote:
>> @@ -1412,10 +1413,10 @@ reset_pcsc_reader_wrapped (int slot)
>>      {
>>        log_error ("PC/SC RESET failed: %s (0x%lx)\n",
>>                   pcsc_error_string (err), err);
>> -      /* If the error code is no smart card, we should not considere
>> +      /* If the error code is no smart card or no reader, we should not
>> conside
>>           this a major error and close the wrapper.  */
>>        sw = pcsc_error_to_sw (err);
>> -      if (err == PCSC_E_NO_SMARTCARD)
>> +      if (err == PCSC_E_NO_SMARTCARD || err == PCSC_E_UNKNOWN_READER)
>>          return sw;
>>        goto command_failed;
>>      }
> 
> It seems that I have found an issue for this change.
> 
> Today, I need to test two Gnuk Tokens, and I tried your patched version
> of scdaemon.  The tokens are:
> 
> 	(A) STM8S Discovery Kit
> 
> 	(B) CQ STARM
> 
> When I insert (A) and use it, then remove it and insert (B).
> 
> It doesn't work.  Here is the log of scdaemon:
> --------------------
> 2011-01-21 12:41:52 scdaemon[11689] PC/SC RESET failed: unknown reader (0x80100009)
> 2011-01-21 12:41:52 scdaemon[11689] DBG: send apdu: c=00 i=A4 p1=00 p2=0C lc=2 le=-1 em=0
> 2011-01-21 12:41:52 scdaemon[11689] PC/SC RESET failed: unknown reader (0x80100009)
> 2011-01-21 12:41:52 scdaemon[11689] apdu_send_simple(0) failed: no reader
> --------------------
> 
> Removing (B) and inserting (A) again, it works.
> 
> But I have no way to use (B) any more without killing scdaemon, and leting gpg-agent
> learn for (B) to use (B).  But this time, I have no way to use back to (A)...

I just want to confirm, did this work before?  Some parts of the code
seem to be able to handle multiple readers.  Other parts seem to say we
can really only use one reader.  I just want to make sure this is a new
error.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNOQa1AAoJEP5F5V2hilTWDeEIAIa8MEnRfP/13NEaSHQFZHt8
tR271kB7dE/PVq5kdUUNiZVe8/ZnOmlw+8GaF9M2yPSFDJRSCCbz+zJzPQKn0yFd
zxM4wtjv1No7IImHoxuPvieM7JmvP50E14rVELpSGmkraQ0VZIjf4dqryIGow+qh
m6c/obSLKKbiePlZ6pBFtgNaEmwDeeZZW/bjbdKGTIL0wPcA/zw9Euuz9fLTadbf
fiRiVnRtH4MnDJgZtn3NNvlRXKCDgqcpsXxBCxoYhYLd6m6xfNOB76G1HRyGT97E
tO7WWf8yc9Os2Roo7IiOqEYTmO8muT2TNRmiECnx0pE8bifrnzXx3VE4RuIrb5Q=
=LEve
-----END PGP SIGNATURE-----



More information about the Gnupg-devel mailing list