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

[7.0] [Android] Test failure in X509Certificates.Tests.PfxTests - Algorithm 'RC2' is not supported on this platform #88747

Closed
carlossanlop opened this issue Jul 12, 2023 · 2 comments
Labels
area-System.Security blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab os-android
Milestone

Comments

@carlossanlop
Copy link
Member

carlossanlop commented Jul 12, 2023

Error Blob

{
  "ErrorMessage": "Algorithm 'RC2' is not supported on this platform",
  "BuildRetry": false,
  "ErrorPattern": "",
  "ExcludeConsoleLog": false
}

Reproduction Steps

07-12 04:41:05.016 11331 11351 I DOTNET  : Failed tests:
07-12 04:41:05.037 11331 11351 I DOTNET  : 1) 	[FAIL] System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestIterationCounter   Test name: System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestIterationCounter(name: "Pkcs12MacosKeychainCreated", usesPbes2: False, blob: [48, 130, 9, 182, 2, ...], iterationCount: 4097)   Test case: System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestIterationCounter
07-12 04:41:05.037 11331 11351 I DOTNET  :    Assembly:  [System.Security.Cryptography.X509Certificates.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
07-12 04:41:05.037 11331 11351 I DOTNET  :    Exception messages: System.Exception : There's an error on certificate Pkcs12MacosKeychainCreated, see inner exception for details
07-12 04:41:05.037 11331 11351 I DOTNET  : ---- System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.   Exception stack traces:    at System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestIterationCounter(String name, Boolean usesPbes2, Byte[] blob, Int32 iterationCount) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxTests.cs:line 487
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
07-12 04:41:05.037 11331 11351 I DOTNET  : ----- Inner Stack Trace -----
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.CreateRC2()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.DecryptContentInfo(ContentInfoAsn contentInfo, UInt32& iterations)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.CountTotalIterations()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.GetIterationCount(ReadOnlySpan`1 pkcs12)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestIterationCounter(String name, Boolean usesPbes2, Byte[] blob, Int32 iterationCount) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxTests.cs:line 482
07-12 04:41:05.037 11331 11351 I DOTNET  :    Execution time: 0.0396158
07-12 04:41:05.037 11331 11351 I DOTNET  : 2) 	[FAIL] System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2.Import_IterationCounLimitNotExceeded_Succeeds   Test name: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2.Import_IterationCounLimitNotExceeded_Succeeds(name: "Pkcs12MacosKeychainCreated", usesPbes2: False, blob: [48, 130, 9, 182, 2, ...], iterationCount: 4097)   Test case: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2.Import_IterationCounLimitNotExceeded_Succeeds
07-12 04:41:05.037 11331 11351 I DOTNET  :    Assembly:  [System.Security.Cryptography.X509Certificates.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
07-12 04:41:05.037 11331 11351 I DOTNET  :    Exception messages: System.Security.Cryptography.CryptographicException : PKCS12 (PFX) without a supplied password has exceeded maximum allowed iterations. See https://go.microsoft.com/fwlink/?linkid=2233907 for more information.
07-12 04:41:05.037 11331 11351 I DOTNET  : ---- System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.   Exception stack traces:    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, Boolean readingFromFile, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.CertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(ReadOnlySpan`1 data)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] data)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2.Import(Byte[] blob) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.X509Certificate2.cs:line 9
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests.Import_IterationCounLimitNotExceeded_Succeeds(String name, Boolean usesPbes2, Byte[] blob, Int64 iterationCount) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.cs:line 34
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
07-12 04:41:05.037 11331 11351 I DOTNET  : ----- Inner Stack Trace -----
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.CreateRC2()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.DecryptContentInfo(ContentInfoAsn contentInfo, UInt32& iterations)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.CountTotalIterations()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.GetIterationCount(ReadOnlySpan`1 pkcs12)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.037 11331 11351 I DOTNET  :    Execution time: 0.0029499
07-12 04:41:05.037 11331 11351 I DOTNET  : 3) 	[FAIL] System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.Import_IterationCounLimitNotExceeded_Succeeds   Test name: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.Import_IterationCounLimitNotExceeded_Succeeds(name: "Pkcs12MacosKeychainCreated", usesPbes2: False, blob: [48, 130, 9, 182, 2, ...], iterationCount: 4097)   Test case: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.Import_IterationCounLimitNotExceeded_Succeeds
07-12 04:41:05.037 11331 11351 I DOTNET  :    Assembly:  [System.Security.Cryptography.X509Certificates.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
07-12 04:41:05.037 11331 11351 I DOTNET  :    Exception messages: System.Security.Cryptography.CryptographicException : PKCS12 (PFX) without a supplied password has exceeded maximum allowed iterations. See https://go.microsoft.com/fwlink/?linkid=2233907 for more information.
07-12 04:41:05.037 11331 11351 I DOTNET  : ---- System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.   Exception stack traces:    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.StorePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, Boolean readingFromFile, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.StorePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate2Collection.Import(ReadOnlySpan`1 rawData)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate2Collection.Import(Byte[] rawData)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.Import(Byte[] blob) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.X509Certificate2Collection.cs:line 11
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests.Import_IterationCounLimitNotExceeded_Succeeds(String name, Boolean usesPbes2, Byte[] blob, Int64 iterationCount) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.cs:line 34
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
07-12 04:41:05.037 11331 11351 I DOTNET  : ----- Inner Stack Trace -----
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.CreateRC2()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.DecryptContentInfo(ContentInfoAsn contentInfo, UInt32& iterations)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.CountTotalIterations()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.GetIterationCount(ReadOnlySpan`1 pkcs12)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.037 11331 11351 I DOTNET  :    Execution time: 0.0006872
07-12 04:41:05.038 11331 11351 I DOTNET  : 4) 	[FAIL] System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate.Import_IterationCounLimitNotExceeded_Succeeds   Test name: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate.Import_IterationCounLimitNotExceeded_Succeeds(name: "Pkcs12MacosKeychainCreated", usesPbes2: False, blob: [48, 130, 9, 182, 2, ...], iterationCount: 4097)   Test case: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate.Import_IterationCounLimitNotExceeded_Succeeds
07-12 04:41:05.038 11331 11351 I DOTNET  :    Assembly:  [System.Security.Cryptography.X509Certificates.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
07-12 04:41:05.038 11331 11351 I DOTNET  :    Exception messages: System.Security.Cryptography.CryptographicException : PKCS12 (PFX) without a supplied password has exceeded maximum allowed iterations. See https://go.microsoft.com/fwlink/?linkid=2233907 for more information.
07-12 04:41:05.038 11331 11351 I DOTNET  : ---- System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.   Exception stack traces:    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, Boolean readingFromFile, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.CertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(ReadOnlySpan`1 data)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] data)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate.Import(Byte[] blob) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.X509Certificate.cs:line 9
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests.Import_IterationCounLimitNotExceeded_Succeeds(String name, Boolean usesPbes2, Byte[] blob, Int64 iterationCount) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.cs:line 34
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
07-12 04:41:05.038 11331 11351 I DOTNET  : ----- Inner Stack Trace -----
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.CreateRC2()
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.DecryptContentInfo(ContentInfoAsn contentInfo, UInt32& iterations)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.CountTotalIterations()
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.GetIterationCount(ReadOnlySpan`1 pkcs12)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.038 11331 11351 I DOTNET  :    Execution time: 0.0007288
07-12 04:41:05.044 11331 11351 D DOTNET  : assembly_preload_hook: System.Xml.ReaderWriter  /data/user/0/net.dot.System.Security.Cryptography.X509Certificates.Tests/files

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=336356
Error message validated: Algorithm 'RC2' is not supported on this platform
Result validation: ❌ Known issue did not match with the provided build.
Validation performed at: 7/12/2023 4:33:41 PM UTC

Report

Build Definition Test Pull Request
338475 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #87319
338204 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword
338111 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #88811
338000 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #87319
337945 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #87319
337765 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #88787
337634 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword
337208 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #88722
337182 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #87319
336543 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #88633
336542 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword
336405 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #88714
334799 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #88611
336279 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #87319
335920 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword
335676 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #88687
335349 dotnet/runtime System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.ExportedPfxWithNullPassword_DecryptReturnsValidPaddingWithEmptyPassword #88655

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 17 17
@carlossanlop carlossanlop added area-System.Security blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' os-android Known Build Error Use this to report build issues in the .NET Helix tab labels Jul 12, 2023
@carlossanlop carlossanlop added this to the 7.0.x milestone Jul 12, 2023
@ghost
Copy link

ghost commented Jul 12, 2023

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

Error Blob

{
  "ErrorMessage": "Algorithm 'RC2' is not supported on this platform",
  "BuildRetry": false,
  "ErrorPattern": "",
  "ExcludeConsoleLog": true
}

Reproduction Steps

07-12 04:41:05.016 11331 11351 I DOTNET  : Failed tests:
07-12 04:41:05.037 11331 11351 I DOTNET  : 1) 	[FAIL] System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestIterationCounter   Test name: System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestIterationCounter(name: "Pkcs12MacosKeychainCreated", usesPbes2: False, blob: [48, 130, 9, 182, 2, ...], iterationCount: 4097)   Test case: System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestIterationCounter
07-12 04:41:05.037 11331 11351 I DOTNET  :    Assembly:  [System.Security.Cryptography.X509Certificates.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
07-12 04:41:05.037 11331 11351 I DOTNET  :    Exception messages: System.Exception : There's an error on certificate Pkcs12MacosKeychainCreated, see inner exception for details
07-12 04:41:05.037 11331 11351 I DOTNET  : ---- System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.   Exception stack traces:    at System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestIterationCounter(String name, Boolean usesPbes2, Byte[] blob, Int32 iterationCount) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxTests.cs:line 487
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
07-12 04:41:05.037 11331 11351 I DOTNET  : ----- Inner Stack Trace -----
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.CreateRC2()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.DecryptContentInfo(ContentInfoAsn contentInfo, UInt32& iterations)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.CountTotalIterations()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.GetIterationCount(ReadOnlySpan`1 pkcs12)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestIterationCounter(String name, Boolean usesPbes2, Byte[] blob, Int32 iterationCount) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxTests.cs:line 482
07-12 04:41:05.037 11331 11351 I DOTNET  :    Execution time: 0.0396158
07-12 04:41:05.037 11331 11351 I DOTNET  : 2) 	[FAIL] System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2.Import_IterationCounLimitNotExceeded_Succeeds   Test name: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2.Import_IterationCounLimitNotExceeded_Succeeds(name: "Pkcs12MacosKeychainCreated", usesPbes2: False, blob: [48, 130, 9, 182, 2, ...], iterationCount: 4097)   Test case: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2.Import_IterationCounLimitNotExceeded_Succeeds
07-12 04:41:05.037 11331 11351 I DOTNET  :    Assembly:  [System.Security.Cryptography.X509Certificates.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
07-12 04:41:05.037 11331 11351 I DOTNET  :    Exception messages: System.Security.Cryptography.CryptographicException : PKCS12 (PFX) without a supplied password has exceeded maximum allowed iterations. See https://go.microsoft.com/fwlink/?linkid=2233907 for more information.
07-12 04:41:05.037 11331 11351 I DOTNET  : ---- System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.   Exception stack traces:    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, Boolean readingFromFile, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.CertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(ReadOnlySpan`1 data)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] data)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2.Import(Byte[] blob) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.X509Certificate2.cs:line 9
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests.Import_IterationCounLimitNotExceeded_Succeeds(String name, Boolean usesPbes2, Byte[] blob, Int64 iterationCount) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.cs:line 34
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
07-12 04:41:05.037 11331 11351 I DOTNET  : ----- Inner Stack Trace -----
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.CreateRC2()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.DecryptContentInfo(ContentInfoAsn contentInfo, UInt32& iterations)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.CountTotalIterations()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.GetIterationCount(ReadOnlySpan`1 pkcs12)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.037 11331 11351 I DOTNET  :    Execution time: 0.0029499
07-12 04:41:05.037 11331 11351 I DOTNET  : 3) 	[FAIL] System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.Import_IterationCounLimitNotExceeded_Succeeds   Test name: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.Import_IterationCounLimitNotExceeded_Succeeds(name: "Pkcs12MacosKeychainCreated", usesPbes2: False, blob: [48, 130, 9, 182, 2, ...], iterationCount: 4097)   Test case: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.Import_IterationCounLimitNotExceeded_Succeeds
07-12 04:41:05.037 11331 11351 I DOTNET  :    Assembly:  [System.Security.Cryptography.X509Certificates.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
07-12 04:41:05.037 11331 11351 I DOTNET  :    Exception messages: System.Security.Cryptography.CryptographicException : PKCS12 (PFX) without a supplied password has exceeded maximum allowed iterations. See https://go.microsoft.com/fwlink/?linkid=2233907 for more information.
07-12 04:41:05.037 11331 11351 I DOTNET  : ---- System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.   Exception stack traces:    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.StorePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, Boolean readingFromFile, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.StorePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate2Collection.Import(ReadOnlySpan`1 rawData)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate2Collection.Import(Byte[] rawData)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate2Collection.Import(Byte[] blob) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.X509Certificate2Collection.cs:line 11
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests.Import_IterationCounLimitNotExceeded_Succeeds(String name, Boolean usesPbes2, Byte[] blob, Int64 iterationCount) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.cs:line 34
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
07-12 04:41:05.037 11331 11351 I DOTNET  : ----- Inner Stack Trace -----
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.CreateRC2()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.DecryptContentInfo(ContentInfoAsn contentInfo, UInt32& iterations)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.CountTotalIterations()
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.GetIterationCount(ReadOnlySpan`1 pkcs12)
07-12 04:41:05.037 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.037 11331 11351 I DOTNET  :    Execution time: 0.0006872
07-12 04:41:05.038 11331 11351 I DOTNET  : 4) 	[FAIL] System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate.Import_IterationCounLimitNotExceeded_Succeeds   Test name: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate.Import_IterationCounLimitNotExceeded_Succeeds(name: "Pkcs12MacosKeychainCreated", usesPbes2: False, blob: [48, 130, 9, 182, 2, ...], iterationCount: 4097)   Test case: System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate.Import_IterationCounLimitNotExceeded_Succeeds
07-12 04:41:05.038 11331 11351 I DOTNET  :    Assembly:  [System.Security.Cryptography.X509Certificates.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
07-12 04:41:05.038 11331 11351 I DOTNET  :    Exception messages: System.Security.Cryptography.CryptographicException : PKCS12 (PFX) without a supplied password has exceeded maximum allowed iterations. See https://go.microsoft.com/fwlink/?linkid=2233907 for more information.
07-12 04:41:05.038 11331 11351 I DOTNET  : ---- System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.   Exception stack traces:    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, Boolean readingFromFile, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.CertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(ReadOnlySpan`1 data)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] data)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests_X509Certificate.Import(Byte[] blob) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.X509Certificate.cs:line 9
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxIterationCountTests.Import_IterationCounLimitNotExceeded_Succeeds(String name, Boolean usesPbes2, Byte[] blob, Int64 iterationCount) in /_/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxIterationCountTests.cs:line 34
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
07-12 04:41:05.038 11331 11351 I DOTNET  : ----- Inner Stack Trace -----
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.CreateRC2()
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.DecryptContentInfo(ContentInfoAsn contentInfo, UInt32& iterations)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.CountTotalIterations()
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.GetIterationCount(ReadOnlySpan`1 pkcs12)
07-12 04:41:05.038 11331 11351 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate.EnforceIterationCountLimit(ReadOnlySpan`1 pkcs12, Boolean readingFromFile, Boolean passwordProvided)
07-12 04:41:05.038 11331 11351 I DOTNET  :    Execution time: 0.0007288
07-12 04:41:05.044 11331 11351 D DOTNET  : assembly_preload_hook: System.Xml.ReaderWriter  /data/user/0/net.dot.System.Security.Cryptography.X509Certificates.Tests/files
Author: carlossanlop
Assignees: -
Labels:

area-System.Security, blocking-clean-ci, os-android, Known Build Error

Milestone: 7.0.x

@vcsjones
Copy link
Member

vcsjones commented Jul 12, 2023

These tests should probably be marked as conditional with:

[ConditionalFact(typeof(PlatformSupport), nameof(PlatformSupport.IsRC2Supported))]

Android does not support RC2, and, I would recommend not attempting to change the algorithm used in the PKCS12 documents in these tests.

@ghost ghost added in-pr There is an active PR which will close this issue when it is merged and removed in-pr There is an active PR which will close this issue when it is merged labels Jul 17, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 17, 2023
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' Known Build Error Use this to report build issues in the .NET Helix tab os-android
Projects
None yet
Development

No branches or pull requests

2 participants