Skip to content

Probe for EC explicit curve support when SymCrypt is present - #138026

Merged
vcsjones merged 1 commit into
dotnet:mainfrom
vcsjones:azl-ecc-curves
Nov 21, 2026
Merged

vcsjones merged 1 commit into
dotnet:mainfrom
vcsjones:azl-ecc-curves

Conversation

@vcsjones

Copy link
Copy Markdown
Member

Azure Linux has no precise way for us to understand what way the system is currently configured. The presence of the symcryptopenssl provider does not necessarily mean it is the default provider. Different Azure Linux 4 hosts appear to have different defaults. In container environments it is not the default provider, whereas in some virtual machine configurations, it is.

This impacts our tests because we don't know whether or not the system currently supports explicit curves.

The OpenSSL-y way to figure out what is going to happen is to ask the KEYMGMT APIs what provider is going to answer the call when we say "Please import this EC key". But we don't have that exposed anywhere usefully for tests to consume.

This pull request updates our tests so that explicit curve support is probed if we detect that SCOSSL is present on the system.

Contributes to #137121

@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.

@vcsjones vcsjones added the test-bug Problem in test source code (most likely) label Nov 20, 2026
@vcsjones vcsjones added this to the 12.0.0 milestone Nov 20, 2026
@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.

@vcsjones
vcsjones merged commit e8e8e31 into dotnet:main Nov 21, 2026
71 of 75 checks passed
@vcsjones
vcsjones deleted the azl-ecc-curves branch November 21, 2026 02:26
lewing added a commit that referenced this pull request Nov 24, 2026
…resent (#138078)

Fixes Issue <!-- Issue Number --> N/A (test-only correction);
contributes to #137121.

main PR <!-- Link to PR if any that fixed this in the main branch. -->
#138026

# Description

<!-- Give a brief summary of the issue and how the pull request is
fixing it. -->
Backports e8e8e31 without adaptation.
SymCrypt being installed does not mean OpenSSL selects it for EC
operations. Probe explicit P-256 key import when SymCrypt is present and
share the cached capability result across ECDsa/ECDH test providers.
Changes are limited to three existing test files; no product code
changes.

# Customer Impact

<!-- What is the impact to customers of not taking this fix? -->
No direct customer/product impact. Without this correction, cryptography
tests can incorrectly classify explicit-curve support on Azure Linux
hosts and containers, skipping supported coverage or selecting incorrect
expectations.

# Regression

<!-- Is this fixing a problem that was introduced in the most recent
release, ie., fixing a regression? -->
Test capability-detection bug present on release/11.0. This is not a
product regression fix; the introduction release was not established.

# Testing

<!-- What kind of testing has been done with the fix. -->
`git diff --check` and `git show --format= --check HEAD`: passed. Stable
patch ID and all three resulting files match the source commit.

`dotnet build
src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj
-p:TargetOS=linux -p:TargetArchitecture=arm64`: failed (exit 1) because
the local shared framework/targeting pack prerequisite is missing;
compilation was not verified.

No full clr+libs baseline, test execution, daily-build validation, or
SymCrypt/OpenSSL runtime validation was run locally. PR CI is required
for build and affected test verification.

# Risk

<!-- Please assess the risk of taking this fix. Provide details backing
up your assessment. -->
Low product risk: test-only, exact upstream port, no shipping code or
public API changes. The cached probe imports a public explicit P-256 key
only when SymCrypt is detected; expected unsupported-import exceptions
yield false. Apple-platform exclusions are preserved. Residual risk is
limited to test capability classification and requires CI verification.

# Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet
package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older
versions.

> [!NOTE]
> This PR description was generated by GitHub Copilot.

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Security test-bug Problem in test source code (most likely)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants