-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Outbox PbeParameters and PbeEncryptionAlgorithm #113987
Conversation
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 removes the existing implementations of PbeParameters and PbeEncryptionAlgorithm from multiple locations and introduces common implementations to support encrypted PKCS#8 for downlevel targets while updating type-forwarding and shim definitions accordingly.
- Removed duplicated implementations from System.Security.Cryptography and Microsoft.Bcl.Cryptography.
- Added new implementations under the Common folder.
- Updated type forwarding and shim conditions to expose the new common types for NET and NETSTANDARD2_1_OR_GREATER.
Reviewed Changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/libraries/System.Security.Cryptography/PbeParameters.cs | Removed legacy implementation to avoid duplication |
src/libraries/System.Security.Cryptography/PbeEncryptionAlgorithm.cs | Removed legacy implementation to avoid duplication |
src/libraries/Microsoft.Bcl.Cryptography/PbeParameters.netstandard.cs | Removed legacy implementation |
src/libraries/Microsoft.Bcl.Cryptography/PbeEncryptionAlgorithm.netstandard.cs | Removed legacy implementation |
src/libraries/Microsoft.Bcl.Cryptography/NetStandardShims.cs | Added conditional directives to support netstandard requirements |
src/libraries/Microsoft.Bcl.Cryptography/Microsoft.Bcl.Cryptography.Forwards.cs | Updated type forwarding to include the new common types |
src/libraries/Common/src/System/Security/Cryptography/PbeParameters.cs | Introduced common implementation for PbeParameters |
src/libraries/Common/src/System/Security/Cryptography/PbeEncryptionAlgorithm.cs | Introduced common implementation for PbeEncryptionAlgorithm |
Files not reviewed (2)
- src/libraries/Microsoft.Bcl.Cryptography/src/Microsoft.Bcl.Cryptography.csproj: Language not supported
- src/libraries/System.Security.Cryptography/src/System.Security.Cryptography.csproj: Language not supported
Comments suppressed due to low confidence (1)
src/libraries/Common/src/System/Security/Cryptography/PbeParameters.cs:60
- Consider adding unit tests to verify the iteration count validation logic and ensure that an ArgumentOutOfRangeException is thrown when iterationCount is less than 1.
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(iterationCount);
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more
39a3c13
to
5c78e89
Compare
src/libraries/Common/src/System/Security/Cryptography/PbeParameters.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Bcl.Cryptography/src/System/Security/Cryptography/NetStandardShims.cs
Show resolved
Hide resolved
src/libraries/Common/src/System/Security/Cryptography/PbeParameters.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Pranav Senthilnathan <[email protected]>
To support the PQC out-boxed types's ability to expose APIs for encrypted PKCS#8, we need to provide
PbeParameters
andPbeEncryptionAlgorithm
to down level targets as well.Fixes #113952