Skip to content

Commit

Permalink
Fixed issue with backward compatibility for OpenSSL v1.0.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
opencrypto committed Nov 20, 2017
1 parent 6f8b771 commit 320e805
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/openssl/pki_ocsp_resp.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,13 @@ int PKI_X509_OCSP_RESP_sign(PKI_X509_OCSP_RESP * resp,
return PKI_ERROR(PKI_ERR, "Can not set RESPID by key");
}
}

if ((time = X509_gmtime_adj(r->bs->tbsResponseData.producedAt, 0)) == 0)
PKI_log_err("Error adding signed time to response");

if (!r->bs->tbsResponseData.producedAt)
r->bs->tbsResponseData.producedAt = time;

#else

// Gets the responderId
Expand Down Expand Up @@ -464,13 +471,14 @@ int PKI_X509_OCSP_RESP_sign(PKI_X509_OCSP_RESP * resp,
// All done here.
PKI_DIGEST_free(dgst);
}
#endif

if ((time = X509_gmtime_adj(r->bs->tbsResponseData.producedAt, 0)) == 0)
if ((time = X509_gmtime_adj(r->bs->tbsResponseData->producedAt, 0)) == 0)
PKI_log_err("Error adding signed time to response");

if (!r->bs->tbsResponseData.producedAt)
r->bs->tbsResponseData.producedAt = time;
if (!r->bs->tbsResponseData->producedAt)
r->bs->tbsResponseData->producedAt = time;

#endif

if (!(r->resp->responseBytes = OCSP_RESPBYTES_new()))
{
Expand Down

0 comments on commit 320e805

Please sign in to comment.