Skip to content

Enable ML-DSA CMS tests on .NET Framework - #131445

Open
PranavSenthilnathan wants to merge 3 commits into
dotnet:mainfrom
PranavSenthilnathan:pranavsenthilnathan-mldsa-pkcs8-export-test
Open

Enable ML-DSA CMS tests on .NET Framework#131445
PranavSenthilnathan wants to merge 3 commits into
dotnet:mainfrom
PranavSenthilnathan:pranavsenthilnathan-mldsa-pkcs8-export-test

Conversation

@PranavSenthilnathan

Copy link
Copy Markdown
Member

Summary

  • enable ML-DSA SignedCms and SignerInfo tests on .NET Framework when ML-DSA is supported
  • assert the Windows CAPI failure for SHAKE digest algorithms
  • retain detached-content verification coverage on .NET Framework

Testing

  • System.Security.Cryptography.Pkcs.Tests (net481, Release): 386 total, 0 failed, 0 errors, 9 skipped

Note

This pull request description was generated with GitHub Copilot.

PranavSenthilnathan and others added 2 commits July 27, 2026 10:57
Windows now supports ML-DSA, so drop the Windows-gating SupportsDraft10Pkcs8
helper and run the ML-DSA SignedCms/SignerInfo tests wherever MLDsa.IsSupported.

Document the .NET vs .NET Framework quirks the tests exercise:
- .NET Framework CMS is backed by Windows CAPI, which does not recognize SHAKE
  digest algorithms and throws CRYPT_E_UNKNOWN_ALGO on sign, whereas managed
  .NET builds the CMS itself and succeeds. Tests assert each behavior in-place.
- Verifying a detached ML-DSA signature without supplying the content does not
  throw on .NET Framework the way it does on .NET (detachedNoContentThrows).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ab780736-e998-4327-b006-ee49fcf9ac12
Copilot AI review requested due to automatic review settings July 28, 2026 00:31
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the System.Security.Cryptography.Pkcs SignedCms test suite to run ML-DSA-related signing and counter-signing tests on .NET Framework when the platform reports ML-DSA support, while documenting (and attempting to validate) a known CAPI limitation around SHAKE digests.

Changes:

  • Remove the prior “Draft 10 PKCS#8 not supported on Windows” gating and instead condition tests directly on MLDsa.IsSupported.
  • Add .NET Framework-specific branches for SHAKE128/SHAKE256 that expect CryptographicException during signing/countersigning (Windows CAPI doesn’t recognize SHAKE digests).
  • Keep existing signing / roundtrip verification paths for non-SHAKE digests, including detached-content coverage.

Reviewed changes

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

File Description
src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignerInfoTests.cs Runs ML-DSA countersign tests when supported; adds .NET Framework SHAKE failure expectation branch.
src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.netcoreapp.cs Switches ML-DSA test conditionals to MLDsa.IsSupported (removes dependency on deleted helper).
src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.cs Runs ML-DSA signer tests when supported; adds .NET Framework SHAKE failure expectation branch and removes old gating helper.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ab780736-e998-4327-b006-ee49fcf9ac12
Copilot AI review requested due to automatic review settings July 28, 2026 01:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

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.

2 participants