SL-12421 Don't fail silently, show an error

master
Andrey Kleshchev 2020-03-05 13:43:58 +02:00
parent 82e5f6c24f
commit 4e98602746
1 changed files with 2 additions and 4 deletions

View File

@ -78,16 +78,14 @@ LLBasicCertificate::LLBasicCertificate(const std::string& pem_cert,
BIO * pem_bio = BIO_new_mem_buf((void*)pem_cert.c_str(), pem_cert.length());
if(pem_bio == NULL)
{
LL_WARNS("SECAPI") << "Could not allocate an openssl memory BIO." << LL_ENDL;
LLTHROW(LLInvalidCertificate(LLSD::emptyMap()));
LL_ERRS("SECAPI") << "Could not allocate an openssl memory BIO." << LL_ENDL;
}
mCert = NULL;
PEM_read_bio_X509(pem_bio, &mCert, 0, NULL);
BIO_free(pem_bio);
if (!mCert)
{
LL_WARNS("SECAPI") << "Could not decode certificate to x509." << LL_ENDL;
LLTHROW(LLInvalidCertificate(LLSD::emptyMap()));
LL_ERRS("SECAPI") << "Could not decode certificate to x509." << LL_ENDL;
}
}