Previously broke out while elapsed < timeout, causing early exit and
treating OCSP as timed out. Break only when elapsed >= timeout so we
retry until the deadline. Prevents unintended skips and softfail
acceptance of revoked certs.
This bug was found with ZeroPath.
Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
start = fr_time();
do {
rc = OCSP_sendreq_nbio(&resp, ctx);
- if (conf->timeout) {
- if (conf->timeout > (fr_time() - start)) break;
- }
+ if (conf->timeout && (fr_time() - start) >= conf->timeout) {
+ break;
+ }
} while ((rc == -1) && BIO_should_retry(conn));
if (conf->timeout && (rc == -1) && BIO_should_retry(conn)) {