Skip to content

CryptographicException : An internal consistency check failed. #129684

Description

@VincentBu

Non-actionable Known Build Error. Windows CNG just internally erroring in a way we cannot diagnose.

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 49
   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.RSACng.get_Key() in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSACng.Key.cs:line 24
   at System.Security.Cryptography.RSACng.ExportParameters(Boolean includePrivateParameters) in /_/src/libraries/Common/src/System/Security/Cryptography/RSACng.ImportExport.cs:line 183
   at System.Security.Cryptography.Rsa.Tests.RSAXml.FromToXml() in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/RSAXml.cs:line 989
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in /_/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs:line 37
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57

Known Issue Error Message

DO NOT USE JSON BELOW IF THIS IS A BUILD BREAK otherwise build analysis will allow pull requests to merge that break the build worse. For a build break, do not use this issue form. Make a regular new issue.

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "System.Security.Cryptography.CryptographicException : An internal consistency check failed.",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1474245
Error message validated: [System.Security.Cryptography.CryptographicException : An internal consistency check failed.]
Result validation: ❌ Known issue did not match with the provided build.
Validation performed at: 6/22/2026 3:29:49 PM UTC

Report

Build Repository Test Pull Request
1486923 dotnet/runtime System.Security.Cryptography.Dsa.Tests.DSASignVerify_Span_Cng.InvalidKeySize_DoesNotInvalidateKey #130013

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
1 1 1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions