Skip to content

Commit

Permalink
openssl: try to avoid accessing OCSP structs when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ghedo authored and bagder committed Mar 20, 2015
1 parent 9e8f9db commit 8854f8d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/vtls/openssl.c
Expand Up @@ -1390,17 +1390,15 @@ static CURLcode verifystatus(struct connectdata *conn,
goto end;
}

for(i = 0; i < sk_OCSP_SINGLERESP_num(br->tbsResponseData->responses); i++) {
for(i = 0; i < OCSP_resp_count(br); i++) {
int cert_status, crl_reason;
OCSP_SINGLERESP *single = NULL;

ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd;

if(!sk_OCSP_SINGLERESP_value(br->tbsResponseData->responses, i))
if(!(single = OCSP_resp_get0(br, i)))
continue;

single = sk_OCSP_SINGLERESP_value(br->tbsResponseData->responses, i);

cert_status = OCSP_single_get0_status(single, &crl_reason, &rev,
&thisupd, &nextupd);

Expand Down

0 comments on commit 8854f8d

Please sign in to comment.