RustCrypto / SSH

Pure Rust implementation of components of the Secure Shell (SSH) protocol
108 stars 19 forks source link

Additional crates #2

Open tarcieri opened 1 year ago

tarcieri commented 1 year ago

This is a brainstorming issue for additional crates which could go in this repo.

There is no current plan to provide a full SSH protocol in this repo, and we are only looking to provide common functionality which is useful for multiple SSH implementations and use cases outside full SSH protocol implementations, such as interoperating with the SSH key/certificate formats and providing linkage to the respective RustCrypto signing algorithm implementations.

However, with sufficient interest that may change.

kim commented 1 year ago

How about ssh-agent wire types? Or if not, maybe the Encode / Decode traits could be made public.

tarcieri commented 1 year ago

@kim splitting out the encoding traits (Decode/Encode and Reader/Writer) into their own crate (e.g. ssh-encoding) is a good idea.

I'll see if I can do that before the next release of ssh-key.

tarcieri commented 1 year ago

29 extracted an ssh-encoding crate

1Dragoon commented 1 year ago

How about ssh-agent wire types? Or if not, maybe the Encode / Decode traits could be made public.

If it interests you guys at all, I'm working on an SSH agent library that just provides a reference of the current ssh-agent draft specification, and leaves the actual implementation of the agent to the user. This differs from every rust ssh agent implementation I've seen thus far as the agent protocol itself is completely decoupled from the implementation code. Effectively the user will just impl the trait, and from there it is trivial for the user to make any kind of agent that they want.

https://github.com/1Dragoon/supersecretagent/blob/master/agent/src/lib.rs

It's far from finished (actually what would be nice is if we could marshal/unmarshal the wire protocol via an ordinary struct with a derive proc macro.) I could submit a PR if desired after my code has matured a bit more.

Also here's some code that utilizes the aforementioned trait to implement an SSH agent that supports both windows named pipes and pageant's message copy system:

https://github.com/1Dragoon/supersecretagent/blob/master/src/main.rs

I'm intending to add support for unix sockets as well as a few other features as noted in the code's comments.

tarcieri commented 1 year ago

actually what would be nice is if we could marshal/unmarshal the wire protocol via an ordinary struct with a derive proc macro

It wouldn't be terribly hard to add custom derive for ssh-encoding. We already have a similar crate for our der implementation

kim commented 1 year ago

I am happy with ssh-encoding as-is (the agent surface isn't terribly large). Also, async is not an option for me.

tarcieri commented 3 months ago

I've added ssh-derive to the list with the goal of supplying custom derive support for ssh-encoding, namely the Decode/Encode traits

baloo commented 3 months ago

About the ssh-agent, the plan would be to bring in https://github.com/wiktor-k/ssh-agent-lib