Page MenuHome GnuPG

gpg-agent crashes when using putty for ssh connection
Closed, ResolvedPublic

Description

recent versions of gpg-agent from Gpg4Win 5 beta (at least since beta345, windows 10) are unable to establish ssh connections with putty. when trying to open an ssh connection, the taskmanager shows that for a brief moment a smartcard daemon is started, but soon after both the smartcard daemon as well as the running gpg-agent are killed. after this failure of public key auth, the remote ssh server switches to another available auth method (e.g., prompt for a password).

using windows' built-in OpenSSH is not affected.

Revisions and Commits

Event Timeline

m.eik changed the edit policy from "All Users" to "Contributor (Project)".Thu, Aug 28, 11:06 AM
m.eik added a project: gpd5x.

@m.eik Could you please enable debug option for gpg-agent and get the log output for the crash?

Reading the putty_message_proc function, I found a possible bug with GetSecurityInfo.
https://learn.microsoft.com/en-us/windows/win32/api/aclapi/nf-aclapi-getsecurityinfo

This is fixed in: rG106d73de8685: agent:w32: Fix non-release of MAPSID.
It is a long standing bug.

Please test (I don't have Windows environment, only Wine emulation).

werner triaged this task as Normal priority.Tue, Sep 2, 9:12 AM
werner added a subscriber: werner.

We will do a new gpg4win beta soon.

werner changed the task status from Open to Testing.Tue, Sep 2, 9:12 AM

i've included logfiles for gpg-agent and scdaemon with debug-level 10. the files include

  1. starting gpg-agent
  2. ssh login using OpenSSH (success)
  3. ssh login using PuTTY (crash)

fix tested and confirmed with GnuPG 2.5.12 on windows 10

gpg-agent.conf:

enable-ssh-support
enable-putty-support
enable-extended-key-format
enable-win32-openssh-support
  • gpgconf --launch gpg-agent
  • in PuTTY, opened SSH connection to a host with publickey auth where the private key was on a yubikey
  • expected and observed behaviour: successful login without crash of gpg-agent
gniibe mentioned this in Unknown Object (Maniphest Task).Mon, Sep 15, 7:10 AM