Skip to content

Commit

Permalink
handle error of OCSP_sendreq_nbio (#81)
Browse files Browse the repository at this point in the history
* handle error of OCSP_sendreq_nbio
  • Loading branch information
kumagi committed Feb 17, 2021
1 parent c5274cc commit 3b175f0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/sxg_cert_chain.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,16 @@ bool sxg_execute_ocsp_request(BIO* io, const char* path, OCSP_CERTID* id,
bool success = OCSP_request_add0_id(req, id) &&
OCSP_REQ_CTX_set1_req(octx, req) && wait_fd(fd, false, true);
while (success) {
if (OCSP_sendreq_nbio(dst, octx) != -1) {
break;
switch (OCSP_sendreq_nbio(dst, octx)) {
case -1:
success =
success && wait_fd(fd, BIO_should_read(io), BIO_should_write(io));
continue;
case 0:
success = false;
case 1:
}
success = success && wait_fd(fd, BIO_should_read(io), BIO_should_write(io));
break;
}

OCSP_REQUEST_free(req);
Expand Down

0 comments on commit 3b175f0

Please sign in to comment.