提交 f0f535e9 编写于 作者: R Rob Percival 提交者: Rich Salz
上级 e25233d9
...@@ -20,18 +20,14 @@ ...@@ -20,18 +20,14 @@
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void) CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void)
{ {
CT_POLICY_EVAL_CTX *ctx = OPENSSL_zalloc(sizeof(CT_POLICY_EVAL_CTX)); CT_POLICY_EVAL_CTX *ctx = OPENSSL_zalloc(sizeof(CT_POLICY_EVAL_CTX));
time_t epoch_time_in_s;
if (ctx == NULL) { if (ctx == NULL) {
CTerr(CT_F_CT_POLICY_EVAL_CTX_NEW, ERR_R_MALLOC_FAILURE); CTerr(CT_F_CT_POLICY_EVAL_CTX_NEW, ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
} }
// Use the current time if available. // time(NULL) shouldn't ever fail, so don't bother checking for -1.
time(&epoch_time_in_s); ctx->epoch_time_in_ms = time(NULL) * 1000;
if (epoch_time_in_s != -1)
ctx->epoch_time_in_ms = epoch_time_in_s * 1000;
return ctx; return ctx;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册