diff options
author | Ijtaba Hussain <ijtabahussain@live.com> | 2023-06-09 08:04:53 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-02-21 10:28:17 +0100 |
commit | ffc853bcb5f431d57b8a24dd062ff76d52891e63 (patch) | |
tree | 2e3f884536c6d23fb114bbe255ba39600fe5dac5 /ssl/ssl_sess.c | |
parent | Future proof RLAYER_USE_EXPLICIT_IV by checking dtls versions directly. (diff) | |
download | openssl-ffc853bcb5f431d57b8a24dd062ff76d52891e63.tar.xz openssl-ffc853bcb5f431d57b8a24dd062ff76d52891e63.zip |
Extended SSL_SESSION functions using time_t
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21206)
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r-- | ssl/ssl_sess.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 3dcc4d81e5..c6190b92d2 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -919,14 +919,19 @@ long SSL_SESSION_get_timeout(const SSL_SESSION *s) long SSL_SESSION_get_time(const SSL_SESSION *s) { + return (long) SSL_SESSION_get_time_ex(s); +} + +time_t SSL_SESSION_get_time_ex(const SSL_SESSION *s) +{ if (s == NULL) return 0; - return (long)ossl_time_to_time_t(s->time); + return ossl_time_to_time_t(s->time); } -long SSL_SESSION_set_time(SSL_SESSION *s, long t) +time_t SSL_SESSION_set_time_ex(SSL_SESSION *s, time_t t) { - OSSL_TIME new_time = ossl_time_from_time_t((time_t)t); + OSSL_TIME new_time = ossl_time_from_time_t(t); if (s == NULL) return 0; @@ -944,6 +949,11 @@ long SSL_SESSION_set_time(SSL_SESSION *s, long t) return t; } +long SSL_SESSION_set_time(SSL_SESSION *s, long t) +{ + return (long) SSL_SESSION_set_time_ex(s, (time_t) t); +} + int SSL_SESSION_get_protocol_version(const SSL_SESSION *s) { return s->ssl_version; |