time: move OSSL_TIME to libcrypto
authorPauli <pauli@openssl.org>
Mon, 29 Aug 2022 04:52:44 +0000 (14:52 +1000)
committerPauli <pauli@openssl.org>
Tue, 13 Sep 2022 11:13:22 +0000 (21:13 +1000)
Keep building it for libssl without exposing any symbols.

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19082)

crypto/build.info
crypto/time.c [moved from ssl/time.c with 95% similarity]
ssl/build.info

index e384b94d57f6f3afddc18544e0d0c6111b1cf68c..35e012d5d2c3ae004aeafaecf7e7d384d38882f3 100644 (file)
@@ -99,7 +99,7 @@ $UTIL_COMMON=\
         threads_pthread.c threads_win.c threads_none.c initthread.c \
         context.c sparse_array.c asn1_dsa.c packet.c param_build.c \
         param_build_set.c der_writer.c threads_lib.c params_dup.c \
-        quic_vlint.c
+        quic_vlint.c time.c
 
 SOURCE[../libssl]=sparse_array.c
 
similarity index 95%
rename from ssl/time.c
rename to crypto/time.c
index 628aaed7ecfca88225db08cab8b03178d588cc95..a90aa767881e68e1cac3dae7e982b19767134604 100644 (file)
@@ -31,7 +31,7 @@ OSSL_TIME ossl_time_now(void)
     now.ul -= 116444736000000000UI64;
 # endif
     r.t = ((uint64_t)now.ul) * (OSSL_TIME_SECOND / 10000000);
-#else
+#else   /* defined(_WIN32) */
     struct timeval t;
 
     if (gettimeofday(&t, NULL) < 0) {
@@ -43,6 +43,6 @@ OSSL_TIME ossl_time_now(void)
         r.t = t.tv_usec <= 0 ? 0 : t.tv_usec * OSSL_TIME_US;
     else
         r.t = ((uint64_t)t.tv_sec * 1000000 + t.tv_usec) * OSSL_TIME_US;
-#endif
+#endif  /* defined(_WIN32) */
     return r;
 }
index ea35779f07b10a874c45e72f07d4ad70b9dd7eb1..81631c7497bdd69f60ecb982d4a7202cc09c148d 100644 (file)
@@ -7,7 +7,7 @@ IF[{- !$disabled{quic} -}]
 ENDIF
 
 SOURCE[../libssl]=\
-        pqueue.c time.c \
+        pqueue.c \
         statem/statem_srvr.c statem/statem_clnt.c  s3_lib.c  s3_enc.c \
         statem/statem_lib.c statem/extensions.c statem/extensions_srvr.c \
         statem/extensions_clnt.c statem/extensions_cust.c s3_msg.c \
@@ -23,7 +23,8 @@ SOURCE[../libssl]=\
 
 # For shared builds we need to include the libcrypto packet.c and quic_vlint.c
 # in libssl as well.
-SHARED_SOURCE[../libssl]=../crypto/packet.c ../crypto/quic_vlint.c
+SHARED_SOURCE[../libssl]=\
+        ../crypto/packet.c ../crypto/quic_vlint.c ../crypto/time.c
 
 IF[{- !$disabled{'deprecated-3.0'} -}]
   SOURCE[../libssl]=ssl_rsa_legacy.c