Mailing List Archive

MS Surface Go Sim Card appears to cause scdaemon crash
It looks like scdaemon is crashing when attempting to access a sim card
slot/sim card itself on my Surface Go. When looking at the scdaemon.conf
file there is the option to define a specific reader-port, but I couldn't
find a way to ignore specific readers. Am I missing something, or is this
not an option currently? Any other suggestions as to prevent this crash
without disabling the Mobile Broadband card?

*With the device enabled:*

PS C:\Users\derek> gpg --card-status
gpg: selecting card failed: End of file
gpg: OpenPGP card not available: End of file
---
2021-08-19 12:02:19 scdaemon[9544.1] DBG: chdir to '/tmp' failed: No such
file or directory
2021-08-19 12:02:19 scdaemon[9544.1] listening on socket
'C:\\Users\\derek\\AppData\\Roaming\\gnupg\\S.scdaemon'
2021-08-19 12:02:19 scdaemon[9544.2] handler for fd -1 started
2021-08-19 12:02:19 scdaemon[9544.2] DBG: chan_0x000002d4 -> OK GNU Privacy
Guard's Smartcard server ready
2021-08-19 12:02:19 scdaemon[9544.2] DBG: chan_0x000002d4 <- GETINFO
socket_name
2021-08-19 12:02:19 scdaemon[9544.2] DBG: chan_0x000002d4 -> D
C:\Users\derek\AppData\Roaming\gnupg\S.scdaemon
2021-08-19 12:02:19 scdaemon[9544.2] DBG: chan_0x000002d4 -> OK
2021-08-19 12:02:19 scdaemon[9544.2] DBG: chan_0x000002d4 <- OPTION
event-signal=290
2021-08-19 12:02:19 scdaemon[9544.2] DBG: chan_0x000002d4 -> OK
2021-08-19 12:02:19 scdaemon[9544.2] DBG: chan_0x000002d4 <- GETINFO version
2021-08-19 12:02:19 scdaemon[9544.2] DBG: chan_0x000002d4 -> D 2.3.1
2021-08-19 12:02:19 scdaemon[9544.2] DBG: chan_0x000002d4 -> OK
2021-08-19 12:02:19 scdaemon[9544.2] DBG: chan_0x000002d4 <- SERIALNO
2021-08-19 12:02:19 scdaemon[9544.2] detected reader 'Microsoft IFD 0'
*2021-08-19 12:02:19 scdaemon[9544.2] detected reader 'Microsoft UICC ISO
Reader 4fc9c139 0'*
2021-08-19 12:02:19 scdaemon[9544.2] DBG: apdu_open_reader: Microsoft IFD 0
2021-08-19 12:02:19 scdaemon[9544.2] DBG: apdu_open_reader: new
device=Microsoft IFD 0
2021-08-19 12:02:19 scdaemon[9544.2] reader slot 0: not connected
2021-08-19 12:02:19 scdaemon[9544.2] DBG: enter: apdu_connect: slot=0
2021-08-19 12:02:19 scdaemon[9544.2] pcsc_connect failed: removed card
(0x80100069)
2021-08-19 12:02:19 scdaemon[9544.2] reader slot 0: not connected
2021-08-19 12:02:19 scdaemon[9544.2] DBG: leave: apdu_connect => sw=0x10008
2021-08-19 12:02:19 scdaemon[9544.2] DBG: chan_0x000002d4 -> S PINCACHE_PUT
0//
2021-08-19 12:02:19 scdaemon[9544.2] DBG: enter: apdu_close_reader: slot=0
2021-08-19 12:02:19 scdaemon[9544.2] DBG: enter: apdu_disconnect: slot=0
2021-08-19 12:02:19 scdaemon[9544.2] DBG: leave: apdu_disconnect => sw=0x0
2021-08-19 12:02:19 scdaemon[9544.2] DBG: leave: apdu_close_reader => 0x0
(close_reader)


*2021-08-19 12:02:19 scdaemon[9544.2] DBG: apdu_open_reader:
(null)2021-08-19 12:02:19 scdaemon[9544.2] DBG: apdu_open_reader: new
device=(null)*
-------

*With the device disabled in device manager:*

PS C:\Users\derek> gpg --card-status
gpg: selecting card failed: No such device
gpg: OpenPGP card not available: No such device
---
2021-08-19 12:14:20 scdaemon[7468.1] DBG: chdir to '/tmp' failed: No such
file or directory
2021-08-19 12:14:20 scdaemon[7468.1] listening on socket
'C:\\Users\\derek\\AppData\\Roaming\\gnupg\\S.scdaemon'
2021-08-19 12:14:20 scdaemon[7468.2] handler for fd -1 started
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 -> OK GNU Privacy
Guard's Smartcard server ready
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 <- GETINFO
socket_name
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 -> D
C:\Users\derek\AppData\Roaming\gnupg\S.scdaemon
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 -> OK
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 <- OPTION
event-signal=290
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 -> OK
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 <- GETINFO version
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 -> D 2.3.1
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 -> OK
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 <- SERIALNO
2021-08-19 12:14:20 scdaemon[7468.2] detected reader 'Microsoft IFD 0'
2021-08-19 12:14:20 scdaemon[7468.2] DBG: apdu_open_reader: Microsoft IFD 0
2021-08-19 12:14:20 scdaemon[7468.2] DBG: apdu_open_reader: new
device=Microsoft IFD 0
2021-08-19 12:14:20 scdaemon[7468.2] reader slot 0: not connected
2021-08-19 12:14:20 scdaemon[7468.2] DBG: enter: apdu_connect: slot=0
2021-08-19 12:14:20 scdaemon[7468.2] pcsc_connect failed: removed card
(0x80100069)
2021-08-19 12:14:20 scdaemon[7468.2] reader slot 0: not connected
2021-08-19 12:14:20 scdaemon[7468.2] DBG: leave: apdu_connect => sw=0x10008
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 -> S PINCACHE_PUT
0//
2021-08-19 12:14:20 scdaemon[7468.2] DBG: enter: apdu_close_reader: slot=0
2021-08-19 12:14:20 scdaemon[7468.2] DBG: enter: apdu_disconnect: slot=0
2021-08-19 12:14:20 scdaemon[7468.2] DBG: leave: apdu_disconnect => sw=0x0
2021-08-19 12:14:20 scdaemon[7468.2] DBG: leave: apdu_close_reader => 0x0
(close_reader)
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 -> ERR 100696144
No such device <SCD>
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 <- RESTART
2021-08-19 12:14:20 scdaemon[7468.2] DBG: chan_0x000002d0 -> OK


*Version info:*
gpg --version
gpg (GnuPG) 2.3.1
libgcrypt 1.9.3

scdaemon --version
scdaemon (GnuPG) 2.3.1
libgcrypt 1.9.3
libksba 1.5.1

--
- Derek C Hoffmann
Re: MS Surface Go Sim Card appears to cause scdaemon crash [ In reply to ]
Hello,

Derek C Hoffmann via Gnupg-users <gnupg-users@gnupg.org> wrote:
> It looks like scdaemon is crashing when attempting to access a sim card
> slot/sim card itself on my Surface Go.

It is my fault. I added multiple card readers support (for PC/SC) to
GnuPG 2.3, and it causes an issue in your use case. By default,
scdaemon tries to access all available card readers. It has a bug
accessing the second reader when the first reader doesn't have a card.

Related bug is tracked at:

https://dev.gnupg.org/T5416

And it will be fixed in GnuPG 2.3.2.

> Any other suggestions as to prevent this crash without disabling the
> Mobile Broadband card?

If you have a line in scdaemon.conf, like:

reader-port Microsoft IFD 0

scdaemon will only access to the card reader. Please try this, until
fixed version will be released.
--

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: MS Surface Go Sim Card appears to cause scdaemon crash [ In reply to ]
Thanks, good to know that it's a known issue and being worked on, looking
forward to the next update!

Just FYI though, the indicated workaround doesn't seem to work unless the
intended card reader for gpg is listed first:

I have another system I just started working on which needs two different
smart cards (Gemalto eToken Pro for work, and yubikey for personal use,
which is what I use with gpg). The gemalto card readers are listed first,
and even putting various versions of 'reader-port Yubico YubiKey
OTP+FIDO+CCID 0', 'reader-port Yubico YubiKey', 'reader-port Yubico Yubi'
in scdaemon.conf result in the same behaviour.

2021-08-21 09:53:11 scdaemon[16820.1] DBG: chdir to '/tmp' failed: No such
file or directory
2021-08-21 09:53:11 scdaemon[16820.1] listening on socket
'C:\\Users\\derek\\AppData\\Roaming\\gnupg\\S.scdaemon'
2021-08-21 09:53:11 scdaemon[16820.2] handler for fd -1 started
2021-08-21 09:53:11 scdaemon[16820.2] DBG: chan_0x000002e0 -> OK GNU
Privacy Guard's Smartcard server ready
2021-08-21 09:53:11 scdaemon[16820.2] DBG: chan_0x000002e0 <- GETINFO
socket_name
2021-08-21 09:53:11 scdaemon[16820.2] DBG: chan_0x000002e0 -> D
C:\Users\derek\AppData\Roaming\gnupg\S.scdaemon
2021-08-21 09:53:11 scdaemon[16820.2] DBG: chan_0x000002e0 -> OK
2021-08-21 09:53:11 scdaemon[16820.2] DBG: chan_0x000002e0 <- OPTION
event-signal=2bc
2021-08-21 09:53:11 scdaemon[16820.2] DBG: chan_0x000002e0 -> OK
2021-08-21 09:53:11 scdaemon[16820.2] DBG: chan_0x000002e0 <- GETINFO
version
2021-08-21 09:53:11 scdaemon[16820.2] DBG: chan_0x000002e0 -> D 2.3.1
2021-08-21 09:53:11 scdaemon[16820.2] DBG: chan_0x000002e0 -> OK
2021-08-21 09:53:11 scdaemon[16820.2] DBG: chan_0x000002e0 <- SERIALNO
2021-08-21 09:53:11 scdaemon[16820.2] detected reader 'AKS ifdh 0'
2021-08-21 09:53:11 scdaemon[16820.2] detected reader 'AKS ifdh 1'
2021-08-21 09:53:11 scdaemon[16820.2] detected reader 'Yubico YubiKey
OTP+FIDO+CCID 0'
2021-08-21 09:53:11 scdaemon[16820.2] DBG: apdu_open_reader: AKS ifdh 0
2021-08-21 09:53:11 scdaemon[16820.2] DBG: apdu_open_reader: new device=AKS
ifdh 0
2021-08-21 09:53:11 scdaemon[16820.2] reader slot 0: not connected
2021-08-21 09:53:11 scdaemon[16820.2] DBG: enter: apdu_connect: slot=0
2021-08-21 09:53:11 scdaemon[16820.2] pcsc_connect failed: removed card
(0x80100069)
2021-08-21 09:53:11 scdaemon[16820.2] reader slot 0: not connected
2021-08-21 09:53:11 scdaemon[16820.2] DBG: leave: apdu_connect => sw=0x10008
2021-08-21 09:53:11 scdaemon[16820.2] DBG: chan_0x000002e0 -> S
PINCACHE_PUT 0//
2021-08-21 09:53:11 scdaemon[16820.2] DBG: enter: apdu_close_reader: slot=0
2021-08-21 09:53:11 scdaemon[16820.2] DBG: enter: apdu_disconnect: slot=0
2021-08-21 09:53:11 scdaemon[16820.2] DBG: leave: apdu_disconnect => sw=0x0
2021-08-21 09:53:11 scdaemon[16820.2] DBG: leave: apdu_close_reader => 0x0
(close_reader)
2021-08-21 09:53:11 scdaemon[16820.2] DBG: apdu_open_reader: (null)
2021-08-21 09:53:11 scdaemon[16820.2] DBG: apdu_open_reader: new
device=(null)


For now I've fallen back to 2.2

--
Derek C Hoffmann


On Fri, Aug 20, 2021 at 2:48 AM NIIBE Yutaka <gniibe@fsij.org> wrote:

> Hello,
>
> Derek C Hoffmann via Gnupg-users <gnupg-users@gnupg.org> wrote:
> > It looks like scdaemon is crashing when attempting to access a sim card
> > slot/sim card itself on my Surface Go.
>
> It is my fault. I added multiple card readers support (for PC/SC) to
> GnuPG 2.3, and it causes an issue in your use case. By default,
> scdaemon tries to access all available card readers. It has a bug
> accessing the second reader when the first reader doesn't have a card.
>
> Related bug is tracked at:
>
> https://dev.gnupg.org/T5416
>
> And it will be fixed in GnuPG 2.3.2.
>
> > Any other suggestions as to prevent this crash without disabling the
> > Mobile Broadband card?
>
> If you have a line in scdaemon.conf, like:
>
> reader-port Microsoft IFD 0
>
> scdaemon will only access to the card reader. Please try this, until
> fixed version will be released.
> --
>