Enable ML-DSA CMS tests on .NET Framework - #131445
Open
PranavSenthilnathan wants to merge 3 commits into
Open
Conversation
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
|
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. |
Contributor
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
Contributor
There was a problem hiding this comment.
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
CryptographicExceptionduring 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
System.Security.Cryptography.Pkcs.Tests(net481, Release): 386 total, 0 failed, 0 errors, 9 skippedNote
This pull request description was generated with GitHub Copilot.