Skip to content

Valid RSA-384 signatures are sometimes reported as invalid on Android #118366

Closed

Description

@bartonjs

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1113280
Build error leg or test failing: System.Security.Cryptography.Rsa.Tests.SignVerify_AllocatingSpan.VerifySignature_SHA1_384
Pull request: #118357

Error Message

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

{
  "ErrorMessage": "System.Security.Cryptography.Rsa.Tests.SignVerify.VerifySignature_SHA1_384",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1113280
Error message validated: [System.Security.Cryptography.Rsa.Tests.SignVerify.VerifySignature_SHA1_384]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 8/14/2025 3:47:19 PM UTC

Activity

  1. added
    blocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
    Known Build ErrorUse this to report build issues in the .NET Helix tab
    on Aug 4, 2025
  2. dotnet-policy-service commented on Aug 4, 2025

    @dotnet-policy-service
    Contributor

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

  3. bartonjs commented on Aug 4, 2025

    @bartonjs
    MemberAuthor

    Log exerpts:

    08-04 16:15:43.779 24360 25422 I DOTNET  : Failed tests:
    08-04 16:15:43.779 24360 25422 I DOTNET  : 1)  [FAIL] System.Security.Cryptography.X509Certificates.Tests.PublicKeyTests.TestKey_RSA384_ValidatesSignature   Test name: System.Security.Cryptography.X509Certificates.Tests.PublicKeyTests.TestKey_RSA384_ValidatesSignature
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Assembly:  [System.Security.Cryptography.Tests, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Exception messages: Assert.True() Failure
    08-04 16:15:43.780 24360 25422 I DOTNET  : Expected: True
    08-04 16:15:43.780 24360 25422 I DOTNET  : Actual:   False   Exception stack traces:    at System.Security.Cryptography.X509Certificates.Tests.PublicKeyTests.TestKey_RSA384_ValidatesSignature()
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Execution time: 0.0045265
    08-04 16:15:43.780 24360 25422 I DOTNET  : 2)  [FAIL] System.Security.Cryptography.Rsa.Tests.SignVerify_Span.VerifySignature_SHA1_384   Test name: System.Security.Cryptography.Rsa.Tests.SignVerify_Span.VerifySignature_SHA1_384
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Assembly:  [System.Security.Cryptography.Tests, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Exception messages: Assert.True() Failure
    08-04 16:15:43.780 24360 25422 I DOTNET  : Expected: True
    08-04 16:15:43.780 24360 25422 I DOTNET  : Actual:   False   Exception stack traces:    at System.Security.Cryptography.Rsa.Tests.SignVerify.VerifySignature(Byte[] signature, Byte[] data, String hashAlgorithmName, RSAParameters rsaParameters)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Security.Cryptography.Rsa.Tests.SignVerify.VerifySignature_SHA1_384()
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Execution time: 0.0024555
    08-04 16:15:43.780 24360 25422 I DOTNET  : 3)  [FAIL] System.Security.Cryptography.Rsa.Tests.SignVerify_AllocatingSpan.VerifySignature_SHA1_384   Test name: System.Security.Cryptography.Rsa.Tests.SignVerify_AllocatingSpan.VerifySignature_SHA1_384
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Assembly:  [System.Security.Cryptography.Tests, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Exception messages: Assert.True() Failure
    08-04 16:15:43.780 24360 25422 I DOTNET  : Expected: True
    08-04 16:15:43.780 24360 25422 I DOTNET  : Actual:   False   Exception stack traces:    at System.Security.Cryptography.Rsa.Tests.SignVerify.VerifySignature(Byte[] signature, Byte[] data, String hashAlgorithmName, RSAParameters rsaParameters)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Security.Cryptography.Rsa.Tests.SignVerify.VerifySignature_SHA1_384()
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Execution time: 0.0021285
    08-04 16:15:43.780 24360 25422 I DOTNET  : 4)  [FAIL] System.Security.Cryptography.Rsa.Tests.SignVerify_Array.VerifySignature_SHA1_384   Test name: System.Security.Cryptography.Rsa.Tests.SignVerify_Array.VerifySignature_SHA1_384
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Assembly:  [System.Security.Cryptography.Tests, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Exception messages: Assert.True() Failure
    08-04 16:15:43.780 24360 25422 I DOTNET  : Expected: True
    08-04 16:15:43.780 24360 25422 I DOTNET  : Actual:   False   Exception stack traces:    at System.Security.Cryptography.Rsa.Tests.SignVerify.VerifySignature(Byte[] signature, Byte[] data, String hashAlgorithmName, RSAParameters rsaParameters)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Security.Cryptography.Rsa.Tests.SignVerify.VerifySignature_SHA1_384()
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Execution time: 0.001482
    08-04 16:15:43.780 24360 25422 I DOTNET  : 5)  [FAIL] System.Security.Cryptography.Rsa.Tests.SignVerify_TrySpan.VerifySignature_SHA1_384   Test name: System.Security.Cryptography.Rsa.Tests.SignVerify_TrySpan.VerifySignature_SHA1_384
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Assembly:  [System.Security.Cryptography.Tests, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Exception messages: Assert.True() Failure
    08-04 16:15:43.780 24360 25422 I DOTNET  : Expected: True
    08-04 16:15:43.780 24360 25422 I DOTNET  : Actual:   False   Exception stack traces:    at System.Security.Cryptography.Rsa.Tests.SignVerify.VerifySignature(Byte[] signature, Byte[] data, String hashAlgorithmName, RSAParameters rsaParameters)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Security.Cryptography.Rsa.Tests.SignVerify.VerifySignature_SHA1_384()
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    08-04 16:15:43.780 24360 25422 I DOTNET  :    Execution time: 0.001561
    

    It doesn't seem to happen on every Android run, so maybe one of the machines is on a new OS version than the rest?

  4. dotnet-policy-service commented on Aug 4, 2025

    @dotnet-policy-service
    Contributor

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

  5. added
    blocking-outerloopBlocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs
    and removed
    blocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
    on Aug 4, 2025
  6. BrzVlad commented on Aug 11, 2025

    @BrzVlad
    Member

    Reproduces on my local device

  7. removed
    untriagedNew issue has not been triaged by the area owner
    on Aug 13, 2025
  8. added this to the 10.0.0 milestone on Aug 13, 2025
  9. vitek-karas commented on Aug 13, 2025

    @vitek-karas
    Member

    We'll investigate and see if this needs a fix in RC2.

  10. simonrozsival commented on Aug 18, 2025

    @simonrozsival
    Member

    I was not able to reproduce this issue on emulator locally (API 25, 29, 33) but I could reproduce the test failure when running on a physical Samsung device (API 35). When I switch from Release to Debug, the test run crashes with the following failed assertion:

    D DOTNET  : ((null) warning) Process terminated. Assertion failed.
    D DOTNET  : ((null) warning) RsaVerificationPrimitive returned 47 when 48 was expected
    D DOTNET  :    at System.Diagnostics.DebugProvider.Fail(String message, String detailMessage)
    D DOTNET  :    at System.Diagnostics.Debug.Fail(String message, String detailMessage)
    D DOTNET  :    at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage)
    D DOTNET  :    at System.Diagnostics.Debug.Assert(Boolean condition, String message)
    D DOTNET  :    at System.Diagnostics.Debug.Assert(Boolean condition, AssertInterpolatedStringHandler& message)
    D DOTNET  :    at System.Security.Cryptography.RSAImplementation.RSAAndroid.VerifyHash(ReadOnlySpan`1 hash, ReadOnlySpan`1 signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
    D DOTNET  :    at System.Security.Cryptography.RSA.VerifyData(ReadOnlySpan`1 data, ReadOnlySpan`1 signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
    D DOTNET  :    at System.Security.Cryptography.Rsa.Tests.SignVerify_Span.VerifyData(RSA rsa, Byte[] data, Byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
    D DOTNET  :    at Sy
    
  11. vcsjones commented on Aug 18, 2025

    @vcsjones
    Member

    ((null) warning) RsaVerificationPrimitive returned 47 when 48 was expected

    I can take a look sometime this week.

  12. simonrozsival commented on Aug 19, 2025

    @simonrozsival
    Member

    @vcsjones I think I figured it out. Please feel free to suggest an alternative fix to #118880 if there is a better way to address this issue.

  13. locked and limited conversation to collaborators on Sep 19, 2025
  14. unlocked this conversation on Sep 15, 2026
  15. locked and limited conversation to collaborators on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Known Build ErrorUse this to report build issues in the .NET Helix tabarea-System.Securityblocking-outerloopBlocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runsos-android

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions