-
-
Notifications
You must be signed in to change notification settings - Fork 970
Use native AesGcm for .NET Framework from nuget #1619
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
base: develop
Are you sure you want to change the base?
Conversation
|
LGTM once the package is stable |
b93e470 to
b9d888b
Compare
d49b548 to
c43bdb5
Compare
c43bdb5 to
fc1add9
Compare
e3c63a5 to
177dfba
Compare
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.
Pull Request Overview
This PR enables the use of the native BCL AesGcm implementation for .NET Framework by adding the Microsoft.Bcl.Cryptography NuGet package. Previously, only .NET (Core) targets could use the native implementation, while .NET Framework and .NET Standard had to fall back to a BouncyCastle implementation.
Key changes:
- Changed conditional compilation from
NETto!NETSTANDARDto include .NET Framework targets - Added fallback handling for Mono environments that lack
BCrypt.dll - Added
Microsoft.Bcl.Cryptographypackage reference fornet462target
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
AesGcmCipher.cs |
Updated preprocessor directives and added Mono-specific exception handling for missing BCrypt.dll |
AesGcmCipher.BclImpl.cs |
Updated preprocessor directive to enable BCL implementation for .NET Framework |
Renci.SshNet.csproj |
Added package reference for Microsoft.Bcl.Cryptography for net462 target |
Directory.Packages.props |
Added version specification for Microsoft.Bcl.Cryptography package |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
177dfba to
b239f3c
Compare
| { | ||
| _impl = new BclImpl(key, _iv); | ||
| } | ||
| catch (DllNotFoundException) |
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.
have you hit this? I don't think we need to be that worried about it anymore
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.
The CI test was ran at Ubuntu and hit this issue before.
I can unwrap "try catch" if you want.
Based on dotnet/runtime#89718, we can use native
AesGcmfor .NET Framework from Microsoft.Bcl.Cryptography nuget package