From: jsing Date: Thu, 22 May 2014 17:27:50 +0000 (+0000) Subject: Hello? Yes, you're speaking with OPENSSL_SYS_UNIX. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=53dab75f861862277649b6c3a9773475f662be0f;p=openbsd Hello? Yes, you're speaking with OPENSSL_SYS_UNIX. ok beck@ miod@ --- diff --git a/lib/libcrypto/ts/ts_rsp_sign.c b/lib/libcrypto/ts/ts_rsp_sign.c index fe5244c0c5b..0e57105858e 100644 --- a/lib/libcrypto/ts/ts_rsp_sign.c +++ b/lib/libcrypto/ts/ts_rsp_sign.c @@ -58,9 +58,7 @@ #include "cryptlib.h" -#if defined(OPENSSL_SYS_UNIX) #include -#endif #include #include @@ -110,8 +108,6 @@ err: return NULL; } -#if defined(OPENSSL_SYS_UNIX) - /* Use the gettimeofday function call. */ static int def_time_cb(struct TS_resp_ctx *ctx, void *data, long *sec, long *usec) @@ -132,30 +128,6 @@ def_time_cb(struct TS_resp_ctx *ctx, void *data, long *sec, long *usec) return 1; } -#else - -/* Use the time function call that provides only seconds precision. */ -static int -def_time_cb(struct TS_resp_ctx *ctx, void *data, long *sec, long *usec) -{ - time_t t; - - if (time(&t) == (time_t) - 1) { - TSerr(TS_F_DEF_TIME_CB, TS_R_TIME_SYSCALL_ERROR); - TS_RESP_CTX_set_status_info(ctx, TS_STATUS_REJECTION, - "Time is not available."); - TS_RESP_CTX_add_failure_info(ctx, TS_INFO_TIME_NOT_AVAILABLE); - return 0; - } - /* Return time to caller, only second precision. */ - *sec = (long) t; - *usec = 0; - - return 1; -} - -#endif - static int def_extension_cb(struct TS_resp_ctx *ctx, X509_EXTENSION *ext, void *data) { diff --git a/lib/libssl/src/crypto/ts/ts_rsp_sign.c b/lib/libssl/src/crypto/ts/ts_rsp_sign.c index fe5244c0c5b..0e57105858e 100644 --- a/lib/libssl/src/crypto/ts/ts_rsp_sign.c +++ b/lib/libssl/src/crypto/ts/ts_rsp_sign.c @@ -58,9 +58,7 @@ #include "cryptlib.h" -#if defined(OPENSSL_SYS_UNIX) #include -#endif #include #include @@ -110,8 +108,6 @@ err: return NULL; } -#if defined(OPENSSL_SYS_UNIX) - /* Use the gettimeofday function call. */ static int def_time_cb(struct TS_resp_ctx *ctx, void *data, long *sec, long *usec) @@ -132,30 +128,6 @@ def_time_cb(struct TS_resp_ctx *ctx, void *data, long *sec, long *usec) return 1; } -#else - -/* Use the time function call that provides only seconds precision. */ -static int -def_time_cb(struct TS_resp_ctx *ctx, void *data, long *sec, long *usec) -{ - time_t t; - - if (time(&t) == (time_t) - 1) { - TSerr(TS_F_DEF_TIME_CB, TS_R_TIME_SYSCALL_ERROR); - TS_RESP_CTX_set_status_info(ctx, TS_STATUS_REJECTION, - "Time is not available."); - TS_RESP_CTX_add_failure_info(ctx, TS_INFO_TIME_NOT_AVAILABLE); - return 0; - } - /* Return time to caller, only second precision. */ - *sec = (long) t; - *usec = 0; - - return 1; -} - -#endif - static int def_extension_cb(struct TS_resp_ctx *ctx, X509_EXTENSION *ext, void *data) {