#include <openssl/ct.h>
#include <openssl/err.h>
-#include <time.h>
+#include "internal/time.h"
#include "ct_local.h"
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);
}
}
- /* 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;
}