Skip to content

Commit

Permalink
Fix crash when OCSP_RESPONSE does not contain OCSP_BASIC_RESPONSE (#646)
Browse files Browse the repository at this point in the history
IB-8299

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored Nov 17, 2024
1 parent 873fc69 commit 357f40c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/crypto/OCSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ OCSP::OCSP(const unsigned char *data, size_t size)
return;
resp.reset(d2i_OCSP_RESPONSE(nullptr, &data, long(size)), OCSP_RESPONSE_free);
if(resp)
basic.reset(OCSP_response_get1_basic(resp.get()), OCSP_BASICRESP_free);
basic.reset(OCSP_response_get1_basic(resp.get()), OCSP_BASICRESP_free);
}

bool OCSP::compareResponderCert(const X509Cert &cert) const
Expand Down Expand Up @@ -183,7 +183,7 @@ OCSP::operator vector<unsigned char>() const
*/
void OCSP::verifyResponse(const X509Cert &cert) const
{
if(!resp)
if(!basic)
THROW("Failed to verify OCSP response.");

tm tm = producedAt();
Expand Down

0 comments on commit 357f40c

Please sign in to comment.