Skip to content

Commit 82c847d

Browse files
PR feedback
1 parent 927d8a5 commit 82c847d

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/MLDsa/MLDsaTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ public static void IsSupported_AgreesWithPlatform()
3232
Assert.Equal(PlatformSupportsMLDsa(), MLDsa.IsSupported);
3333
}
3434

35-
private static bool PlatformSupportsMLDsa()
36-
=> PlatformDetection.IsOpenSslSupported && PlatformDetection.OpenSslVersion >= new Version(3, 5);
35+
private static bool PlatformSupportsMLDsa() => PlatformDetection.IsOpenSsl3_5;
3736

3837
[Fact]
3938
public static void DisposeIsCalledOnImplementation()

src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/SlhDsa/SlhDsaPlatformTests.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@ public static void IsSupported_AgreesWithPlatform()
1414
Assert.Equal(PlatformSupportsSlhDsa(), SlhDsa.IsSupported);
1515
}
1616

17-
private static bool PlatformSupportsSlhDsa()
18-
{
19-
if (PlatformDetection.IsOpenSsl3_5)
20-
{
21-
return true;
22-
}
23-
24-
return false;
25-
}
17+
private static bool PlatformSupportsSlhDsa() => PlatformDetection.IsOpenSsl3_5;
2618

2719
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
2820
public static void IsSupported_InitializesCrypto()

src/libraries/Common/tests/System/Security/Cryptography/MLKemImplementationTests.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ public static void IsSupported_AgreesWithPlatform()
5353
Assert.Equal(PlatformSupportsMLKem(), MLKem.IsSupported);
5454
}
5555

56-
private static bool PlatformSupportsMLKem()
57-
{
58-
if (PlatformDetection.IsOpenSsl3_5)
59-
{
60-
return true;
61-
}
62-
63-
return false;
64-
}
56+
private static bool PlatformSupportsMLKem() => PlatformDetection.IsOpenSsl3_5;
6557
}
6658
}

src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_slh_dsa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ int32_t CryptoNative_SlhDsaGetPalId(const EVP_PKEY* pKey, int32_t* slhDsaTypeId)
214214
{
215215
ERR_clear_error();
216216

217-
// TODO: This conditional chain seems unavoidable. If there are multiple synonyms for a given key,
217+
// This conditional chain seems unavoidable. If there are multiple synonyms for a given key,
218218
// then the provider determines which one will be returned from EVP_PKEY_get0_type_name.
219-
// We don't have to worry about this if we use EVP_PKEY_is_a check instead.
219+
// We use EVP_PKEY_is_a here instead to avoid this issue.
220220
if (EVP_PKEY_is_a(pKey, "SLH-DSA-SHA2-128s"))
221221
{
222222
*slhDsaTypeId = PalSlhDsaId_Sha2_128s;

0 commit comments

Comments
 (0)