-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Change some tests to be conditional on the availability of SCOSSL #118663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
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 refactors cryptography tests to condition behavior on the actual availability of SCOSSL (SymCrypt-OpenSSL) rather than assuming it's present on Azure Linux. This improves test accuracy since Azure Linux can run with vanilla OpenSSL if the SymCrypt-OpenSSL package is uninstalled.
Key changes:
- Introduces
IsSymCryptOpenSsl
platform detection by checking for SymCrypt provider module files - Replaces
IsAzureLinux
checks withIsSymCryptOpenSsl
checks in cryptographic algorithm tests - Maintains some Azure Linux-specific conditions for features like ChaCha20Poly1305 that are affected by Azure Linux's OpenSSL build patches
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
PlatformDetection.Unix.cs | Adds new IsSymCryptOpenSsl detection logic that checks for SymCrypt provider module files |
KmacTestDriver.cs | Updates key size requirements check from Azure Linux to SymCrypt detection |
HmacMD5Tests.cs | Changes MD5 support detection from Azure Linux to SymCrypt detection |
HKDFTests.cs | Updates MD5 and empty key support checks to use SymCrypt detection |
DefaultECDsaProvider.Unix.cs | Changes explicit curves support check from Azure Linux to SymCrypt detection |
DefaultECDiffieHellmanProvider.Unix.cs | Updates explicit curves support check to use SymCrypt detection |
EcDsaOpenSslProvider.cs | Simplifies explicit curves support check using new SymCrypt detection |
KeyGeneration.cs | Updates RSA key generation tests to use SymCrypt detection |
ECDsaFactory.cs | Changes explicit curves failure condition to use SymCrypt detection |
ECDiffieHellmanFactory.cs | Updates explicit curves failure condition to use SymCrypt detection |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones |
src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo one incorrectly cased letter.
Some of our cryptography tests are conditioned on whether or not they are running on Azure Linux, which by default uses SCOSSL for cryptographic algorithms. This is not guaranteed though - using vanilla OpenSSL on Azure Linux is possible simply by uninstalling the SymCrypt-OpenSSL package.
In this case, our tests would fail because they are assuming the environment is using SCOSSL when it is really using OpenSSL.
n.b. not all of our tests can be conditioned on if SCOSSL is the default OpenSSL provider. Azure Linux itself applies some patches when building OpenSSL. A notable example is they compile OpenSSL with
-no-chacha
. That means that regardless of the OpenSSL provider, ChaCha20Poly1305 will not be available. So some tests remain conditioned onIsAzureLinux
, notIsSymCryptOpenSsl
.With

SymCrypt-OpenSSL
package present:Without

SymCrypt-OpenSSL
package present:Fixes #118656