-
Couldn't load subscription status.
- Fork 16
Description
First of all, thank you for creating this, it has been a real timesaver!
Today I decided to store some of my SHH keys in KeePass in combination with KeeAgent. However I noticed that everytime I tried to load a key it would hang KeePass for about 60 seconds.
I found the "Verbose" release of winssh-pageant and ran it, with the following result:
PS C:\DEV\tmp> .\winssh-pageant.exe --verbose
2024-10-22 22:28:05 INF Starting winssh-pageant
2024-10-22 22:28:05 INF Pageant pipe proxy started
2024-10-22 22:28:05 DBG Locked OS Thread
2024-10-22 22:28:05 DBG Allocated global memory for message data, Starting message loop
2024-10-22 22:28:12 DBG Received WM_COPYDATA message
2024-10-22 22:28:12 DBG Passed security checks
2024-10-22 22:28:12 DBG Received pageant request message of size: 286
2024-10-22 22:28:12 DBG Querying OpenSSH Agent pipe_name="\\\\.\\pipe\\openssh-ssh-agent"
2024-10-22 22:28:12 DBG Dialing agent pipe
2024-10-22 22:28:12 DBG Dialed successfully
2024-10-22 22:28:12 DBG Writing putty request to openssh pipe
2024-10-22 22:28:12 DBG request wrote successfully, reading response
2024-10-22 22:28:12 DBG message size: 1
2024-10-22 22:28:12 DBG reply code: 6
2024-10-22 22:29:12 ERR cannot read response message contents from openssh pipe error="i/o timeout"
2024-10-22 22:29:12 DBG Sent request to openssh handler, result size: 5
2024-10-22 22:29:12 DBG Copied 5 elements to shared memory
2024-10-22 22:29:12 DBG Received WM_COPYDATA message
2024-10-22 22:29:12 DBG Passed security checks
2024-10-22 22:29:12 DBG Received pageant request message of size: 952
2024-10-22 22:29:12 DBG Querying OpenSSH Agent pipe_name="\\\\.\\pipe\\openssh-ssh-agent"
2024-10-22 22:29:12 DBG Dialing agent pipe
2024-10-22 22:29:12 DBG Dialed successfully
2024-10-22 22:29:12 DBG Writing putty request to openssh pipe
2024-10-22 22:29:12 DBG request wrote successfully, reading response
2024-10-22 22:29:12 DBG message size: 1
2024-10-22 22:29:12 DBG reply code: 6
2024-10-22 22:30:12 ERR cannot read response message contents from openssh pipe error="i/o timeout"
2024-10-22 22:30:12 DBG Sent request to openssh handler, result size: 5
2024-10-22 22:30:12 DBG Copied 5 elements to shared memory
After a while it became clear that a message size of "1" means that there is only a reply code, and no further data, however, the code was still trying to read data from the pipe.
I patched to code and adding keys with KeeAgent started working without freezing!
I created a PR with my fix: #39, however, feel free to implement this fix any way you see fit, I'm not a seasoned go developer.