dlech / KeeAgent

ssh agent plugin for KeePass 2.x
http://lechnology.com/software/keeagent
Other
522 stars 35 forks source link

ed25519 key fails in KeeAgent works in Pageant #347

Closed projectdp closed 2 years ago

projectdp commented 2 years ago

I have been having issues with getting a newly generated ed25519 key to work. I have read a few articles on this and have tried a few things. If there is something I am missing please let me know. If you have a working ed25519 key in KeeAgent I'd like to know if or how you were able to successfully get the key working or what your ppk file looks like (sans-secrets). I haven't been adding a passphrase to these but after I get this working I'll try with a passphrase.

Environment: KeeAgent 0.12.1 KeePass 2.51.1 (64 bit) Pageant 0.77 PuTTYgen 0.77 Windows 10

  1. Generated key via ssh-keygen: ssh-keygen -t ed25519 -C "my@email.com"

  2. Loaded in puttygen, exported private and public keys.

  3. Created entry in KeePass, attached private key and public key.

  4. KeeAgent fails to load, producing errors:

    • After attaching the file within the KeePass entry KeyAgent tab:
      • <Error loading key from attachment>
    • When loading KeePass:
      • KeeAgent: Error while loading key from entry... Could not load file from attachment... Unknown file format... Possible causes: Passphrase entered incorrectly... File is corrupt or has been tampered.
  5. When I load the same key in pageant it works and I can ssh in.

  6. I attempted to convert the key to RFC4716 per instructions I saw online: ssh-keygen -e -m RFC4716 -f id_ed25519 > fixed_id_ed25519

  7. After attempting to import to puttygen it fails to import using this format so I don't think this approach is valid for my combination of versions.

Here is what my ppk key looks like when I view it:

PuTTY-User-Key-File-3: ssh-ed25519
Encryption: none
Comment: my@email.com
Public-Lines: 2
AAAAAAAAAAAAAARANDOMSTRINGRANDOMSTRINGRANDOMSTRINGRANDOMSTRING
RANDOMSTRING
Private-Lines: 1
AAAAAAAAAAAAAAANOTHERRANDOMSTRINGRANDOMSTRINGRANDOMSTRINGANOTHER
Private-MAC: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef

References: https://stackoverflow.com/questions/49083709/how-to-convert-ed25519-private-key-to-putty-ppk https://newbedev.com/how-to-convert-ed25519-private-key-to-putty-ppk

dlech commented 2 years ago

Does it work with https://github.com/dlech/KeeAgent/releases/tag/v0.13.1?

projectdp commented 2 years ago

That solves this issue for me thank you! Much appreciated.

My only other feedback on the v0.13.1 release is the icons appear a bit horizontally stretched, but fully functional:

image