Skip to content

Fix IsSupported tests for ML-KEM - #130737

Merged
vcsjones merged 1 commit into
dotnet:mainfrom
vcsjones:mlkem-ossl-availability-check
Jul 15, 2026
Merged

vcsjones merged 1 commit into
dotnet:mainfrom
vcsjones:mlkem-ossl-availability-check

Conversation

@vcsjones

Copy link
Copy Markdown
Member

There are two things being fixed here.

  1. The class that the IsSupported tests were in is marked [ConditionalClass(typeof(MLKem), nameof(MLKem.IsSupported))]. This means we only tested the IsSupported property when it was actually true. We never asserted that it should be true when it was actually false.

  2. Azure Linux's SymCrypt-OpenSSL 1.10 package is going to light up ML-KEM. The tests keyed off the runtime IsSupported detection 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.

@azure-pipelines

Copy link
Copy Markdown
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.

@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 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 when IsSupported is false.
  • Updates the platform comparison in IsSupported_AgreesWithPlatform to 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

@vcsjones
vcsjones merged commit 5392ef9 into dotnet:main Jul 15, 2026
97 of 99 checks passed
@vcsjones
vcsjones deleted the mlkem-ossl-availability-check branch July 15, 2026 14:35
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 16, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 16, 2026
@PranavSenthilnathan

Copy link
Copy Markdown
Member

/backport to release/10.0

@github-actions github-actions Bot unlocked this conversation Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0 (link to workflow run)

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Security test-enhancement Improvements of test source code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants