Skip to content

Commit 6e090ac

Browse files
committed
Check if OCSP response is valid
IB-8891 Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent 68ec5bf commit 6e090ac

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/crypto/OCSP.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ OCSP::OCSP(const X509Cert &cert, const X509Cert &issuer, const std::string &user
9292
THROW("Failed to send OCSP request");
9393
const auto *p2 = (const unsigned char*)result.content.c_str();
9494
resp.reset(d2i_OCSP_RESPONSE(nullptr, &p2, long(result.content.size())));
95+
if(!resp)
96+
THROW_OPENSSLEXCEPTION("Failed to parse OCSP response.");
9597

9698
switch(int respStatus = OCSP_response_status(resp.get()))
9799
{

0 commit comments

Comments
 (0)