keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
20.17k stars 1.42k forks source link

SSH Agent fails to load Putty private key #10824

Closed zoranito closed 1 month ago

zoranito commented 1 month ago

Overview

When attempting to load a Putty generated key I get "Invalid key file, expecting an Open SSH key". SSH Agent is configured to "Enable SSH Agent integration" and "Use both agents". I have tried to change it to use only Pagent but I still get the same error message. It seems to me at that the application expects only Open SSH keys.

Steps to Reproduce

Precondition: There is a id_rsa key created by Putty application

  1. SSH Agent integration > Enable SSH Agent integration > Use Pagent
  2. Go to an entry and click on SSH Agent
  3. In the Private key > External file, klick Browse... button on pick your key

Expected Behavior

I would expect that my putty-created id-rsa key should be accepted

Actual Behavior

Putty rsa key is not being accepted

Context

KeePassXC - Version 2.7.7 Revision: 68e2dd8

Qt 5.15.11 Debugging mode is disabled.

Operating system: Windows 10 Version 2009 CPU architecture: x86_64 Kernel: winnt 10.0.19044

Enabled extensions:

Cryptographic libraries:

Operating System: OS Name Microsoft Windows 10 Enterprise Desktop Env: Windowing System:

PuTTYgen Release 0.77 Build platform: 64-bit x86 Windows Compiler: clang 14.0.0 (https://github.com/llvm/llvm-project/ b6c218d4fdb74c0ee467e078721438c3396dc599), emulating Visual Studio 2019 (16.9), _MSC_VER=1928, _MSC_FULL_VER=192829914 Embedded HTML Help file: no Source commit: 61ab33efe48cfd1cea77e249e5598a89f3387fa3 © 1997-2022 Simon Tatham. All rights reserved.

Pageant Release 0.77 Build platform: 64-bit x86 Windows Compiler: clang 14.0.0 (https://github.com/llvm/llvm-project/ b6c218d4fdb74c0ee467e078721438c3396dc599), emulating Visual Studio 2019 (16.9), _MSC_VER=1928, _MSC_FULL_VER=192829914 Embedded HTML Help file: no Source commit: 61ab33efe48cfd1cea77e249e5598a89f3387fa3 © 1997-2022 Simon Tatham. All rights reserved.

droidmonkey commented 1 month ago

Did you export the key from PuttyGen as an openssh key?

https://stackoverflow.com/a/2224204

zoranito commented 1 month ago

I tried it and I was able to add the key in that case but then I could not add the key to SSH Agent (PAgent, it is the only one I have installed). When running Add key to SSH agent Ctlr^H it would respond with No agent running, cannot add identity. I can see that Pagent is running. I also tried to load it directly in Pagent by opening it but Pagent could not recognize the key format!? It recognizes only Putty-created keys.

droidmonkey commented 1 month ago

https://keepassxc.org/docs/KeePassXC_UserGuide#_openssh_agent_and_pageant_on_windows