Skip to content

Conversation

@PranavSenthilnathan
Copy link
Member

Closes #116998

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

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 implements SPKI (Subject Public Key Info) and PKCS#8 support for Composite ML-DSA cryptographic algorithms. The primary purpose is to extend the existing Composite ML-DSA implementation to support standard cryptographic key formats for interoperability.

Key changes include:

  • Added support for importing and exporting keys in SPKI and PKCS#8 formats
  • Implemented encrypted PKCS#8 private key support with PEM encoding
  • Extended test infrastructure with comprehensive validation for the new formats

Reviewed Changes

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

Show a summary per file
File Description
CompositeMLDsaTestHelpers.cs Added extensive helper methods for testing SPKI/PKCS#8 import/export operations
CompositeMLDsaMockImplementation.cs Updated mock implementation to support PKCS#8 export testing
CompositeMLDsaImplementationTests.cs Added comprehensive roundtrip tests for all new key formats
CompositeMLDsaFactoryTests.cs Added validation tests for malformed ASN.1 encodings and PEM formats
CompositeMLDsaContractTests.cs Added contract tests for new export methods and error handling
CompositeMLDsaManaged.cs Implemented actual PKCS#8 private key export functionality
CompositeMLDsa.cs Updated private key reader to handle raw key data instead of ASN.1 wrapper

Copy link
Member

@bartonjs bartonjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one comment throwing a 2 into a binary number, then LGTM. And should be backported to 10 when ready.

@PranavSenthilnathan PranavSenthilnathan enabled auto-merge (squash) September 19, 2025 17:57
@PranavSenthilnathan PranavSenthilnathan merged commit d2ee366 into dotnet:main Sep 19, 2025
88 checks passed
@PranavSenthilnathan PranavSenthilnathan deleted the cdsa-pkcs8 branch September 19, 2025 20:33
@PranavSenthilnathan
Copy link
Member Author

/backport to release/10.0

@github-actions
Copy link
Contributor

Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17869205178

@github-actions
Copy link
Contributor

@PranavSenthilnathan backporting to "release/10.0" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: SPKI and PKCS8 for Composite ML-DSA
Using index info to reconstruct a base tree...
M	src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
CONFLICT (content): Merge conflict in src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 SPKI and PKCS8 for Composite ML-DSA
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

PranavSenthilnathan added a commit to PranavSenthilnathan/runtime that referenced this pull request Sep 19, 2025
xtqqczze pushed a commit to xtqqczze/dotnet-runtime that referenced this pull request Sep 20, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 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.

Support Composite ML-DSA with a managed compositor

2 participants