Skip to content

Commit

Permalink
Catch OutOfMemoryExceptions when calling RSA.VerifyData with OpenSSL 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Thealexbarney committed Nov 16, 2022
1 parent 2b31368 commit 2e769ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/LibHac/Crypto/Rsa.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ private static bool VerifyRsa2048Sha256(ReadOnlySpan<byte> signature, ReadOnlySp
return rsa.VerifyData(message, signature, HashAlgorithmName.SHA256, padding);
}
}
catch (CryptographicException)
// Catch the OutOfMemoryException to workaround an issue with OpenSSL 1.1. dotnet/runtime#78293
catch (Exception ex) when (ex is CryptographicException or OutOfMemoryException)
{
return false;
}
Expand Down

0 comments on commit 2e769ea

Please sign in to comment.