I'm maintaining a crate for writing own agents (and clients) and just recently added an example of providing decryption over extensions [0] which, coupled with the other examples, allows using SSH agent as a proxy between OpenPGP Card devices (eg Yubikeys) and OpenPGP encrypted data.
[0]: https://github.com/wiktor-k/ssh-agent-lib/pull/70
Got some really positive feedback about this one: https://chaos.social/@Foxboron/112416348981479022 ;)
> Windows didn't really do Unix sockets until recently so everything there is awful
Sadly the support for Unix sockets on Windows in Rust's standard lib is stuck in a limbo: https://github.com/rust-lang/libs-team/issues/271
Fortunately the built-in Windows' SSH client and agent work over Named Pipes and it's quite easy to communicate with them that way: https://github.com/wiktor-k/ssh-agent-lib#agent
[0]: https://duckduckgo.com/?q=git+for+Windows+openssh&t=fpas&iax...
* You can use them for more than two processes communicating (eg. a server process with potentially multiple client processes connecting);
* They are bidirectional;
* They support passing kernel-verified UID / GID credentials between processes;
* They support passing file descriptors between processes;
* They support packet and sequenced packet modes.
TCP only grants you 2 of these extra features (sequenced packet mode/bidirection), leaving a giant hole in security in the process.
[0]: https://docs.rs/tokio/latest/tokio/net/struct.UnixStream.htm...
Nowadays, I'm using it for signing code remotely on a server with a yubikey on the local laptop. (needs a patched relic - https://github.com/42wim/relic/tree/sshtoken)
Also works with windows as it uses https://github.com/buptczq/WinCryptSSHAgent that did the hard work to get it to talk with almost everything that exists in windows/wsl/putty etc.
[1]: https://github.com/hiAndrewQuinn/meikkalainen/tree/main