Browse Source

time: move OSSL_TIME to libcrypto

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)
Pauli 1 year ago
parent
commit
02d0f87a8b
3 changed files with 6 additions and 5 deletions
  1. 1 1
      crypto/build.info
  2. 2 2
      crypto/time.c
  3. 3 2
      ssl/build.info

+ 1 - 1
crypto/build.info

@@ -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
 

+ 2 - 2
ssl/time.c → crypto/time.c

@@ -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;
 }

+ 3 - 2
ssl/build.info

@@ -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