jstarks / npiperelay

npiperelay allows you to access Windows named pipes from WSL
MIT License
660 stars 71 forks source link

Add support for libassuan file sockets (WinGnuPG support) #2

Open NZSmartie opened 6 years ago

NZSmartie commented 6 years ago

This closes #1. See that issue for details on this pull request.

Some housekeeping is needed though. Although I create a overlapped socket handle, i don't check all edge cases of it failing. will need to tidy that up

NZSmartie commented 6 years ago

I've noticed that npiperelay.exe likes to hang around after the pipe has finished. not sure if the socket isn't getting closed.

NZSmartie commented 6 years ago

Hey @jstarks, this PR is ready for review and merging!

jstarks commented 6 years ago

Thanks for the contribution! I think it might be cleaner to require a special flag for this case rather than auto detect, since the user surely knows which case they’re in.

Also, you can probably avoid the overlapped file stuff for the file and socket and just use Go’s built in support.

And you may be able to make the file parsing more idiomatic. I suggest looking at bufio.Reader.

NZSmartie commented 6 years ago

I went with overlapped file IO to minimise needing to change code elsewhere. Then again i'm new to Go and yet to explore how it all works.

Decided against using a flag for convenience, but will require one for libassaun since it is a special case. As I'm still very new to Go and went with what i knew. Will investigate bufio.Reader and update accordingly

NZSmartie commented 6 years ago

Hey @jstarks, I've add a -a flag that must be explicitly set in order to use libassuan file sockets. and I've moved to using bufio for reading the file itself.

NZSmartie commented 6 years ago

Hello?

otakup0pe commented 6 years ago

Given the choice between this and invoking gpg.exe from WSL, I'd love to try this out....

neersighted commented 5 years ago

I'd like to see this merged, or fixed up if it needs to be, if possible. @jstarks is there a list of blockers on merging this?

jstarks commented 5 years ago

I think we can get this merged, I'd just like to see some minor cleanup first.

MacLeodMike commented 5 years ago

Any progress on this? I'd love to have a stable way interacting with gpg4win's gpg-agent from WSL.