Skip to content

Commit 357f40c

Browse files
authored
Fix crash when OCSP_RESPONSE does not contain OCSP_BASIC_RESPONSE (#646)
IB-8299 Signed-off-by: Raul Metsma <[email protected]>
1 parent 873fc69 commit 357f40c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/crypto/OCSP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ OCSP::OCSP(const unsigned char *data, size_t size)
132132
return;
133133
resp.reset(d2i_OCSP_RESPONSE(nullptr, &data, long(size)), OCSP_RESPONSE_free);
134134
if(resp)
135-
basic.reset(OCSP_response_get1_basic(resp.get()), OCSP_BASICRESP_free);
135+
basic.reset(OCSP_response_get1_basic(resp.get()), OCSP_BASICRESP_free);
136136
}
137137

138138
bool OCSP::compareResponderCert(const X509Cert &cert) const
@@ -183,7 +183,7 @@ OCSP::operator vector<unsigned char>() const
183183
*/
184184
void OCSP::verifyResponse(const X509Cert &cert) const
185185
{
186-
if(!resp)
186+
if(!basic)
187187
THROW("Failed to verify OCSP response.");
188188

189189
tm tm = producedAt();

0 commit comments

Comments
 (0)