diff options
author | Todd Short <tshort@akamai.com> | 2022-08-11 09:58:52 -0400 |
---|---|---|
committer | Todd Short <todd.short@me.com> | 2022-08-18 10:54:20 -0400 |
commit | 340fe504e42e3e4b6399caff165097cedc994c5e (patch) | |
tree | e18bfea0ac51727853eed652e4832be7942019e0 /include | |
parent | 425e972dfaf867affb5b3d438d9ca67bb6aeed65 (diff) |
Update session timeout code with OSSL_TIME
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18985)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/time.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/internal/time.h b/include/internal/time.h index 50f50822a8..6a7a05aae5 100644 --- a/include/internal/time.h +++ b/include/internal/time.h @@ -77,6 +77,16 @@ void ossl_time_time_to_timeval(OSSL_TIME t, struct timeval *out) out->tv_usec = (t.t % OSSL_TIME_SECOND) / (OSSL_TIME_SECOND / 1000000); } +/* Convert time_t to OSSL_TIME */ +static ossl_inline OSSL_TIME ossl_time_from_time_t(time_t t) +{ + OSSL_TIME ot; + + ot.t = t; + ot.t *= OSSL_TIME_SECOND; + return ot; +} + /* Compare two time values, return -1 if less, 1 if greater and 0 if equal */ static ossl_unused ossl_inline int ossl_time_compare(OSSL_TIME a, OSSL_TIME b) |