From 2e769ea70a977700ad75c21599187d7b76c0c31c Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Tue, 15 Nov 2022 22:34:17 -0700 Subject: [PATCH] Catch OutOfMemoryExceptions when calling RSA.VerifyData with OpenSSL 1.1 --- src/LibHac/Crypto/Rsa.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/LibHac/Crypto/Rsa.cs b/src/LibHac/Crypto/Rsa.cs index 1b28af86..398ca787 100644 --- a/src/LibHac/Crypto/Rsa.cs +++ b/src/LibHac/Crypto/Rsa.cs @@ -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; }