sciber-io / yubikey-locker

Sciber Yubikey Locker
MIT License
2 stars 1 forks source link

[macOS] Yklocker locks access to Yubikey, when verifying it is connected #78

Open stefan-ivarsson-sciber opened 6 months ago

stefan-ivarsson-sciber commented 6 months ago

At the very moment Yklocker checks if the Yubikey is still connected there is a slight possibility for an access issue. For instance when using gpg-agent to sign git commits, should the access to the key happen simultaneous you may experience the following error message.

gpg: signing failed: Bad file descriptor
gpg: [stdin]: clear-sign failed: Bad file descriptor

A similar error message may happen when the gpg-agent is used in order to use the Yubikey as SSH key storage

sign_and_send_pubkey: signing failed for RSA "cardno:00 000 000" from agent: agent refused operation
sign_and_send_pubkey: signing failed for RSA "(none)" from agent: agent refused operation

Both issues are dependent on timing and repeated tries usually allow you to use the key as intended at some point, when the Yubikey is available for use.