-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Migrate to RustCrypto/SSH #16
Conversation
Opening early and as a draft to get feedback and judge whether this would be an avenue you'd be willing to pursue. I think this should lighten up the code present here:
(obviously I'm missing a lot, take that with a grain of salt) |
🤔 To be honest I was surprised serde was used here when I initially saw this crate so this just may be the right avenue and your stats are really promising. I think the most challenging part would be writing tests for at least the most used key types, since the crate supported quite a bit of them:
On the other hand it's not clear if it worked at all since it wasn't tested in the first place... ugh... I'm 👍 on this though :) |
Hmm... the more I think about this the more advantages I see: we could later split the messages into requests and responses (so that it's impossible to return a request object etc.) and properly document the types. I was just about to add more docs but I'm glad that you filed the PR early so that I don't document stuff that's going to disappear :) |
we'll also need to revisit some types. Like the Success response can be free-formed. https://datatracker.ietf.org/doc/html/draft-miller-ssh-agent-11#section-3.8.1 |
What an interesting edge case. Usually success doesn't have any data but for this single command it has. Does that mean the SSH client needs to keep state (so if the question was Tangentially but I'm also thinking we should be presenting some higher level interface on the Okay, one more thing: it seems this PR will take some further time (just for adding all key types and so it's tedious but needs to be done :/ ) so what do you think about releasing 0.3.0 from |
Yeah, I kind of rely on that actually. Currently my implementation was relying on replying an extension, but your comment made me re-read the spec :D.
Works for me. |
Just FYI it's done: https://github.com/wiktor-k/ssh-agent-lib/releases/tag/v0.3.0 |
Is your stuff open-source? It looks really interesting... what exactly are you doing over extensions there 👀 |
Signed-off-by: Arthur Gautier <[email protected]>
closed in favor of #26 |
This migrates the serialization to use https://crates.io/crates/ssh-encoding.
The key structures are provided by https://crates.io/crates/ssh-key.
This makes using the keys with rust-crypto abstractions a lot easier (no need to convert in and out). I think this should also clean up the serialization weirdness I've seen lately.