Skip to content
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

WIP: Support for Ed25519 Host- and Private-Keys #492

Closed
wants to merge 2 commits into from

Conversation

darinkes
Copy link
Collaborator

No description provided.

@bhalbright
Copy link

Wow, this is really nice. You are farther ahead than I was. I think the only area where I have something you don't is I've got the code to decrypt the private key inside the openssh key. Perhaps I could somehow contribute this code to your effort, though I'm honestly not really sure the easiest way to do that in github (commit to your fork?). Regardless I'll spent some time cleaning up the code I had and then I'll commit it to my fork and share the link.

I had wanted to use SSH.NET in a work project about a year ago but the lack of ED25519 support was a showstopper so we had to do something else (wrote a C# wrapper around libssh) but I always wanted to come back and contribute to this project, I finally got around to working on it and it appears you had the same idea!

@darinkes darinkes force-pushed the ed25519 branch 2 times, most recently from b5e1f43 to 3e29a80 Compare November 28, 2018 08:15
@darinkes
Copy link
Collaborator Author

Wow, this is really nice. You are farther ahead than I was. I think the only area where I have something you don't is I've got the code to decrypt the private key inside the openssh key. Perhaps I could somehow contribute this code to your effort, though I'm honestly not really sure the easiest way to do that in github (commit to your fork?). Regardless I'll spent some time cleaning up the code I had and then I'll commit it to my fork and share the link.

That would be a huge help! Then I can start working on improving the KEX-Situation, too.

Also known as:
- ecdsa-sha2-nistp256
- ecdsa-sha2-nistp384
- ecdsa-sha2-nistp521

Works for .NET 3.5 and 4.0 but needs some more testing and tests.

Basically it translate between SSH-Data and Microsoft Crypto API.

Tested with ECDSA-{256,384,521} Hostkeys and ECDSA-{256,384,521}-Pub/Private-Keys
against OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g  1 Mar 2016.
Keys generated with:
- ssh-keygen -t ecdsa
- ssh-keygen -t ecdsa -b 384
- ssh-keygen -t ecdsa -b 521
ToDo:
OpenSSHKey-Reader needs crypto support
@bhalbright
Copy link

@darinkes Here is what I had so far, it is only lightly tested however (only walked through a couple unit tests to see if the key parsing works). Let me know what you think, thanks!

my fork comparison to ssh.net

@darinkes
Copy link
Collaborator Author

@bhalbright Thanks a lot! I will check it out ASAP.

@bhalbright
Copy link

@darinkes I don't know if you've had a chance to look at my fork yet but if you prefer maybe you could make me a contributor on your fork and I could update your impl with the decryption code. I like how you separated the parsing into a separate class anyhow. No rush though, thanks.

@darinkes
Copy link
Collaborator Author

darinkes commented Dec 1, 2018

@bhalbright I have to do some rework of my approach on EC in SSH.NET.
.NET System.Security.Cryptography failed on the very last step of ECDH to be usable:
https://social.msdn.microsoft.com/Forums/en-US/89060f38-d388-4f38-b6e6-4a31271abef3/ecdh-key-agreement-in-cng-how-to-get-the-raw-agreed-secret

So I'm now checking out other ways to add EC to SSH.NET. It will take some more time.

@darinkes
Copy link
Collaborator Author

darinkes commented Dec 2, 2018

@bhalbright I cherry-picked your OpenSSH Key-Format Reader into my branch:
darinkes@fb2a0ea

So it's visible you did the work! 👍
OK for you?

@darinkes
Copy link
Collaborator Author

darinkes commented Dec 2, 2018

Closing in favor of: #496

@darinkes darinkes closed this Dec 2, 2018
@bhalbright
Copy link

thanks @darinkes glad I could help out a little!

@darkoperator
Copy link

darkoperator commented Dec 3, 2018 via email

@darinkes darinkes deleted the ed25519 branch December 9, 2018 15:54
@willie84
Copy link

Thanks that this was implemented. It has just saved our 2 day bug . We had generated our keys using rsa but we used ssh-ed25519 and now the keys work on our sftp operation. Thanks. Cool stuff

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.

None yet

4 participants