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

CryptographicException in System.Reflection.PortableExecutable.Tests.PEBuilderTests.Checksum test #70128

Closed
MichalStrehovsky opened this issue Jun 2, 2022 · 2 comments
Labels
area-System.Security blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'

Comments

@MichalStrehovsky
Copy link
Member

Hit in #69132 in the "runtime (Libraries Test Run release coreclr windows x64 Debug)" leg.

Affected pipelines run: https://dev.azure.com/dnceng/public/_build/results?buildId=1801955&view=logs&jobId=55b384d0-d6b0-5894-fd8a-d754d713246e

----- start 02/06/2022  4:28:18,32 ===============  To repro directly: ===================================================== 
pushd C:\h\w\AA80094C\w\AF830990\e\
"C:\h\w\AA80094C\p\dotnet.exe" exec --runtimeconfig System.Reflection.Metadata.Tests.runtimeconfig.json --depsfile System.Reflection.Metadata.Tests.deps.json xunit.console.dll System.Reflection.Metadata.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing 
popd
===========================================================================================================

C:\h\w\AA80094C\w\AF830990\e>"C:\h\w\AA80094C\p\dotnet.exe" exec --runtimeconfig System.Reflection.Metadata.Tests.runtimeconfig.json --depsfile System.Reflection.Metadata.Tests.deps.json xunit.console.dll System.Reflection.Metadata.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: System.Reflection.Metadata.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Reflection.Metadata.Tests (found 499 of 503 test cases)
  Starting:    System.Reflection.Metadata.Tests (parallel test collections = on, max threads = 2)
    System.Reflection.PortableExecutable.Tests.PEBuilderTests.Checksum [FAIL]
      System.Security.Cryptography.CryptographicException : No hay m�s extremos disponibles desde el asignador de extremos.
      Stack Trace:
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngHelpers.cs(32,0): at System.Security.Cryptography.CngHelpers.OpenStorageProvider(CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(124,0): at System.Security.Cryptography.CngKey.Import(ReadOnlySpan`1 keyBlob, String curveName, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(112,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, String curveName, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(41,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(30,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, CngKeyBlobFormat format)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSACng.ImportExport.cs(22,0): at System.Security.Cryptography.RSACng.ImportKeyBlob(Byte[] rsaBlob, Boolean includePrivate)
        /_/src/libraries/Common/src/System/Security/Cryptography/RSACng.ImportExport.cs(135,0): at System.Security.Cryptography.RSACng.ImportParameters(RSAParameters parameters)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAWrapper.cs(49,0): at System.Security.Cryptography.RSAWrapper.ImportParameters(RSAParameters parameters)
        /_/src/libraries/System.Reflection.Metadata/tests/TestUtilities/SigningUtilities.cs(20,0): at System.Reflection.PortableExecutable.Tests.SigningUtilities.CalculateRsaSignature(IEnumerable`1 content, Byte[] privateKey)
        /_/src/libraries/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs(823,0): at System.Reflection.PortableExecutable.Tests.PEBuilderTests.TestChecksumAndAuthenticodeSignature(Stream peStream, Byte[] privateKeyOpt)
        /_/src/libraries/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs(755,0): at System.Reflection.PortableExecutable.Tests.PEBuilderTests.Checksum()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(64,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Reflection.PortableExecutable.Tests.PEBuilderTests.BasicValidationSigned [FAIL]
      System.Security.Cryptography.CryptographicException : No hay m�s extremos disponibles desde el asignador de extremos.
      Stack Trace:
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngHelpers.cs(32,0): at System.Security.Cryptography.CngHelpers.OpenStorageProvider(CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(124,0): at System.Security.Cryptography.CngKey.Import(ReadOnlySpan`1 keyBlob, String curveName, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(112,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, String curveName, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(41,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(30,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, CngKeyBlobFormat format)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSACng.ImportExport.cs(22,0): at System.Security.Cryptography.RSACng.ImportKeyBlob(Byte[] rsaBlob, Boolean includePrivate)
        /_/src/libraries/Common/src/System/Security/Cryptography/RSACng.ImportExport.cs(135,0): at System.Security.Cryptography.RSACng.ImportParameters(RSAParameters parameters)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAWrapper.cs(49,0): at System.Security.Cryptography.RSAWrapper.ImportParameters(RSAParameters parameters)
        /_/src/libraries/System.Reflection.Metadata/tests/TestUtilities/SigningUtilities.cs(20,0): at System.Reflection.PortableExecutable.Tests.SigningUtilities.CalculateRsaSignature(IEnumerable`1 content, Byte[] privateKey)
        /_/src/libraries/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs(93,0): at System.Reflection.PortableExecutable.Tests.PEBuilderTests.<>c__DisplayClass4_0.<WritePEImage>b__0(IEnumerable`1 content)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEBuilder.cs(496,0): at System.Reflection.PortableExecutable.PEBuilder.Sign(BlobBuilder peImage, Blob strongNameSignatureFixup, Func`2 signatureProvider)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/ManagedPEBuilder.cs(239,0): at System.Reflection.PortableExecutable.ManagedPEBuilder.Sign(BlobBuilder peImage, Func`2 signatureProvider)
        /_/src/libraries/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs(93,0): at System.Reflection.PortableExecutable.Tests.PEBuilderTests.WritePEImage(Stream peStream, MetadataBuilder metadataBuilder, BlobBuilder ilBuilder, MethodDefinitionHandle entryPointHandle, Blob mvidFixup, Byte[] privateKeyOpt, Boolean publicSigned, Machine machine, BlobBuilder mappedFieldData)
        /_/src/libraries/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs(147,0): at System.Reflection.PortableExecutable.Tests.PEBuilderTests.BasicValidationSigned()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(64,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
  Finished:    System.Reflection.Metadata.Tests
=== TEST EXECUTION SUMMARY ===
   System.Reflection.Metadata.Tests  Total: 594, Errors: 0, Failed: 2, Skipped: 0, Time: 5,691s
@MichalStrehovsky MichalStrehovsky added area-System.Security blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' labels Jun 2, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jun 2, 2022
@ghost
Copy link

ghost commented Jun 2, 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

Hit in #69132 in the "runtime (Libraries Test Run release coreclr windows x64 Debug)" leg.

Affected pipelines run: https://dev.azure.com/dnceng/public/_build/results?buildId=1801955&view=logs&jobId=55b384d0-d6b0-5894-fd8a-d754d713246e

----- start 02/06/2022  4:28:18,32 ===============  To repro directly: ===================================================== 
pushd C:\h\w\AA80094C\w\AF830990\e\
"C:\h\w\AA80094C\p\dotnet.exe" exec --runtimeconfig System.Reflection.Metadata.Tests.runtimeconfig.json --depsfile System.Reflection.Metadata.Tests.deps.json xunit.console.dll System.Reflection.Metadata.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing 
popd
===========================================================================================================

C:\h\w\AA80094C\w\AF830990\e>"C:\h\w\AA80094C\p\dotnet.exe" exec --runtimeconfig System.Reflection.Metadata.Tests.runtimeconfig.json --depsfile System.Reflection.Metadata.Tests.deps.json xunit.console.dll System.Reflection.Metadata.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: System.Reflection.Metadata.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Reflection.Metadata.Tests (found 499 of 503 test cases)
  Starting:    System.Reflection.Metadata.Tests (parallel test collections = on, max threads = 2)
    System.Reflection.PortableExecutable.Tests.PEBuilderTests.Checksum [FAIL]
      System.Security.Cryptography.CryptographicException : No hay m�s extremos disponibles desde el asignador de extremos.
      Stack Trace:
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngHelpers.cs(32,0): at System.Security.Cryptography.CngHelpers.OpenStorageProvider(CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(124,0): at System.Security.Cryptography.CngKey.Import(ReadOnlySpan`1 keyBlob, String curveName, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(112,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, String curveName, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(41,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(30,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, CngKeyBlobFormat format)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSACng.ImportExport.cs(22,0): at System.Security.Cryptography.RSACng.ImportKeyBlob(Byte[] rsaBlob, Boolean includePrivate)
        /_/src/libraries/Common/src/System/Security/Cryptography/RSACng.ImportExport.cs(135,0): at System.Security.Cryptography.RSACng.ImportParameters(RSAParameters parameters)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAWrapper.cs(49,0): at System.Security.Cryptography.RSAWrapper.ImportParameters(RSAParameters parameters)
        /_/src/libraries/System.Reflection.Metadata/tests/TestUtilities/SigningUtilities.cs(20,0): at System.Reflection.PortableExecutable.Tests.SigningUtilities.CalculateRsaSignature(IEnumerable`1 content, Byte[] privateKey)
        /_/src/libraries/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs(823,0): at System.Reflection.PortableExecutable.Tests.PEBuilderTests.TestChecksumAndAuthenticodeSignature(Stream peStream, Byte[] privateKeyOpt)
        /_/src/libraries/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs(755,0): at System.Reflection.PortableExecutable.Tests.PEBuilderTests.Checksum()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(64,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Reflection.PortableExecutable.Tests.PEBuilderTests.BasicValidationSigned [FAIL]
      System.Security.Cryptography.CryptographicException : No hay m�s extremos disponibles desde el asignador de extremos.
      Stack Trace:
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngHelpers.cs(32,0): at System.Security.Cryptography.CngHelpers.OpenStorageProvider(CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(124,0): at System.Security.Cryptography.CngKey.Import(ReadOnlySpan`1 keyBlob, String curveName, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(112,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, String curveName, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(41,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, CngKeyBlobFormat format, CngProvider provider)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.Import.cs(30,0): at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, CngKeyBlobFormat format)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSACng.ImportExport.cs(22,0): at System.Security.Cryptography.RSACng.ImportKeyBlob(Byte[] rsaBlob, Boolean includePrivate)
        /_/src/libraries/Common/src/System/Security/Cryptography/RSACng.ImportExport.cs(135,0): at System.Security.Cryptography.RSACng.ImportParameters(RSAParameters parameters)
        /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAWrapper.cs(49,0): at System.Security.Cryptography.RSAWrapper.ImportParameters(RSAParameters parameters)
        /_/src/libraries/System.Reflection.Metadata/tests/TestUtilities/SigningUtilities.cs(20,0): at System.Reflection.PortableExecutable.Tests.SigningUtilities.CalculateRsaSignature(IEnumerable`1 content, Byte[] privateKey)
        /_/src/libraries/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs(93,0): at System.Reflection.PortableExecutable.Tests.PEBuilderTests.<>c__DisplayClass4_0.<WritePEImage>b__0(IEnumerable`1 content)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEBuilder.cs(496,0): at System.Reflection.PortableExecutable.PEBuilder.Sign(BlobBuilder peImage, Blob strongNameSignatureFixup, Func`2 signatureProvider)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/ManagedPEBuilder.cs(239,0): at System.Reflection.PortableExecutable.ManagedPEBuilder.Sign(BlobBuilder peImage, Func`2 signatureProvider)
        /_/src/libraries/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs(93,0): at System.Reflection.PortableExecutable.Tests.PEBuilderTests.WritePEImage(Stream peStream, MetadataBuilder metadataBuilder, BlobBuilder ilBuilder, MethodDefinitionHandle entryPointHandle, Blob mvidFixup, Byte[] privateKeyOpt, Boolean publicSigned, Machine machine, BlobBuilder mappedFieldData)
        /_/src/libraries/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs(147,0): at System.Reflection.PortableExecutable.Tests.PEBuilderTests.BasicValidationSigned()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(64,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
  Finished:    System.Reflection.Metadata.Tests
=== TEST EXECUTION SUMMARY ===
   System.Reflection.Metadata.Tests  Total: 594, Errors: 0, Failed: 2, Skipped: 0, Time: 5,691s
Author: MichalStrehovsky
Assignees: -
Labels:

area-System.Security, blocking-clean-ci

Milestone: -

@bartonjs
Copy link
Member

bartonjs commented Jul 6, 2022

Duplicate of the uber-issue in #70320.

@bartonjs bartonjs closed this as completed Jul 6, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 6, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Security blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Projects
None yet
Development

No branches or pull requests

2 participants