Skip to content

Conversation

@PranavSenthilnathan
Copy link
Member

Follow-up to #117907

Fixes #118066

@PranavSenthilnathan PranavSenthilnathan added this to the 10.0.0 milestone Jul 28, 2025
@PranavSenthilnathan PranavSenthilnathan self-assigned this Jul 28, 2025
Copilot AI review requested due to automatic review settings July 28, 2025 07:26
Copy link
Contributor

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 performs cleanup for certificate accessor methods following a previous change. The main purpose is to optimize memory usage by replacing byte array allocations with pooled memory for public key comparisons, standardize platform checks, and add proper argument validation with consistent documentation.

Key changes:

  • Replace byte array allocations with CryptoPoolLease for improved memory management in key comparison operations
  • Consolidate platform detection logic into a centralized Helpers.IsOSPlatformWindows property
  • Add comprehensive argument validation and XML documentation to public API methods

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
X509Certificate2.cs Replace byte array allocations with pooled memory for ML-KEM, ML-DSA, and SLH-DSA key comparisons
CertificatePal.Windows.PrivateKey.cs Remove extra blank line for code formatting consistency
PrivateKeyAssociationTests.cs Add comprehensive argument validation tests for post-quantum cryptography methods
X509CertificateKeyAccessors.cs Add argument validation, XML documentation, and replace allocations with pooled memory
MLKemImplementation.Windows.cs Consolidate platform checks using centralized helper and remove unused imports
MLKemCng.cs Consolidate platform checks using centralized helper and remove unused imports
MLDsaImplementation.Windows.cs Consolidate platform checks using centralized helper and remove unused imports
MLDsaCng.cs Consolidate platform checks using centralized helper and remove unused imports
Helpers.cs Add centralized IsOSPlatformWindows property for consistent platform detection
CompositeMLDsaImplementation.Windows.cs Consolidate platform checks using centralized helper and remove unused imports
Interop.Properties.cs Update platform check to use centralized helper and remove unused imports

@PranavSenthilnathan PranavSenthilnathan merged commit 865d4e6 into dotnet:main Jul 28, 2025
87 checks passed
@PranavSenthilnathan PranavSenthilnathan deleted the crypto-cleanup branch July 28, 2025 22:58
@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow up to M.B.C. cert accessors (#117907)

2 participants