diff options
Diffstat (limited to 'crypto/ct')
-rw-r--r-- | crypto/ct/ct_policy.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/ct/ct_policy.c b/crypto/ct/ct_policy.c index 80a8baabe1..ad792b740d 100644 --- a/crypto/ct/ct_policy.c +++ b/crypto/ct/ct_policy.c @@ -13,7 +13,7 @@ #include <openssl/ct.h> #include <openssl/err.h> -#include <time.h> +#include "internal/time.h" #include "ct_local.h" @@ -29,6 +29,7 @@ CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq) { CT_POLICY_EVAL_CTX *ctx = OPENSSL_zalloc(sizeof(CT_POLICY_EVAL_CTX)); + OSSL_TIME now; if (ctx == NULL) { ERR_raise(ERR_LIB_CT, ERR_R_MALLOC_FAILURE); @@ -45,9 +46,9 @@ CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx, } } - /* time(NULL) shouldn't ever fail, so don't bother checking for -1. */ - ctx->epoch_time_in_ms = (uint64_t)(time(NULL) + SCT_CLOCK_DRIFT_TOLERANCE) * - 1000; + now = ossl_time_add(ossl_time_now(), + ossl_seconds2time(SCT_CLOCK_DRIFT_TOLERANCE)); + ctx->epoch_time_in_ms = ossl_time2ms(now); return ctx; } |