Skip to content

Impossible signature padding conditions in RSAAndroid #57683

@bartonjs

Description

@bartonjs

RSAAndroid has two impossible padding check tests:

if (padding == RSASignaturePadding.Pkcs1 && padding == RSASignaturePadding.Pss)

if (padding == RSASignaturePadding.Pkcs1 && padding == RSASignaturePadding.Pss)

Both of which should be "!= && !=".

Theoretically, there should be a test that passes in bad padding values, which should be triggering Debug.Fails in a later switch statement. (The purpose of the precondition here is to avoid triggering lazy key generation on an argument exception/PNSE)

(Filing an issue because my dev environment is currently offline)

  • Verify that a test for this exists. If it doesn't, write one. If there does, we're probably only running it in release builds.
  • Fix the conditions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions