Wed, Apr 1
Great spotting! This was it. Quite embarrassing that I've looked at this code so many time yet it didn't cross my mind to double check arguments order.
@jpalus You are right.
computed by ssh_signature_encoder_rsa, including additional 0, reach:
Tue, Mar 31
Note that exactly same data and length computed by ssh_signature_encoder_rsa, including additional 0, reach:
https://github.com/openssh/openssh-portable/blob/V_10_2_P1/sshkey.c#L517-L537
Let's see whether Niibe-san still remembers the T7882 case.
Added to some debug logging and whenever login issue occurs new logic is applied:
https://github.com/gpg/gnupg/blob/bc7c91bee521e4adf3506ca32bf34177b84ce1c5/agent/command-ssh.c#L1482
Looks like indeed related to T7882. After reverting c7e0ec12609b401ea81c4851522d86eb5ec27170 I was able to make 2000 connections without any issue. Bringing the change back and retrying issue appeared within first 300.
I've already tried with verbose which gave no errors. That's why I moved to debug logging. With double verbose I don't see anything wrong either. Excerpt from log for relevant 100 connections among which 1 failed:
$ cat gpg.log | sed 's/.*gpg-agent\[[0-9]*\] //' | # remove date, time and process id grep -v 'ssh handler .* \(started\|terminated\)' | # appears to be mostly noise wit hex address sort|uniq -c 80 new connection to /usr/libexec/gnupg2/scdaemon daemon established 20 new connection to /usr/libexec/gnupg2/scdaemon daemon established (reusing) 100 received ssh request of length 1 100 received ssh request of length 208 100 received ssh request of length 748 100 sending ssh response of length 1 100 sending ssh response of length 281 100 sending ssh response of length 626 100 ssh request handler for extension (27) ready 100 ssh request handler for extension (27) started 100 ssh request handler for request_identities (11) ready 100 ssh request handler for request_identities (11) started 100 ssh request handler for sign_request (13) ready 100 ssh request handler for sign_request (13) started 100 ssh-agent extension 'session-bind@openssh.com' not supported 100 ssh-agent extension 'session-bind@openssh.com' received
You need to get a log form gpg-agent. Put this into ~/.gnupg/gpg-agent/conf
Jan 6 2026
Frankly, he OpenSSH support for Windows was experimental and I have never tested it. If it can be confirmed that this really works and is useful, it will be easy to add the opeion to gpgconf.
Frankly, he OpenSSH support for Windows was experimental and I have never tested it. If it can be confirmed that this really works and is useful, it will be easy to add the opeion to gpgconf. Note that the gpgconf option feature handles only a subset of all options on purpose.
Nov 19 2025
Nov 6 2025
Jul 17 2025
Jun 5 2025
The problem was: In scdaemon, PKSIGN with OPENPGP.3 didn't work well for Ed25519 (done by do_auth function in app-openpgp.c), when --hash=sha512 (not SHA1).
Jun 4 2025
I located the bug in scdaemon.
Jun 2 2025
May 14 2025
Using the primary key for ssh was not intended and thus not tested. I have not yet found the time too look closer at your report. Just one remark:
May 2 2025
Feb 5 2025
Thanks for that info. I tag it as FAQ and change the subject in case someone searches for such a problem.
Jan 10 2025
Fixed in 2.5.2.
Dec 6 2024
Dec 5 2024
Dec 3 2024
Dec 2 2024
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.
Mar 4 2024
In case if someone finds it through a search:
Feb 21 2024
Closing due to age and because gpg4win 4 started to using the much improved GnuPG 2.4
Jan 5 2024
Oct 16 2023
Oct 10 2023
Sep 26 2023
Here's another data point.
Aug 28 2023
May 26 2023
Apr 26 2023
Apr 18 2023
Feb 1 2023
See the the commit for a description of the changes.
@MathiasMagnus This change is to support Win32-OpenSSH by gpg-agent emulation of ssh-agent; You can use gpg-agent emulation of ssh-agent when you use Win32-OpenSSH. That is, you can use GPG auth subkey for Win32-OpenSSH.
Jan 31 2023
@gniibe Am I misunderstanding something? I thought that with this change one is able to connect from a Windows box to a Linux box and have GPG agent forwarding work. I am still hitting pretty much the same issue described here: https://github.com/PowerShell/Win32-OpenSSH/issues/1564
On my Windows endpoint I'm running gpg.exe version 2.4.0.49237 and in C:\Users\mate\AppData\Roaming\gnupg\gpg-agent.conf I have a single line enable-win32-openssh-support. Running gpg-connect-agent.exe reloadagent /bye I have a gpg-agent running. Get-Process gpg-agent shows that it's running. In my Windows env I have SSH_AUTH_SOCK set to \\.\pipe\openssh-ssh-agent and my Linux endpoint is configured in SSH config with
ForwardAgent yes AddKeysToAgent yes RemoteForward /run/user/1015/gnupg/S.gpg-agent C\:/Users/mate/AppData/Local/gnupg/S.gpg-agent.extra
As the remote end reports /run/user/1015/gnupg/S.gpg-agent that socket for agent-socket when issuing gpgconf --list-dirs and my local gpgconfg.exe --list-dirs reports C%3a\Users\mate\AppData\Local\gnupg\S.gpg-agent.extra where I transform %3a to \: manually. SSH authentication works perfectly, when connecting pinentry-qt pops up to unlock my key and when connecting to yet another machine, my SSH agent is forwarded again. However, gpg fails to use my agent. Issuing gpg --list-secret-keys --verbose prints the following to the console:
gpg --list-secret-keys --verbose gpg: using pgp trust model getsockopt SO_ERROR failed connect_to C:/Users/mate/AppData/Local/gnupg/S.gpg-agent.extra port -2: failed. gpg: no running gpg-agent - starting '/usr/bin/gpg-agent' getsockopt SO_ERROR failed connect_to C:/Users/mate/AppData/Local/gnupg/S.gpg-agent.extra port -2: failed. gpg: waiting for the agent to come up ... (5s) getsockopt SO_ERROR failed connect_to C:/Users/mate/AppData/Local/gnupg/S.gpg-agent.extra port -2: failed. getsockopt SO_ERROR failed connect_to C:/Users/mate/AppData/Local/gnupg/S.gpg-agent.extra port -2: failed. getsockopt SO_ERROR failed connect_to C:/Users/mate/AppData/Local/gnupg/S.gpg-agent.extra port -2: failed. getsockopt SO_ERROR failed connect_to C:/Users/mate/AppData/Local/gnupg/S.gpg-agent.extra port -2: failed. getsockopt SO_ERROR failed connect_to C:/Users/mate/AppData/Local/gnupg/S.gpg-agent.extra port -2: failed. getsockopt SO_ERROR failed connect_to C:/Users/mate/AppData/Local/gnupg/S.gpg-agent.extra port -2: failed. gpg: waiting for the agent to come up ... (4s) gpg: waiting for the agent to come up ... (3s) gpg: waiting for the agent to come up ... (2s) gpg: waiting for the agent to come up ... (1s) gpg: can't connect to the agent: End of file
What is missing to tie the knot on both ends without having to resort to 3rd party tools like @rupor-github 's agent-gui? The remote gpg version is 2.2.19, is that the issue? Must that also be 2.3.9+?
Jan 24 2023
Let's first collect all keys, assign a priority, sort, and only then send them back to ssh.
