-
-
Notifications
You must be signed in to change notification settings - Fork 933
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
Use BCL ECDiffieHellman for KeyExchange instead of BouncyCastle (.NET 8.0 onward only) #1371
Merged
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
901fd5a
Use BCL ECDiffieHellman for KeyExchange (.NET 8.0 onward only)
scott-xu f78488c
Merge branch 'develop' into ecdh-bcl
scott-xu 4b8be40
Add back an empty line
scott-xu 8e6d079
Merge branch 'ecdh-bcl' of https://github.com/scott-xu/SSH.NET into e…
scott-xu 61e44a4
Remove the BouncyCastle dependency when target .NET 8.0 onward.
scott-xu 767e692
Merge branch 'develop' into ecdh-bcl
scott-xu 4628a73
Run KeyExchangeAlgorithmTests for .NET 6.0
scott-xu 23c4ac2
Merge branch 'ecdh-bcl' of https://github.com/scott-xu/SSH.NET into e…
scott-xu 23a1dd3
Build Renci.SshNet.IntegrationTests.csproj for net6.0
scott-xu 182f586
Update filter
scott-xu fed031b
Merge branch 'develop' into ecdh-bcl
scott-xu cfd950f
Merge branch 'develop' into ecdh-bcl
scott-xu 8392edb
Merge branch 'develop' into ecdh-bcl
scott-xu 8b42e59
Merge branch 'develop' of https://github.com/scott-xu/SSH.NET into ec…
scott-xu b35ffdf
Merge branch 'ecdh-bcl' of https://github.com/scott-xu/SSH.NET into e…
scott-xu 4b73a96
Merge branch 'develop' into ecdh-bcl
scott-xu 5502918
Add back BouncyCastle as fallback
scott-xu f76ffeb
Merge branch 'develop' into ecdh-bcl
scott-xu a1b00e3
Add back the missing `SendMessage`
scott-xu 6ed28ae
Merge branch 'ecdh-bcl' of https://github.com/scott-xu/SSH.NET into e…
scott-xu d754e93
Merge branch 'develop' into ecdh-bcl
scott-xu 08c9594
Merge branch 'develop' of https://github.com/scott-xu/SSH.NET into ec…
scott-xu 4495c57
Merge branch 'ecdh-bcl' of https://github.com/scott-xu/SSH.NET into e…
scott-xu bd093c7
Merge branch 'develop' into ecdh-bcl
scott-xu 57bf19d
Merge branch 'develop' into ecdh-bcl
WojciechNagorski 13dd7e1
Run ECDH KEX integration tests under .NET48
scott-xu 9fa0c14
Merge branch 'develop' into ecdh-bcl
scott-xu 344b744
Merge branch 'develop' into ecdh-bcl
scott-xu 385e087
Use SshNamedCurves instead of SecNamedCurves for BouncyCastle.
scott-xu 387e6da
typo
scott-xu 73c9446
Fix build
scott-xu db0a98e
Use System.Security.Cryptography namespace if NET8_0_OR_GREATER;
scott-xu 2441f77
Separate BCL and BouncyCastle implementation
scott-xu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, going through SshNamedCurves causes a bunch of extra lookup and static initialization compared to SecNamedCurves. Is there any reason to use it?
It's a shame we can't just directly refer to the static BC object when we know the curve we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess
SshNamedCurves
is designed for libraries like SSH.NET to consume?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but I don't see why we would. If I run this program in a loop:
The result is about 28.3±0.7ms vs 29.2±0.8ms. Both extremely high (also includes first JIT of relevant BouncyCastle methods), but 1ms is 1ms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind trying
SecNamedCurves.GetByOid(SecObjectIdentifiers.SecP256r1)
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't try it but I'm pretty sure it would be the same as
SecNamedCurves.GetByName
. The problem withSshNamedCurves
is the amount of static constructors that it forces to run