Repository navigation
Fix IsSupported tests for ML-KEM - #130737
Merged
Merged
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 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 ML-KEM test layout so MLKem.IsSupported is validated independently of the [ConditionalClass] gating used for implementation tests, and adjusts the platform-expectation assertion to tolerate Azure Linux SymCrypt-OpenSSL 1.10 backports prior to Azure Linux 4.
Changes:
- Moves
IsSupported-focused tests out of the[ConditionalClass(typeof(MLKem), nameof(MLKem.IsSupported))]-gated implementation test class so they can run whenIsSupportedisfalse. - Updates the platform comparison in
IsSupported_AgreesWithPlatformto avoid hard-failing on Azure Linux SymCrypt-OpenSSL prior to Azure Linux 4.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/Common/tests/System/Security/Cryptography/MLKemImplementationTests.cs | Splits supported/IsSupported tests into a separate class and relaxes platform expectation checks for Azure Linux SymCrypt-OpenSSL pre-v4. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 2
bartonjs
approved these changes
Jul 14, 2026
Member
|
/backport to release/10.0 |
Contributor
|
Started backporting to |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
There are two things being fixed here.
The class that the
IsSupportedtests were in is marked[ConditionalClass(typeof(MLKem), nameof(MLKem.IsSupported))]. This means we only tested theIsSupportedproperty when it was actually true. We never asserted that it should be true when it was actually false.Azure Linux's SymCrypt-OpenSSL 1.10 package is going to light up ML-KEM. The tests keyed off the runtime
IsSupporteddetection passed, it's just the platform comparison test that started failing.We don't know what version of SymCrypt-OpenSSL is installed on a given system and "asking" it requires using OpenSSL APIs we don't currently have in our shim. We can't ask the package manager because that will not work or vary in containers, and the shared object does not have an SOVERSION. So "either" answer is fine for Azure Linux, but in Azure Linux 4 we start expecting a hard yes.
If we want we can revisit this test in a few months when it is likely SCOSSL 1.10 has been installed everywhere.