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

ykls panics when a non-YubiKey smartcard reader is present #38

Open
nbraud opened this issue Nov 30, 2020 · 2 comments
Open

ykls panics when a non-YubiKey smartcard reader is present #38

nbraud opened this issue Nov 30, 2020 · 2 comments

Comments

@nbraud
Copy link
Contributor

nbraud commented Nov 30, 2020

The following occurs if I run ykls while my laptop's ExpressCard smartcard reader is in:

$ dpkg -x /opt/deb/buildarea/golang-pault-go-ykpiv-dev_1.3.2-1_amd64.deb .
$ ./usr/bin/ykls --help
Reader:  Gemalto GemPC Express 00 00
panic: ykpiv ykpiv_connect: PKCS Error (-2) - Error in PCSC call

goroutine 1 [running]:
main.ohshit(...)
	pault.ag/go/ykpiv/cmd/ykls/ykls.go:31
main.main()
	pault.ag/go/ykpiv/cmd/ykls/ykls.go:44 +0x7cd

After removing the reader:

$ ./usr/bin/ykls 
Reader:  Yubico YubiKey FIDO+CCID 00 00
Version: 4.3.7
Serial:  6447364
Slot Authentication (9a): [email protected]
@LudovicRousseau
Copy link

I have the same problem and in my case the PC/SC reader is also my main keyboard. So I can't disconnect it.

$ ykls
Reader:  Cherry GmbH CHERRY SECURE BOARD 1.0 [CHERRY SECURE BOARD 1.0] (00000002JS0405948M3DOGKTHA) 00 00
panic: ykpiv ykpiv_connect: PKCS Error (-2) - Error in PCSC call

goroutine 1 [running]:
main.ohshit(...)
	pault.ag/go/ykpiv/cmd/ykls/ykls.go:31
main.main()
	pault.ag/go/ykpiv/cmd/ykls/ykls.go:44 +0x7cd

One workaround is to use PCSCLITE_FILTER_IGNORE_READER_NAMES= as documented in https://ludovicrousseau.blogspot.com/2015/12/remove-andor-customize-pcsc-reader-names.html

$ sudo PCSCLITE_FILTER_IGNORE_READER_NAMES=Cherry pcscd
$ ykls
Reader:  Yubico YubiKey OTP+FIDO+CCID 00 00
Version: 5.1.2
Serial:  9718408

A correct fix would be to ignore a PC/SC reader that do not contain a Yubikey and continue with the next reader in the list.
I guess the problem is this line https://github.com/go-piv/go-ykpiv/blob/master/cmd/ykls/ykls.go#L44

@LudovicRousseau
Copy link

I was about the report, again, the same bug.
But I see it is a known issue since more than 2 years. And nothing happened.
It looks like it is a dead project :-(

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

2 participants