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

Outbox PbeParameters and PbeEncryptionAlgorithm #113987

Merged
merged 7 commits into from
Mar 28, 2025

Conversation

vcsjones
Copy link
Member

To support the PQC out-boxed types's ability to expose APIs for encrypted PKCS#8, we need to provide PbeParameters and PbeEncryptionAlgorithm to down level targets as well.

Fixes #113952

@Copilot Copilot bot review requested due to automatic review settings March 27, 2025 21:24
Copy link
Contributor

@Copilot Copilot AI left a 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

@vcsjones vcsjones force-pushed the outbox-pbe-parameters branch from 39a3c13 to 5c78e89 Compare March 27, 2025 21:33
Co-authored-by: Pranav Senthilnathan <[email protected]>
@vcsjones vcsjones merged commit 3e22ac1 into dotnet:main Mar 28, 2025
82 of 87 checks passed
@vcsjones vcsjones deleted the outbox-pbe-parameters branch March 28, 2025 21:56
@vcsjones vcsjones added this to the 10.0.0 milestone Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outbox S.S.Cryptography.PbeParameters
3 participants