Open YaroKasear opened 9 months ago
I just ran into this issue for the first time today after updating nixos-unstable
. The last time I updated was a couple weeks ago, which is strange considering this issue was reported in February.
@YaroKasear did you ever end up finding a resolution or workaround for this?
Edit: For context, I am running GNOME Desktop.
Edit 2: Here's what I get when I try to sign a commit with pinentry-gnome3
:
May 05 18:49:02 tuvok gpg-agent[8519]: failed to read the secret key
May 05 18:49:02 tuvok gpg-agent[8519]: command 'PKSIGN' failed: Operation cancelled <Pinentry>
May 05 18:49:06 tuvok gpg-agent[8521]: scdaemon[8521]: pcsc_establish_context failed: internal error (0x80100001)
May 05 18:49:06 tuvok syncthing[2068]: [NZ7H6] INFO: Sent usage report (version 3)
May 05 18:49:07 tuvok gpg-agent[8521]: scdaemon[8521]: pcsc_establish_context failed: internal error (0x80100001)
May 05 18:49:08 tuvok gpg-agent[8521]: scdaemon[8521]: pcsc_establish_context failed: internal error (0x80100001)
May 05 18:49:10 tuvok gpg-agent[8521]: scdaemon[8521]: pcsc_establish_context failed: internal error (0x80100001)
May 05 18:49:11 tuvok gpg-agent[8519]: failed to read the secret key
May 05 18:49:11 tuvok gpg-agent[8519]: command 'PKSIGN' failed: Operation cancelled <Pinentry>
After upgrading yesterday, I had the same issue as @montchr. I believe this is a different issue than @YaroKasear's.
Some symptoms:
gpg --card-status
shows Service is not running
. Afterwards, the journal has this error scdaemon[…]: scdaemon[3810]: pcsc_establish_context failed: internal error (0x80100001)
.Rolling back my flake updates fixed the issue. After checking my lock file, it seems that the issue has been introduced some time after commit 63c3a29ca82437c87573e4c6919b09a24ea61b0f.
This should be fixed by #308884
The fix is still in staging next, so if you can not wait that long and are willing to rebuild quite a few packages, this overlay should work:
final: prev:
{
pcsclite = prev.pcsclite.overrideAttrs (old: {
postPatch = ''
substituteInPlace src/libredirect.c src/spy/libpcscspy.c \
--replace-fail "libpcsclite_real.so.1" "$lib/lib/libpcsclite_real.so.1"
'';
});
}
I was also running into the same problem with the latest unstable.
It seems like there were no polkit rules for pcsc-lite at /run/current-system/sw/share/polkit-1/rules.d/
.
Adding these, albeit very liberal, rules resolved the issue for me.
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (action.id == "org.debian.pcsc-lite.access_card") {
return polkit.Result.YES;
}
});
polkit.addRule(function(action, subject) {
if (action.id == "org.debian.pcsc-lite.access_pcsc") {
return polkit.Result.YES;
}
});
'';
I don't know whether this is related (I use Fedora) but today I wanted to use gpg with Yubikey and "gpg2 --card-status" did not find a smart card although the Yubikey was plugged and visible with "lsusb". A reboot of my PC did not fix it.
I found these lines with "systemctl status pcscd" and restarted the daemon. After this the card was found.
Nov 30 15:08:01 bat.localdomain systemd[1]: Started pcscd.service - PC/SC Smart Card Daemon.
Nov 30 15:08:01 bat.localdomain (pcscd)[2481]: pcscd.service: Referenced but unset environment variable evaluates to an empty string: PCSCD_ARGS
Nov 30 15:08:23 bat.localdomain pcscd[2481]: 00000000 ../src/auth.c:145:IsClientAuthorized() Process 2605 (user: 987) is NOT authorized for action: access_pcsc
Nov 30 15:08:23 bat.localdomain pcscd[2481]: 00000096 ../src/winscard_svc.c:357:ContextThread() Rejected unauthorized PC/SC client
This means I have to restart this daemon first before I can use gpg with Yubikey.
OS: Fedora 41 Silverblue version: pcsc-lite-2.3.0-1.fc41.x86_64
Describe the bug
Since updating nixpkgs-unstable this morning my Yubikey stopped working again with gpg.
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Being asked for my PIN and unlocking things using pcscd gpg-agent stuff.
Additional context
It keeps asking me to insert my Yubikey despite being present.
Running
gpg --card-status
returns the following:Checking the status for pcscd gives me:
Most telling here is the "NOT authorized for action" part. This looks like an issue that might have been resolved in nixpkgs previously.
https://github.com/NixOS/nixpkgs/issues/280826
I didn't see anything about PolicyKit, though, so not sure this is the same issue.
Notify maintainers
@anthonyroussel
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.