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

[Android][arm] Algorithm 'RC2' not supported on Android causing failures in X509Certificates tests #104030

Closed
matouskozak opened this issue Jun 26, 2024 · 4 comments · Fixed by #104040
Assignees
Labels
arch-arm32 arch-arm64 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

Comments

@matouskozak
Copy link
Member

matouskozak commented Jun 26, 2024

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=720816
Build error leg or test failing: System.Security.Cryptography.Tests
Affected CI: android-arm/arm64 Release AllSubsets_Mono (runtime-extra-platforms)
Commits range: c5e8f83...6effb8f

Stack trace example:

06-26 06:00:17.267 27417 28325 I DOTNET  : 1) 	[FAIL] System.Security.Cryptography.X509Certificates.Tests.PfxTests.ReadECDsaPrivateKey_BrainpoolP160r1_Pfx   Test name: System.Security.Cryptography.X509Certificates.Tests.PfxTests.ReadECDsaPrivateKey_BrainpoolP160r1_Pfx(pfxData: [48, 130, 3, 208, 2, ┬╖┬╖┬╖])   Test case: System.Security.Cryptography.X509Certificates.Tests.PfxTests.ReadECDsaPrivateKey_BrainpoolP160r1_Pfx
06-26 06:00:17.267 27417 28325 I DOTNET  :    Assembly:  [System.Security.Cryptography.Tests, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
06-26 06:00:17.267 27417 28325 I DOTNET  :    Exception messages: System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.   Exception stack traces:    at System.Security.Cryptography.PasswordBasedEncryption.CreateRC2()
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509CertificateLoader.BagState.DecryptSafeContents(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 passwordSpan, ReadOnlySpan`1 encryptedContent)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509CertificateLoader.DecryptSafeContents(ContentInfoAsn safeContentsAsn, Pkcs12LoaderLimits loaderLimits, ReadOnlySpan`1 passwordSpan, BagState& bagState, Nullable`1& workRemaining)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509CertificateLoader.ReadCertsAndKeys(BagState& bagState, ReadOnlyMemory`1 data, ReadOnlySpan`1& password, Pkcs12LoaderLimits loaderLimits)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadPkcs12(ReadOnlyMemory`1 data, ReadOnlySpan`1 password, X509KeyStorageFlags keyStorageFlags, Pkcs12LoaderLimits loaderLimits)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadPkcs12Pal(ReadOnlySpan`1 data, ReadOnlySpan`1 password, X509KeyStorageFlags keyStorageFlags, Pkcs12LoaderLimits loaderLimits)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, Boolean readingFromFile, X509KeyStorageFlags keyStorageFlags)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.CertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password, X509KeyStorageFlags keyStorageFlags)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData, String password)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxTests.ReadECDsaPrivateKey_BrainpoolP160r1_Pfx(Byte[] pfxData) in /_/src/libraries/System.Security.Cryptography/tests/X509Certificates/PfxTests.cs:line 314
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
06-26 06:00:17.267 27417 28325 I DOTNET  :    Execution time: 0.0208223
06-26 06:00:17.267 27417 28325 I DOTNET  : 2) 	[FAIL] System.Security.Cryptography.X509Certificates.Tests.PfxTests.ReadECDsaPrivateKey_BrainpoolP160r1_Pfx   Test name: System.Security.Cryptography.X509Certificates.Tests.PfxTests.ReadECDsaPrivateKey_BrainpoolP160r1_Pfx(pfxData: [48, 130, 5, 1, 2, ┬╖┬╖┬╖])   Test case: System.Security.Cryptography.X509Certificates.Tests.PfxTests.ReadECDsaPrivateKey_BrainpoolP160r1_Pfx
06-26 06:00:17.267 27417 28325 I DOTNET  :    Assembly:  [System.Security.Cryptography.Tests, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
06-26 06:00:17.267 27417 28325 I DOTNET  :    Exception messages: System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.   Exception stack traces:    at System.Security.Cryptography.PasswordBasedEncryption.CreateRC2()
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509CertificateLoader.BagState.DecryptSafeContents(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 passwordSpan, ReadOnlySpan`1 encryptedContent)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509CertificateLoader.DecryptSafeContents(ContentInfoAsn safeContentsAsn, Pkcs12LoaderLimits loaderLimits, ReadOnlySpan`1 passwordSpan, BagState& bagState, Nullable`1& workRemaining)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509CertificateLoader.ReadCertsAndKeys(BagState& bagState, ReadOnlyMemory`1 data, ReadOnlySpan`1& password, Pkcs12LoaderLimits loaderLimits)
06-26 06:00:17.267 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadPkcs12(ReadOnlyMemory`1 data, ReadOnlySpan`1 password, X509KeyStorageFlags keyStorageFlags, Pkcs12LoaderLimits loaderLimits)
06-26 06:00:17.268 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadPkcs12Pal(ReadOnlySpan`1 data, ReadOnlySpan`1 password, X509KeyStorageFlags keyStorageFlags, Pkcs12LoaderLimits loaderLimits)
06-26 06:00:17.268 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, Boolean readingFromFile, X509KeyStorageFlags keyStorageFlags)
06-26 06:00:17.268 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
06-26 06:00:17.268 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.CertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
06-26 06:00:17.268 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password, X509KeyStorageFlags keyStorageFlags)
06-26 06:00:17.268 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password)
06-26 06:00:17.268 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData, String password)
06-26 06:00:17.268 27417 28325 I DOTNET  :    at System.Security.Cryptography.X509Certificates.Tests.PfxTests.ReadECDsaPrivateKey_BrainpoolP160r1_Pfx(Byte[] pfxData) in /_/src/libraries/System.Security.Cryptography/tests/X509Certificates/PfxTests.cs:line 314
06-26 06:00:17.268 27417 28325 I DOTNET  :    at System.Object.InvokeStub_PfxTests.ReadECDsaPrivateKey_BrainpoolP160r1_Pfx(Object , Span`1 )
06-26 06:00:17.268 27417 28325 I DOTNET  :    at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

Error Message

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

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

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=720816
Error message validated: [System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.]
Result validation: ❌ Known issue did not match with the provided build.
Validation performed at: 6/26/2024 1:18:57 PM UTC

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0
@matouskozak matouskozak added arch-arm32 arch-arm64 area-System.Security blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' os-android untriaged New issue has not been triaged by the area owner Known Build Error Use this to report build issues in the .NET Helix tab labels Jun 26, 2024
Copy link
Contributor

Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

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

@matouskozak
Copy link
Member Author

Could it be caused by #102167 @bartonjs ?

@vcsjones
Copy link
Member

Yeah. This is from #102167. I can take a look.

@matouskozak matouskozak removed the untriaged New issue has not been triaged by the area owner label Jun 26, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm32 arch-arm64 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
2 participants