Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpg: selecting card failed: No such device #1

Open
axieum opened this issue Nov 25, 2022 · 5 comments
Open

gpg: selecting card failed: No such device #1

axieum opened this issue Nov 25, 2022 · 5 comments

Comments

@axieum
Copy link

axieum commented Nov 25, 2022

Hi,

Thank you so much for this package, super simple to set up with the provided wsl-gap.ssh bootstrap script! 🙌

I've got the ssh-add -l working, it successfully lists my authentication key from my YubiKey. However, the gpg --card-status displays -

image

wsl-gap.exe.log

01:59:24 [ INFO] data_dir() -> "C:\\Users\\jonathan\\AppData\\Roaming"
01:59:24 [ INFO] find gpg-agent
01:59:24 [ INFO] start ssh-proxy
01:59:24 [ INFO] request read from stdin, length: 5
01:59:24 [ INFO] request: [0, 0, 0, 1, 11]
01:59:24 [ INFO] agent_query
01:59:24 [ INFO] response received, length: 85
01:59:24 [ INFO] response written
01:59:24 [ INFO] request read from stdin, length: 0
01:59:24 [ INFO] request: []
01:59:24 [ INFO] done

Windows Version Info

PS C:\Users\jonathan> ssh -V
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
PS C:\Users\jonathan> gpg --version
gpg (GnuPG) 2.3.8
libgcrypt 1.10.1
Copyright (C) 2021 g10 Code GmbH
License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: C:\Users\jonathan\AppData\Roaming\gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
AEAD: EAX, OCB
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
PS C:\Users\jonathan> gpgconf
gpg:OpenPGP:C%3a\Program Files (x86)\GnuPG\bin\gpg.exe
gpgsm:S/MIME:C%3a\Program Files (x86)\GnuPG\bin\gpgsm.exe
keyboxd:Public Keys:C%3a\Program Files (x86)\GnuPG\bin\keyboxd.exe
gpg-agent:Private Keys:C%3a\Program Files (x86)\GnuPG\bin\gpg-agent.exe
scdaemon:Smartcards:C%3a\Program Files (x86)\GnuPG\bin\scdaemon.exe
dirmngr:Network:C%3a\Program Files (x86)\GnuPG\bin\dirmngr.exe
pinentry:Passphrase Entry:C%3a\Program Files (x86)\GnuPG\..\Gpg4win\bin\pinentry.exe

image

WSL Version Info

[jonathan@Adair ~]$ ssh -V
OpenSSH_9.1p1, OpenSSL 3.0.7 1 Nov 2022
[jonathan@Adair ~]$ gpg --version
gpg (GnuPG) 2.2.40
libgcrypt 1.10.1-unknown
Copyright (C) 2022 g10 Code GmbH
License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /home/jonathan/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
[jonathan@Adair ~]$ gpgconf
gpg:OpenPGP:/usr/bin/gpg
gpgsm:S/MIME:/usr/bin/gpgsm
gpg-agent:Private Keys:/usr/bin/gpg-agent
scdaemon:Smartcards:/usr/lib/gnupg/scdaemon
dirmngr:Network:/usr/bin/dirmngr
pinentry:Passphrase Entry:/usr/bin/pinentry
@axieum
Copy link
Author

axieum commented Nov 25, 2022

It seems the SSH works in WSL but not on Windows, and the GPG works on Windows but not on WSL 😕

@carlolars
Copy link
Owner

Hi @axieum!

I tried the gpg commands in WSL2 and none of them works for me anymore 😞 I'll see if I can squeeze in some debug-time and try to find the root cause.

@axieum
Copy link
Author

axieum commented Nov 28, 2022

I ended up at this comment which uses socat to launch a new jstarks/npiperelay process for a named pipe. I'm not sure if this is of any help to you.

I managed to get ssh-add -l working on the Windows side (on the native Windows OpenSSH client) by following this step of a seemingly abandoned project: benpye/wsl-ssh-pageant#how-to-use-with-windows-10-native-openssh-client. I wonder if we can fit this into this project also, so we can use ssh-add -l on the Windows side. 🤔

@lucasfcnunes
Copy link

Hi @axieum!

I tried the gpg commands in WSL2 and none of them works for me anymore 😞 I'll see if I can squeeze in some debug-time and try to find the root cause.

@carlolars that's what I'm facing right now. 😢

@lucasfcnunes
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants