]> granicus.if.org Git - apache/commitdiff
add modssl_session_get_time() function to give mod_ssl what it needs
authorDoug MacEachern <dougm@apache.org>
Wed, 27 Mar 2002 01:28:20 +0000 (01:28 +0000)
committerDoug MacEachern <dougm@apache.org>
Wed, 27 Mar 2002 01:28:20 +0000 (01:28 +0000)
from SSL_SESSION_get_time() if using OpenSSL or sslc.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94195 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/mod_ssl.h
modules/ssl/ssl_engine_kernel.c
modules/ssl/ssl_util_ssl.c

index e165bb296b709ac6c5b2985d899e8b1e18c3af19..f6bae69b39a982da171bc5c880a79678acc3ec6d 100644 (file)
@@ -774,5 +774,8 @@ char        *ssl_util_algotypestr(ssl_algo_t);
 char        *ssl_util_ptxtsub(apr_pool_t *, const char *, const char *, char *);
 void         ssl_util_thread_setup(server_rec *, apr_pool_t *);
 
+/* util functions for OpenSSL+sslc compat */
+int modssl_session_get_time(SSL_SESSION *session);
+
 #define APR_SHM_MAXSIZE (64 * 1024 * 1024)
 #endif /* __MOD_SSL_H__ */
index 57f91dd3185f542bd064171b9664e1502f0a1c33..540f203d54a0244d522413df7cd23f52adb05645 100644 (file)
@@ -1601,7 +1601,7 @@ int ssl_callback_NewSessionCacheEntry(SSL *ssl, SSL_SESSION *session)
     id = SSL_SESSION_get_session_id(session);
     idlen = SSL_SESSION_get_session_id_length(session);
 
-    timeout += SSL_get_time(session);
+    timeout += modssl_session_get_time(session);
 
     rc = ssl_scache_store(s, id, idlen, timeout, session);
 
index 8dd4015d6eeb19a23472fca79880dbdcbd50ab88..d56b4b9394945aed64f84e5a8b8e245f8754a5a7 100644 (file)
@@ -550,3 +550,15 @@ char *SSL_SESSION_id2sz(unsigned char *id, int idlen,
     return str;
 }
 
+/* sslc+OpenSSL compat */
+
+int modssl_session_get_time(SSL_SESSION *session)
+{
+#ifdef OPENSSL_VERSION_NUMBER
+    return SSL_SESSION_get_time(session);
+#else /* assume sslc */
+    CRYPTO_TIME_T ct;
+    SSL_SESSION_get_time(session, &ct);
+    return CRYPTO_time_to_int(&ct);
+#endif
+}