Catch OutOfMemoryExceptions when calling RSA.VerifyData with OpenSSL 1.1

This commit is contained in:
Alex Barney 2022-11-15 22:34:17 -07:00
parent 2b31368030
commit 2e769ea70a

View file

@ -29,7 +29,8 @@ public static class Rsa
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;
}