npiperelay
npiperelay copied to clipboard
Support for LibAssuan file sockets
LibAssuan is used in GnuPG to abstract away file sockets on multiple platforms.
On systems that do not support file sockets (i.e. Windows) they instead create a TCP socket on 127.0.0.1, saving the human readable port number to the file along with a newline (0x0A
) and 16 byte nonce.
nzsmartie@Laptop:~$ xxd /mnt/c/Users/nzsmartie/AppData/Roaming/gnupg/S.gpg-agent
00000000: 3234 3534 340a 50bb 0b13 a7c5 c6c4 da2d 24544.P........-
00000010: 4505 9648 b3da E..H..
The nonce is required to be sent as the first payload to the socket when once connected before any messages may be received or sent. (Observations based on source code)
Adding support for LibAssuan would allow windows users to relay their gpg-agent to WSL for example to be used with signing git commits, or SSH keys if configured correctly.
This issue is more informative and I may take up this challenge myself.