Skip to content

Commit 17ee196

Browse files
committed
Prevent Y2038 bug by using SSL_SESSION_get_time_ex
The previous function is deprecated, see: * openssl/openssl@00a6d07 * openssl/openssl#23648 * openssl/openssl#21206 Implement check for the OpenSSL version Submitted by: Daniel Ruf <daniel daniel-ruf.de> Github: closes #607 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1932104 13f79535-47bb-0310-9956-ffa450edef68
1 parent e8c82bb commit 17ee196

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

changes-entries/ssl-sess-y2k.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*) mod_ssl: Prevent Y2K bug in session handling on 32-bit platforms
2+
with a 64-bit time_t. [Daniel Ruf <daniel daniel-ruf.de>]

modules/ssl/ssl_engine_kernel.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,10 +1965,17 @@ int ssl_callback_NewSessionCacheEntry(SSL *ssl, SSL_SESSION *session)
19651965
idlen = session->session_id_length;
19661966
#endif
19671967

1968+
#if OPENSSL_VERSION_NUMBER >= 0x30300000
1969+
rc = ssl_scache_store(s, id, idlen,
1970+
apr_time_from_sec(SSL_SESSION_get_time_ex(session)
1971+
+ timeout),
1972+
session, conn->pool);
1973+
#else
19681974
rc = ssl_scache_store(s, id, idlen,
19691975
apr_time_from_sec(SSL_SESSION_get_time(session)
19701976
+ timeout),
19711977
session, conn->pool);
1978+
#endif
19721979

19731980
ssl_session_log(s, "SET", id, idlen,
19741981
rc == TRUE ? "OK" : "BAD",

0 commit comments

Comments
 (0)