Mon, Nov 18
In select_application function, we can minimize the holding W-lock.
This may requires major changes for scdaemon.
For the cancelling operation, each card reader access should have an independent resource manager context.
Currently, a single pcsc.contex is shared by all reader accesses.
Hard lockup should be avoided. In particular, following conditions should meet:
- gpgconf --kill scdaemon can kill scdaemon
- KEYINFO requests can be answered for other connections of scdaemon
As of 2024-11-18, my hypothesis is:
- there are some sort of race conditions between PC/SC + card reader (or its driver) + smartcard + scdaemon on Windows, at least at initial use after boot
- because of this, SCardConnect of PC/SC call wrongly fails (somehow confirmed by @ebo's experiments + @gniibe's speculation), or wrongly never returns (@gniibe's guess, side info: its slowness is observed in T7400).
@ebo Thank you for your testing.
Sat, Nov 16
@ikloecker indeed we try only for 5 seconds:
Fri, Nov 15
I think that the card reader is not connected and there is no Scardsvr at this time.
And the card reader connection to USB port results invoking Scardsvr. Then, "SCD SERIALNO --all" gets success.
For T6567 I changed the way that Kleopatra runs "gpgconf --launch gpg-agent". This change is not yet in Eva's test build. It seems my change is not good because running "gpgconf --launch gpg-agent" timed out after 5 seconds in 3 of 3 tests starting Kleopatra after a reboot of the VM. To check if "gpgconf --launch gpg-agent" really takes that long I measured the time in PowerShell after another reboot of the VM. The result is shocking.
Please note that a card insertion to a card reader and a card reader connection to PC are different things.
It may cause different results.
ebo: Thank you for your testing.
Thu, Nov 14
I believe this is a case of non-consumption of client, I had two cards connected, one Yubikey and one Netkey3.0 card.
Setup: I rebooted windows and started Kleopatra. Nothing else.
I put "scd" tag and let me claim this ticket.
Wed, Nov 13
FWIW, we should eventually get rid of the pipe + socket style connection model. It is just to complex with no real benefit.
After fixing two bugs, I changed the title to express the scope of this ticket.
Wed, Nov 6
I found a problem of possible duplicate registration of another APP, due to no serialization for CARD access.
The resource leak was fixed in: rG40707c8bff49: agent: Fix resource leak for PRIMARY_CTX.
Tue, Nov 5
Tue, Oct 29
You should use gpg-agent's integrated ssh-agent. It is anyway much more convenient. I'll move this task to gnupg26, though.
Oct 21 2024
I found fd resource leak in gpg-agent.
- gpg-connect-agent "scd killscd" /bye seems not release a file descriptor somewhere
Oct 10 2024
Oct 9 2024
But the DEVINFO --watch is required to trigger this hang? Kleopatra does not use this but we see simlar hangs from time to time in the current version.
Oct 4 2024
Porting to 2.2 was straightforward - we won't give it an extra QA run.
Oct 1 2024
Fixed in master: rGe7891225788a: gpg: Robust error handling for SCD READKEY.
Sep 30 2024
Some would say it is a bug if keys are not shown - even if the algo is not known ;-)
scdaemon in this case was a broken experiment of mine (trying to see if I can get SoftHSM to work as the OpenPGP card). So this was not a normal, released scdaemon code.
Sep 28 2024
Please send an excerpt from the scdaemon debug output to evaluate why you get somewhat strange looking data. Is this an experimental card? 0xa5 is a common test pattern.
Sep 27 2024
With no scd-event script, it might improve the situation