dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.29k stars 4.74k forks source link

Test failure System.Security.Cryptography.Cng.Tests.DSACngPkcs8Tests.NoPlaintextExportAllowsEncryptedPkcs8(algorithm: TripleDes3KeyPkcs12) #91860

Open v-wenyuxu opened 1 year ago

v-wenyuxu commented 1 year ago

Run: runtime-coreclr libraries-pgo 20230910.1 Failed in:

net9.0-windows-Release-x86-CoreCLR_checked-fullpgo_random_gdv_edge-Windows.10.Amd64.Open

- System.Security.Cryptography.Cng.Tests.DSACngPkcs8Tests.NoPlaintextExportAllowsEncryptedPkcs8

Error message:

System.Security.Cryptography.CryptographicException : An internal consistency check failed.

Stack trace
   at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Create.cs:line 58
   at System.Security.Cryptography.CngAlgorithmCore.GetOrGenerateKey(Int32 keySize, CngAlgorithm algorithm) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmCore.cs:line 73
   at System.Security.Cryptography.DSACng.get_Key() in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSACng.Key.cs:line 24
   at System.Security.Cryptography.Cng.Tests.DSACngPkcs8Tests.CreateKey(CngKey& cngKey) in /_/src/libraries/System.Security.Cryptography.Cng/tests/DSACngPkcs8Tests.cs:line 13
   at System.Security.Cryptography.Cng.Tests.CngPkcs8Tests`1.NoPlaintextExportAllowsEncryptedPkcs8(PbeEncryptionAlgorithm algorithm) in /_/src/libraries/System.Security.Cryptography.Cng/tests/CngPkcs8Tests.cs:line 64
   at InvokeStub_CngPkcs8Tests`1.NoPlaintextExportAllowsEncryptedPkcs8(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
ghost commented 1 year ago

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones See info in area-owners.md if you want to be subscribed.

Issue Details
Run: [runtime-coreclr libraries-pgo 20230910.1](https://dev.azure.com/dnceng-public/public/_build/results?buildId=401214&view=ms.vss-test-web.build-test-results-tab&runId=8669054&resultId=144932&paneView=debug) Failed in: ``` net9.0-windows-Release-x86-CoreCLR_checked-fullpgo_random_gdv_edge-Windows.10.Amd64.Open - System.Security.Cryptography.Cng.Tests.DSACngPkcs8Tests.NoPlaintextExportAllowsEncryptedPkcs8 ``` **Error message:** ``` System.Security.Cryptography.CryptographicException : An internal consistency check failed. Stack trace at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Create.cs:line 58 at System.Security.Cryptography.CngAlgorithmCore.GetOrGenerateKey(Int32 keySize, CngAlgorithm algorithm) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmCore.cs:line 73 at System.Security.Cryptography.DSACng.get_Key() in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSACng.Key.cs:line 24 at System.Security.Cryptography.Cng.Tests.DSACngPkcs8Tests.CreateKey(CngKey& cngKey) in /_/src/libraries/System.Security.Cryptography.Cng/tests/DSACngPkcs8Tests.cs:line 13 at System.Security.Cryptography.Cng.Tests.CngPkcs8Tests`1.NoPlaintextExportAllowsEncryptedPkcs8(PbeEncryptionAlgorithm algorithm) in /_/src/libraries/System.Security.Cryptography.Cng/tests/CngPkcs8Tests.cs:line 64 at InvokeStub_CngPkcs8Tests`1.NoPlaintextExportAllowsEncryptedPkcs8(Object, Span`1) at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ```
Author: v-wenyuxu
Assignees: -
Labels: `arch-x86`, `area-System.Security`, `os-windows`, `untriaged`, `blocking-clean-ci-optional`
Milestone: -
vcsjones commented 1 year ago

Related to https://github.com/dotnet/runtime/issues/63773.

krwq commented 1 year ago

From info on that thread seems it's most likely some Windows issue which Windows is unwilling to investigate because it doesn't happen on regular customer machines and only repros very rarely during the tests and we're unable to repro. It doesn't seem like there is anything actionable we could do. Let's keep this open for tracking and perhaps we'll eventually find some more clues on what's going on...

VincentBu commented 8 months ago

Failed in: runtime-coreclr libraries-jitstress-random 20240210.1

Failed tests:

net9.0-windows-Release-x86-CoreCLR_checked-jitstress_random_1-Windows.10.Amd64.Open
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.EmptyHashAlgorithm
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc23279TrySignHashUnderMax
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.UnknownHashAlgorithm
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc3279SignatureValidatesLength
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc23279TrySignDataUnderMax
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.BadSignatureFormat
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.NullInputs
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.VerifyInvalidRfc3279Signature

Error message:

 System.TypeInitializationException : The type initializer for 'System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests' threw an exception.
---- System.Security.Cryptography.CryptographicException : An internal consistency check failed.

Stack trace:

    at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.GenerateTestKeys() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 240
   at System.Security.Cryptography.Algorithms.Tests.DsaFamilySignatureFormatTests..ctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DsaFamilySignatureFormatTests.cs:line 36
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests..ctor()
   at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests..ctor()
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) in /_/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs:line 3935
----- Inner Stack Trace -----
   at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Create.cs:line 58
   at System.Security.Cryptography.CngAlgorithmCore.GetOrGenerateKey(Int32 keySize, CngAlgorithm algorithm) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmCore.cs:line 73
   at System.Security.Cryptography.DSACng.ExportKeyBlob(Boolean includePrivateParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSACng.ImportExport.cs:line 15
   at System.Security.Cryptography.DSACng.ExportParameters(Boolean includePrivateParameters) in /_/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs:line 313
   at System.Security.Cryptography.DSAWrapper.ExportParameters(Boolean includePrivateParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSAWrapper.cs:line 21
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.CreateKey(Int32 keySize) in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 33
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.LocalGenerateTestKeys()+MoveNext() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 58
   at System.Linq.Enumerable.<ToArray>g__EnumerableToArray|296_0[TSource](IEnumerable`1 source) in /_/src/libraries/System.Linq/src/System/Linq/ToCollection.cs:line 45
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) in /_/src/libraries/System.Linq/src/System/Linq/ToCollection.cs:line 37
   at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests..cctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 238
v-wenyuxu commented 8 months ago

Failed in: runtime-coreclr libraries-jitstress 20240306.2

Failed tests:

net9.0-windows-Release-x86-CoreCLR_checked-disabler2r-Windows.10.Amd64.Open
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc23279TrySignHashUnderMax
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.UnknownHashAlgorithm
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc23279TrySignDataUnderMax
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.EmptyHashAlgorithm
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.VerifyInvalidRfc3279Signature
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.NullInputs
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc3279SignatureValidatesLength
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.BadSignatureFormat

Error message:

 System.TypeInitializationException : The type initializer for 'System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests' threw an exception.
---- System.Security.Cryptography.CryptographicException : An internal consistency check failed.

Stack trace:

   at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.GenerateTestKeys() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 240
   at System.Security.Cryptography.Algorithms.Tests.DsaFamilySignatureFormatTests..ctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DsaFamilySignatureFormatTests.cs:line 36
   at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests..ctor()
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) in /_/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs:line 3927
----- Inner Stack Trace -----
   at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Create.cs:line 58
   at System.Security.Cryptography.CngAlgorithmCore.GetOrGenerateKey(Int32 keySize, CngAlgorithm algorithm) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmCore.cs:line 73
   at System.Security.Cryptography.DSACng.ExportKeyBlob(Boolean includePrivateParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSACng.ImportExport.cs:line 15
   at System.Security.Cryptography.DSACng.ExportParameters(Boolean includePrivateParameters) in /_/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs:line 313
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.CreateKey(Int32 keySize) in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 33
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.LocalGenerateTestKeys()+MoveNext() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 58
   at System.Linq.Enumerable.<ToArray>g__EnumerableToArray|313_0[TSource](IEnumerable`1 source) in /_/src/libraries/System.Linq/src/System/Linq/ToCollection.cs:line 47
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) in /_/src/libraries/System.Linq/src/System/Linq/ToCollection.cs:line 39
   at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests..cctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 238
v-wenyuxu commented 6 months ago

Failed in: runtime-coreclr libraries-jitstress 20240420.1

Failed tests:

net9.0-windows-Release-x64-disabler2r-Windows.10.Amd64.Open
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.BadSignatureFormat
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.Rfc3279SignatureValidatesLength
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.EmptyHashAlgorithm
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.NullInputs
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.VerifyInvalidRfc3279Signature
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.UnknownHashAlgorithm

Error message:

 System.TypeInitializationException : The type initializer for 'System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests' threw an exception.
---- System.Security.Cryptography.CryptographicException : An internal consistency check failed.

Stack trace:

   at System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.GenerateTestKeys() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 75
   at System.Security.Cryptography.Algorithms.Tests.DsaFamilySignatureFormatTests..ctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DsaFamilySignatureFormatTests.cs:line 36
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) in /_/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs:line 3926
----- Inner Stack Trace -----
   at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Create.cs:line 58
   at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Create.cs:line 75
   at System.Security.Cryptography.CngAlgorithmCore.GetOrGenerateKey(Int32 keySize, CngAlgorithm algorithm) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmCore.cs:line 73
   at System.Security.Cryptography.DSACng.ExportKeyBlob(Boolean includePrivateParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSACng.ImportExport.cs:line 15
   at System.Security.Cryptography.DSACng.ExportParameters(Boolean includePrivateParameters) in /_/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs:line 313
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.CreateKey(Int32 keySize) in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 33
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.LocalGenerateTestKeys()+MoveNext() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 58
   at System.Linq.Enumerable.<ToArray>g__EnumerableToArray|314_0[TSource](IEnumerable`1 source) in /_/src/libraries/System.Linq/src/System/Linq/ToCollection.cs:line 39
   at System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests..cctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 73
v-wenyuxu commented 5 months ago

Failed in: runtime-coreclr libraries-jitstressregs 20240521.1

Failed tests:

net9.0-windows-Release-x64-jitstressregs0x1000-Windows.10.Amd64.Open
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.BadSignatureFormat
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.Rfc3279SignatureValidatesLength
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.EmptyHashAlgorithm
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.NullInputs
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.VerifyInvalidRfc3279Signature
    - System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.UnknownHashAlgorithm

Error message:

 System.TypeInitializationException : The type initializer for 'System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests' threw an exception.
---- System.Security.Cryptography.CryptographicException : An internal consistency check failed.

Stack trace:

   at System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests.GenerateTestKeys() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 75
   at System.Security.Cryptography.Algorithms.Tests.DsaFamilySignatureFormatTests..ctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DsaFamilySignatureFormatTests.cs:line 36
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) in /_/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs:line 3935
----- Inner Stack Trace -----
   at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Create.cs:line 58
   at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Create.cs:line 75
   at System.Security.Cryptography.CngAlgorithmCore.GetOrGenerateKey(Int32 keySize, CngAlgorithm algorithm) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmCore.cs:line 73
   at System.Security.Cryptography.DSACng.ExportKeyBlob(Boolean includePrivateParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSACng.ImportExport.cs:line 15
   at System.Security.Cryptography.DSACng.ExportParameters(Boolean includePrivateParameters) in /_/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs:line 313
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.CreateKey(Int32 keySize) in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 33
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.LocalGenerateTestKeys()+MoveNext() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 58
   at System.Linq.Enumerable.<ToArray>g__EnumerableToArray|314_0[TSource](IEnumerable`1 source) in /_/src/libraries/System.Linq/src/System/Linq/ToCollection.cs:line 39
   at System.Security.Cryptography.Dsa.Tests.DsaArraySignatureFormatTests..cctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 73
v-wenyuxu commented 5 months ago

Failed in: runtime-coreclr crossgen2 20240529.1

Failed tests:

net9.0-windows-Release-x64-TestReadyToRun_Release-Windows.81.Amd64.Open
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc23279TrySignHashUnderMax
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.UnknownHashAlgorithm
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc23279TrySignDataUnderMax
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.EmptyHashAlgorithm
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.VerifyInvalidRfc3279Signature
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.NullInputs
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc3279SignatureValidatesLength
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.BadSignatureFormat

Error message:

 System.TypeInitializationException : The type initializer for 'System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests' threw an exception.
---- System.Security.Cryptography.CryptographicException : An internal consistency check failed.

Stack trace:

   at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.GenerateTestKeys() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 240
   at System.Security.Cryptography.Algorithms.Tests.DsaFamilySignatureFormatTests..ctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DsaFamilySignatureFormatTests.cs:line 36
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
----- Inner Stack Trace -----
   at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters)
   at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters)
   at System.Security.Cryptography.CngAlgorithmCore.GetOrGenerateKey(Int32 keySize, CngAlgorithm algorithm)
   at System.Security.Cryptography.DSACng.ExportParameters(Boolean includePrivateParameters)
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.CreateKey(Int32 keySize) in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 33
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.LocalGenerateTestKeys()+MoveNext() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 58
   at System.Linq.Enumerable.<ToArray>g__EnumerableToArray|314_0[TSource](IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests..cctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 238
bartonjs commented 2 months ago

This is https://github.com/dotnet/runtime/issues/29683, but for DSA.

Sometimes CNG just gets into a bad state on a machine.

v-wenyuxu commented 4 weeks ago

Failed in: runtime-coreclr libraries-pgo 20241013.1

Failed tests:

net10.0-windows-Release-x64-jitosr_stress_random-Windows.10.Amd64.Open
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.EmptyHashAlgorithm
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc23279TrySignHashUnderMax
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.UnknownHashAlgorithm
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc3279SignatureValidatesLength
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.Rfc23279TrySignDataUnderMax
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.BadSignatureFormat
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.NullInputs
    - System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.VerifyInvalidRfc3279Signature

Error message:

 System.TypeInitializationException : The type initializer for 'System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests' threw an exception.
---- System.Security.Cryptography.CryptographicException : An internal consistency check failed.

Stack trace:

   at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.GenerateTestKeys() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 240
   at System.Security.Cryptography.Algorithms.Tests.DsaFamilySignatureFormatTests..ctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DsaFamilySignatureFormatTests.cs:line 36
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests..ctor()
   at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests..ctor()
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) in /_/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs:line 3995
----- Inner Stack Trace -----
   at System.Security.Cryptography.CngKey.Create(CngAlgorithm algorithm, String keyName, CngKeyCreationParameters creationParameters) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Create.cs:line 58
   at System.Security.Cryptography.CngAlgorithmCore.GetOrGenerateKey(Int32 keySize, CngAlgorithm algorithm) in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAlgorithmCore.cs:line 73
   at System.Security.Cryptography.DSACng.ExportParameters(Boolean includePrivateParameters) in /_/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs:line 313
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.CreateKey(Int32 keySize) in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 33
   at System.Security.Cryptography.Dsa.Tests.DSASignatureFormatTests.LocalGenerateTestKeys()+MoveNext() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 58
   at System.Linq.Enumerable.<ToArray>g__EnumerableToArray|315_0[TSource](IEnumerable`1 source) in /_/src/libraries/System.Linq/src/System/Linq/ToCollection.cs:line 39
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) in /_/src/libraries/System.Linq/src/System/Linq/ToCollection.cs:line 26
   at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests..cctor() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 238