Skip to content

libassuan socket emulation file support #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

charabaruk
Copy link

This takes care of processing the socket file to get the port and cookie, but even so the program still gets stuck sending the cookie across. With gpg-agent and uds-2-np running, and three attempts to do ssh-add -l (cancelled after 30s via Ctrl+C each time):

PS> .\uds-2-np.exe -d
incoming connections to pipe: \\.\pipe\usd-2-np-10596
will be routed to 127.0.0.1:5227
connection accepted from pid:14224
connection accepted from pid:25552
connection accepted from pid:10888
PS> gpg-agent -v --homedir ~\gnupg --use-standard-socket --enable-ssh-support --enable-putty-support --daemon --no-detach
gpg-agent[16064]: WARNING: "--use-standard-socket" is an obsolete option - it has no effect
gpg-agent[16064]: enabled debug flags: ipc
gpg-agent[16064]: listening on socket '~\gnupg\S.gpg-agent'
gpg-agent[16064]: listening on socket '~\gnupg\S.gpg-agent.extra'
gpg-agent[16064]: listening on socket '~\gnupg\S.gpg-agent.browser'
gpg-agent[16064]: listening on socket '~\gnupg\S.gpg-agent.ssh'
gpg-agent[16064]: gpg-agent (GnuPG) 2.2.4 started
gpg-agent[16064]: putty message loop thread started
gpg-agent[16064]: error reading nonce on fd 660: Input/output error
gpg-agent[16064]: error reading nonce on fd 740: Input/output error
gpg-agent[16064]: error reading nonce on fd 772: Input/output error

After looking into code for both gpg-agent and libassuan, it doesn't look like we need to send anything other than the cookie, and it doesn't look like we need to receive or acknowledge anything sent back before ssh-agent protocol can be used on the connection.

charabaruk and others added 11 commits April 12, 2018 22:40
Adds new `process_sock_file()` function which takes the path of the
libassuan "socket" and parses out the port number and cookie for the
real socket connection.
Seems that sending the cookie might not be enough to establish the
connection, as things get stuck after this with no
messages one way or the other. Calling out that we need to investigate
how to complete any handshake for libassuan's AF_UNIX emulation before
we can continue communicating between the pipe and socket.
Write to stdout whenever anything happens so we can follow along.
Also make nonzero check explicit for `debug_mode`  in the macro to
ensure that messages _will_ be printed when the debug flag is used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants