Skip to content

Additional crates #2

Open
Open

Description

@tarcieri

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

  • ssh-cipher
  • ssh-derive
  • ssh-encoding
  • ssh-key
  • ssh-protocol
  • Others?

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.

Activity

  1. pinned this issue on Oct 11, 2022
  2. kim commented on Oct 21, 2022

    @kim

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

  3. tarcieri commented on Oct 21, 2022

    @tarcieri
    MemberAuthor

    @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.

  4. tarcieri commented on Oct 23, 2022

    @tarcieri
    MemberAuthor

    #29 extracted an ssh-encoding crate

  5. 1Dragoon commented on Dec 6, 2022

    @1Dragoon

    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.

  6. tarcieri commented on Dec 6, 2022

    @tarcieri
    MemberAuthor

    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.

    Edit: ssh-derive is now a thing!

  7. kim commented on Dec 6, 2022

    @kim

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

  8. tarcieri commented on Mar 22, 2024

    @tarcieri
    MemberAuthor

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

  9. baloo commented on Apr 6, 2024

    @baloo
    Member

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

  10. jrozner commented on Jan 21, 2025

    @jrozner

    Are there definitive plans around incorporating or not incorporating the agent protocol in yet? Would the plan still be to bring in https://github.com/wiktor-k/ssh-agent-lib? It would be nice to not have to bring in all of tokio and have options for building an agent client or server with our without async.

  11. baloo commented on Jan 22, 2025

    @baloo
    Member

    I believe this is still the plan. We "just" need time to do it (and time to coordinate with @wiktor-k). We'll sure be happy to put the tokio stuff behind a feature flag as needed.

  12. wiktor-k commented on Jan 22, 2025

    @wiktor-k
    Contributor

    It would be nice to not have to bring in all of tokio and have options for building an agent client or server with our without async.

    We'll sure be happy to put the tokio stuff behind a feature flag as needed.

    AFAIK it's already behind a flag: https://github.com/wiktor-k/ssh-agent-lib/blob/main/Cargo.toml#L39 it may be badly named or maybe there are some other improvements. We're happy to adjust.

    FWIW there already is a blocking client (which doesn't require tokio): https://docs.rs/ssh-agent-lib/latest/ssh_agent_lib/blocking/index.html

    Server is a bit more involved and we hadn't have anyone with a use-case but obviously we're not against it.

    We "just" need time to do it

    Yep, that's the real constraint 👍

    Have a nice day, folks! 👋

  13. a7g4 commented on Oct 26, 2025

    @a7g4

    I wrote a library for ssh-agent types; would you be interested in bringing that in as a stop gap for the full ssh agent library?

    Basically just the types defined in https://www.ietf.org/archive/id/draft-ietf-sshm-ssh-agent-10.html + certs (as defined in their scattered RFCs) with each type implementing ssh_encoding::{Encode, Decode}. The bulk of the work was just hunting down the wire format for certificates.

    It makes writing custom agent clients or agent implementations pretty trivial.

  14. tarcieri commented on Nov 5, 2025

    @tarcieri
    MemberAuthor

    It'd be great to have any crate for writing SSH agents. I've wanted such a library for writing an agent backed by hardware tokens.

  15. baloo commented on Nov 8, 2025

    @baloo
    Member

    We (@wiktor-k and I) planned to import ssh-agent-lib over here. It's as complete as it can be and used in the field. We've sorted the license already, and I just need to make the import happen (I'd want to preserve the commit history as much as possible).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions