Looks good to me on gpg4win-5.0.2-beta2 @ win11:
- first manual gpg -K and gpgsm -K displays the correct output now
- the loop ran without a hang for 50 times
Looks good to me on gpg4win-5.0.2-beta2 @ win11:
I found that it's not that simple to accept the case of no newline at the end.
Because we need to handle the edge case where no newline occurs at the maximum buffer length, too.
It's something like the following.
I found two issues in libgpg-error for spawning functions.
Oh yeah, the mentioned patch is bogus because it assumes that fgets has already set the eof flag while reading the last line. This seems not to be the case.
I added the gpgsm log output in the description (same error as in the gpg log)
To reproduce the hang, a loop will suffice (usually happens within the first 15 times, once it needed 50 runs):
I have this fix committed to my working directory:
We have no CVE yet. However, CVE is also a good tag for security bugs,
On 2026-01-20, I found the message to security@gnupg.org of:
Message-ID: 4e708880-04ac-45bc-8d16-6b585f2652a1n@aisle.com
in may spam folder. It has a 10MB long attachment. That might be one of reasons to be identified as a spam.
This does not happen any more, tested with Gpg4win-5.0.0-beta479
fix tested and confirmed with GnuPG 2.5.12 on windows 10
i've included logfiles for gpg-agent and scdaemon with debug-level 10. the files include
We will do a new gpg4win beta soon.
@m.eik Could you please enable debug option for gpg-agent and get the log output for the crash?
This was release with 2.5.7.
Thanks, that was the only issue building there.
Please re-open if you find other Cygwin related build problems.
You know that Cygwin is not supported but if that is the only place it should not arm to fix it.
(2) Update the documentation of default-cache-ttl zero value disabling caching.
I am going to do:
(1) Recover old behavior with max-cache-ttl = 0
(2) Update the documentation of default-cache-ttl zero value disabling caching.
I can't see any documentation that a value of 0 disables the cache. The user might have used some undefined behaviour. For example in the old code we did a housecleaning when we were idle but the new code uses a timer and another thread for flushing the cache. We could open a feature request to entire disable the cache but I bet that we will get a lot of new bug reports because users will then need to enter their passphrase too often for one operation.
It's not my intention. I didn't know the feature of disabling caching by max-cache-ttl to 0.
Well, it's a regression if a user intends so.
Lucas Mülling commented yesterday on gnupg-devel:
Here we go:
Alright, my above putenv option won't work because it modifies the session environment and thus needs to be run for each gpg-agent session (connection). Adding a putenv_startrup option would help here but this way each connection could chnage the environment - also not good. In the end a way to modify the used environment variables, as you suggested, is a better way.
Yes, the workaround is to use a pinentry wrapper script that sets the value back to the correct one and then invokes the real pinentry.
Got a simple fix for this which does two things:
In T2169#196673, @werner wrote:Shall we handle this with additional retry prompts, w/o a timeout? I think this makes sense because creating keys with a backup file and a passphrase is a manual task anyway.
There is a regression due to the regression fix in rGb30c15bf7c5336c4abb1f9dcd974cd77ba6c61a7 (from Dec 24 2015) or some related commits:
Closed, since this was documentation for the workaround, four years ago.
Just a reminder: with Gnuk 1.2.15 and an ed25519 key PubkeyAuthentication unbound is required for hosts using the new feature.
Fixed in 2.5.0 and 2.4.6.
Fixed in 2.4.6.
Fixed in master: rGe7891225788a: gpg: Robust error handling for SCD READKEY.
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.
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.
It is reproducible bug even with master branch.
I have a look at the log file of gpg-agent.log. I can see that six PKDECRYPT requests are handled simultaneously. I think that it's out of secure memory to decrypt the private key which results pinentry request.
Found another thinko; When there is no clients with DEVINFO --watch, the pipe to be notified is not consumed at all (no read). It eventually results blocked by write(2), when the pipe is filled.
I see. the systemd race of having two gpg-agent processes. The second gpg-agent should eventually go away but than it is already too late.
I mean: two gpg-agent requests simultaneously running DEVINFO --watch.
Single scdaemon, two threads handling DEVINFO --watch simultaneously, by pselect + read.
Two threads waken up, but it was only one thread which can read(2), another was blocked (before the fix).
You mean it is possible that the initialization function is called by several threads - or that two scdaemon's are running before they realize that one of them is in the way?
I realized that I put a bug on POSIX; When multiple clients do DEVINFO --watch, it is possible for scdaemon to hang (waiting pselect and read, read by one, read by another is blocked).