Skip to content
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

[release/7.0] CI failure: RsaCryptRoundtrip_OaepSHA256 CryptographicException "Unknown error" #78336

Closed
carlossanlop opened this issue Nov 14, 2022 · 2 comments

Comments

@carlossanlop
Copy link
Member

Found in this unrelated release/7.0 PR: #78250

===========================================================================================================

C:\helix\work\workitem\e>"C:\helix\work\correlation\dotnet.exe" exec --runtimeconfig System.Security.Cryptography.Cng.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.Cng.Tests.deps.json xunit.console.dll System.Security.Cryptography.Cng.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: System.Security.Cryptography.Cng.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Security.Cryptography.Cng.Tests (found 1049 of 1208 test cases)
  Starting:    System.Security.Cryptography.Cng.Tests (parallel test collections = on, max threads = 2)
    System.Security.Cryptography.Rsa.Tests.KeyGeneration.GenerateMaxKey [SKIP]
      Condition(s) not met: "IsStressModeEnabled"
    System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_AllocatingSpan.RsaCryptRoundtrip_OaepSHA256 [FAIL]
      System.Security.Cryptography.CryptographicException : Unknown error (0xc0000001)
      Stack Trace:
        /_/src/libraries/Common/src/System/Security/Cryptography/RSACng.EncryptDecrypt.cs(278,0): at System.Security.Cryptography.RSACng.TryEncryptOrDecrypt(SafeNCryptKeyHandle key, ReadOnlySpan`1 input, Span`1 output, AsymmetricPaddingMode paddingMode, Void* paddingInfo, Boolean encrypt, Int32& bytesWritten)
        /_/src/libraries/Common/src/System/Security/Cryptography/RSACng.EncryptDecrypt.cs(185,0): at System.Security.Cryptography.RSACng.TryEncryptOrDecrypt(ReadOnlySpan`1 data, Span`1 destination, RSAEncryptionPadding padding, Boolean encrypt, Int32& bytesWritten)
        /_/src/libraries/Common/src/System/Security/Cryptography/RSACng.EncryptDecrypt.cs(33,0): at System.Security.Cryptography.RSACng.TryDecrypt(ReadOnlySpan`1 data, Span`1 destination, RSAEncryptionPadding padding, Int32& bytesWritten)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.cs(231,0): at System.Security.Cryptography.RSA.<Decrypt>g__TryWithDecrypt|16_0(RSA rsa, ReadOnlySpan`1 input, Byte[] destination, RSAEncryptionPadding padding, Int32& bytesWritten)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.cs(1414,0): at System.Security.Cryptography.RSA.TryWithKeyBuffer[TState](ReadOnlySpan`1 input, TState state, TryFunc`1 callback, Boolean tryKeySizeFirst)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.cs(234,0): at System.Security.Cryptography.RSA.Decrypt(ReadOnlySpan`1 data, RSAEncryptionPadding padding)
        /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/EncryptDecrypt.netcoreapp.cs(45,0): at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_AllocatingSpan.Decrypt(RSA rsa, Byte[] data, RSAEncryptionPadding padding)
        /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/EncryptDecrypt.cs(334,0): at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.RsaCryptRoundtrip(RSAEncryptionPadding paddingMode, Boolean expectSuccess)
        /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/EncryptDecrypt.cs(308,0): at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.RsaCryptRoundtrip_OaepSHA256()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(69,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Security.Cryptography.Encryption.TripleDes.Tests.TripleDESContractTests.Windows7DoesNotSupportCFB64 [SKIP]
      Condition(s) not met: "IsWindows7"
    System.Security.Cryptography.Encryption.Aes.Tests.AesModeTests.Windows7DoesNotSupportCFB128 [SKIP]
      Condition(s) not met: "IsWindows7"
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Stream.SignHash_DifferentHashes(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Stream.SignHash_Roundtrip(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Stream.SignHash_TamperedSignature(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Array.SignHash_DifferentHashes(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Array.SignHash_TamperedSignature(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Array.SignHash_Roundtrip(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
  Finished:    System.Security.Cryptography.Cng.Tests
=== TEST EXECUTION SUMMARY ===
   System.Security.Cryptography.Cng.Tests  Total: 2801, Errors: 0, Failed: 1, Skipped: 9, Time: 34.374s
----- end Fri 11/11/2022 23:44:21.07 ----- exit code 1 ----------------------------------------------------------
{
  "ErrorMessage": "CryptographicException : Unknown error (0xc0000001)",
  "BuildRetry": false
}
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 14, 2022
@ghost
Copy link

ghost commented Nov 14, 2022

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

Issue Details

Found in this unrelated release/7.0 PR: #78250

===========================================================================================================

C:\helix\work\workitem\e>"C:\helix\work\correlation\dotnet.exe" exec --runtimeconfig System.Security.Cryptography.Cng.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.Cng.Tests.deps.json xunit.console.dll System.Security.Cryptography.Cng.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: System.Security.Cryptography.Cng.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Security.Cryptography.Cng.Tests (found 1049 of 1208 test cases)
  Starting:    System.Security.Cryptography.Cng.Tests (parallel test collections = on, max threads = 2)
    System.Security.Cryptography.Rsa.Tests.KeyGeneration.GenerateMaxKey [SKIP]
      Condition(s) not met: "IsStressModeEnabled"
    System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_AllocatingSpan.RsaCryptRoundtrip_OaepSHA256 [FAIL]
      System.Security.Cryptography.CryptographicException : Unknown error (0xc0000001)
      Stack Trace:
        /_/src/libraries/Common/src/System/Security/Cryptography/RSACng.EncryptDecrypt.cs(278,0): at System.Security.Cryptography.RSACng.TryEncryptOrDecrypt(SafeNCryptKeyHandle key, ReadOnlySpan`1 input, Span`1 output, AsymmetricPaddingMode paddingMode, Void* paddingInfo, Boolean encrypt, Int32& bytesWritten)
        /_/src/libraries/Common/src/System/Security/Cryptography/RSACng.EncryptDecrypt.cs(185,0): at System.Security.Cryptography.RSACng.TryEncryptOrDecrypt(ReadOnlySpan`1 data, Span`1 destination, RSAEncryptionPadding padding, Boolean encrypt, Int32& bytesWritten)
        /_/src/libraries/Common/src/System/Security/Cryptography/RSACng.EncryptDecrypt.cs(33,0): at System.Security.Cryptography.RSACng.TryDecrypt(ReadOnlySpan`1 data, Span`1 destination, RSAEncryptionPadding padding, Int32& bytesWritten)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.cs(231,0): at System.Security.Cryptography.RSA.<Decrypt>g__TryWithDecrypt|16_0(RSA rsa, ReadOnlySpan`1 input, Byte[] destination, RSAEncryptionPadding padding, Int32& bytesWritten)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.cs(1414,0): at System.Security.Cryptography.RSA.TryWithKeyBuffer[TState](ReadOnlySpan`1 input, TState state, TryFunc`1 callback, Boolean tryKeySizeFirst)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.cs(234,0): at System.Security.Cryptography.RSA.Decrypt(ReadOnlySpan`1 data, RSAEncryptionPadding padding)
        /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/EncryptDecrypt.netcoreapp.cs(45,0): at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_AllocatingSpan.Decrypt(RSA rsa, Byte[] data, RSAEncryptionPadding padding)
        /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/EncryptDecrypt.cs(334,0): at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.RsaCryptRoundtrip(RSAEncryptionPadding paddingMode, Boolean expectSuccess)
        /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/EncryptDecrypt.cs(308,0): at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.RsaCryptRoundtrip_OaepSHA256()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(69,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Security.Cryptography.Encryption.TripleDes.Tests.TripleDESContractTests.Windows7DoesNotSupportCFB64 [SKIP]
      Condition(s) not met: "IsWindows7"
    System.Security.Cryptography.Encryption.Aes.Tests.AesModeTests.Windows7DoesNotSupportCFB128 [SKIP]
      Condition(s) not met: "IsWindows7"
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Stream.SignHash_DifferentHashes(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Stream.SignHash_Roundtrip(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Stream.SignHash_TamperedSignature(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Array.SignHash_DifferentHashes(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Array.SignHash_TamperedSignature(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
    System.Security.Cryptography.EcDsa.Tests.ECDsaTests_Array.SignHash_Roundtrip(ecdsa: ECDsaCng { HashAlgorithm = SHA256, Key = CngKey { Algorithm = ECDSA_P521, AlgorithmGroup = ECDSA, ExportPolicy = AllowPlaintextExport, Handle = SafeNCryptKeyHandle { ... }, IsEphemeral = True, ... }, KeyExchangeAlgorithm = null, KeySize = 521, LegalKeySizes = [KeySizes { ... }, KeySizes { ... }], ... }) [SKIP]
      SignHash not implemented.
  Finished:    System.Security.Cryptography.Cng.Tests
=== TEST EXECUTION SUMMARY ===
   System.Security.Cryptography.Cng.Tests  Total: 2801, Errors: 0, Failed: 1, Skipped: 9, Time: 34.374s
----- end Fri 11/11/2022 23:44:21.07 ----- exit code 1 ----------------------------------------------------------
{
  "ErrorMessage": "CryptographicException : Unknown error (0xc0000001)",
  "BuildRetry": false
}
Author: carlossanlop
Assignees: -
Labels:

area-System.Security, test-failure

Milestone: -

@vcsjones
Copy link
Member

Duplicate of #29683

@vcsjones vcsjones marked this as a duplicate of #29683 Nov 14, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Nov 14, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Dec 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants