dlech / KeeAgent

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

Add support for WSL sockets via AF_UNIX #321

Closed mehrdadn closed 2 years ago

mehrdadn commented 3 years ago

Handles #220. Depends on dlech/SshAgentLib#14.

Note 1: Don't forget to update the submodule once dlech/SshAgentLib#14 is merged.

Note 2: Please perform a compatibility review before using this code. I only made these changes for my own personal use, and I may have paid insufficient attention to compatibility across different versions of Windows/.NET/etc. (though I'm hoping my check for SocketError.AddressFamilyNotSupported is sufficient to avoid breakage.)

dlech commented 2 years ago

I fixed a few small bugs and added a separate option for the WSL socket path in case people are using portable KeePass on both Windows and Linux.

dlech commented 2 years ago

https://github.com/dlech/KeeAgent/suites/5109170985/artifacts/153093059 is available for testing

mehrdadn commented 2 years ago

I started it and got "Failed to start Wsl socket: Value cannot be null. Parameter name: name".

I think you might want to set the default path to something (%UserProfile%\.ssh\KeeAgent.wsl.sock)? Unless you already have and this is an artifact of my older version messing with it.

dlech commented 2 years ago

The could be because I changed the settings. You could try manually editing your keepass config xml file to remove all "Wsl" options and try again.

mehrdadn commented 2 years ago

Ah yeah, so when I clean the config, the option is disabled by default, and that problem doesn't occur anymore.

dlech commented 2 years ago

Cool. If everything else seems to be working, I'll go ahead and merge these.

mehrdadn commented 2 years ago

I SSH'ed with it fine, so I don't see any problems on my end!

dlech commented 2 years ago

Great, thanks!