forked from rosebudai/OpenRCT2-Web
Handle malformed private keys gracefully
This commit is contained in:
1 parent
553e1bdf0f
commit
66abc31fee
2 files changed
+16
-3
No files matched your search
@@ -110,7 +110,7 @@ bool NetworkKey::LoadPrivate(SDL_RWops * file)
|
||||
}
|
||||
RSA * rsa;
|
||||
rsa = PEM_read_bio_RSAPrivateKey(bio, nullptr, nullptr, nullptr);
|
||||
if (!RSA_check_key(rsa))
|
||||
if (rsa == nullptr || !RSA_check_key(rsa))
|
||||
{
|
||||
log_error("Loaded RSA key is invalid");
|
||||
BIO_free_all(bio);
|
||||
|
||||
Reference in new issue
Block a user