BlackReloaded/wsl2-ssh-pageant

Stopped working Pageant query error 'WM_COPYDATA failed'

MTRNord opened this issue · 14 comments

Describe the bug
The gpg side of things is working fine. however I keep getting ssh-add -L: connection refused.

in the verbose log I am seeing this:

2021/08/22 22:31:19 Starting exe
2021/08/22 22:31:19 Reading length: 1
2021/08/22 22:31:19 Querying pageant
2021/08/22 22:31:19 Pageant query error 'WM_COPYDATA failed'
2021/08/22 22:31:19 io.ReadFull length error 'EOF

To Reproduce
Steps to reproduce the behavior:
Unsure how. I just installed it normally and ran ssh-add -L

Expected behavior
ssh-add -L should show me my key just like the winssh one does

Desktop (please complete the following information):

  • OS: Windows 11
  • WSL2: Ubuntu Community preview with wslg enabled.

Is your setup to use putty for SSH-Keys?
If yes please see #23 if you're using putty 0.75.

Is your setup to use putty for SSH-Keys?
If yes please see #23 if you're using putty 0.75.

No putty isnt used as far as I know. Only Chance would be a long forgoten install. I will double check that.

Just checked. Putty is installed but it is 0.74. Would uninstalling it likely do the trick?

I'm quoting from #24 to confirm another theory of mine:

I'm using the gpg-agent with putty support as well on my Windows 11 machine. Is your machine an updated one or a clean install? Maybe it's only happening if it's a clean install.

I just updated my gpg4win version to confirm it's not a regression by the latest gpg4win version. Did you check that the putty-agent support is still enabled within gpg?

Edit:
I'm currently using the following gpg config.

###+++--- GPGConf ---+++###
enable-ssh-support
enable-putty-support
###+++--- GPGConf ---+++### 10/14/19 18:13:30 W. Europe Daylight Time
# GPGConf edited this configuration file.
# It will disable options before this marked block, but it will
# never change anything below these lines.

Just checked. Putty is installed but it is 0.74. Would uninstalling it likely do the trick?

Shouldn't make a difference if the pageant is not running. Maybe it's worth uninstalling to confirm it's not causing troubles.

My gpg-agent.conf on windows currently looks like this:

enable-ssh-support
enable-putty-support

I also removed putty now. But it seems the issue stays. Even after doing the steps in troubleshooting and restarting wsl2 :)

PS: gpg --card-status does show the card just fine on wsl2

The communication for GPG and SSH is a completely different. GPG is using the named pipe from the GPG-Agent whereas the SSH-Support uses the communication with the window handle from a window called pageant. Putty started to implement a named pipe communication in version 0.75.

Could you tell me if your windows 11 is a clean install or an upgrade?

Could you tell me if your windows 11 is a clean install or an upgrade?

It is an upgrade from windows 10.

Can you extract your gpg4win version? By the looks of your error the wsl2-ssh-pageant utility is unable to send the data to the pageant window handle. The Windows docs state that the only way this can fail is, when the receiver is unable to process the data.

If the receiving application processes this message, it should return TRUE; otherwise, it should return FALSE.

Gpg4win version is 3.1.15

Gpg4win version is 3.1.15

Thanks for the information. I just replaced my gpg version with 3.1.15 and can't reproduce the issue. Can you verify that some windows application using the gpg-ssh-pageant support is working? For e.g. putty itself?

Gpg4win version is 3.1.15

Thanks for the information. I just replaced my gpg version with 3.1.15 and can't reproduce the issue. Can you verify that some windows application using the gpg-ssh-pageant support is working? For e.g. putty itself?

Hm how do I test that? :)

Gpg4win version is 3.1.15

Thanks for the information. I just replaced my gpg version with 3.1.15 and can't reproduce the issue. Can you verify that some windows application using the gpg-ssh-pageant support is working? For e.g. putty itself?

Hm how do I test that? :)

You could use putty or antoher putty compatible app for that. I've always used putty for a simple test case.