Skip to content

Commit

Permalink
Fix padding mode precondition in RSAAndroid (#57695)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartonjs authored Aug 19, 2021
1 parent 1ea615c commit 8444429
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ private bool TrySignHash(
Debug.Assert(padding != null);
signature = null;

if (padding == RSASignaturePadding.Pkcs1 && padding == RSASignaturePadding.Pss)
if (padding != RSASignaturePadding.Pkcs1 && padding != RSASignaturePadding.Pss)
{
throw PaddingModeNotSupported();
}
Expand Down Expand Up @@ -825,7 +825,7 @@ public override bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> sign
{
throw new ArgumentNullException(nameof(padding));
}
if (padding == RSASignaturePadding.Pkcs1 && padding == RSASignaturePadding.Pss)
if (padding != RSASignaturePadding.Pkcs1 && padding != RSASignaturePadding.Pss)
{
throw PaddingModeNotSupported();
}
Expand Down

0 comments on commit 8444429

Please sign in to comment.