Blame SOURCES/freeradius-disable-internal-OpenSSL-cache.patch

305396
From c76016d3b8051f8e4f55cd547d29d4ac9ec33062 Mon Sep 17 00:00:00 2001
305396
From: "Alan T. DeKok" <aland@freeradius.org>
305396
Date: Mon, 8 May 2017 16:38:56 -0400
305396
Subject: [PATCH] disable internal OpenSSL cache
305396
305396
(cherry picked from commit af030bd4e19c9149e2ffd898ad0c4dfde78c29be)
305396
---
305396
 raddb/mods-available/eap  | 18 ++++++++----------
305396
 raddb/sites-available/tls | 17 ++++++++---------
305396
 src/main/tls.c            |  4 ++--
305396
 3 files changed, 18 insertions(+), 21 deletions(-)
305396
305396
diff --git a/raddb/mods-available/eap b/raddb/mods-available/eap
305396
index 95ef66619..e51860ac2 100644
305396
--- a/raddb/mods-available/eap
305396
+++ b/raddb/mods-available/eap
305396
@@ -352,6 +352,13 @@ eap {
305396
 			#  Deleting the entire "cache" subsection
305396
 			#  also disables caching.
305396
 			#
305396
+			#  As of version 3.0.4-8 (upstream 3.0.14), the
305396
+			#  session cache requires the use of the "name" and
305396
+			#  "persist_dir" configuration items, below.
305396
+			#
305396
+			#  The internal OpenSSL session cache has been
305396
+			#  permanently disabled.
305396
+			#
305396
 			#  You can disallow resumption for a
305396
 			#  particular user by adding the following
305396
 			#  attribute to the control item list:
305396
@@ -362,7 +369,7 @@ eap {
305396
 			#  enable resumption for just one user
305396
 			#  by setting the above attribute to "yes".
305396
 			#
305396
-			enable = yes
305396
+			enable = no
305396
 
305396
 			#
305396
 			#  Lifetime of the cached entries, in hours.
305396
@@ -372,15 +379,6 @@ eap {
305396
 			lifetime = 24 # hours
305396
 
305396
 			#
305396
-			#  The maximum number of entries in the
305396
-			#  cache.  Set to "0" for "infinite".
305396
-			#
305396
-			#  This could be set to the number of users
305396
-			#  who are logged in... which can be a LOT.
305396
-			#
305396
-			max_entries = 255
305396
-
305396
-			#
305396
 			#  Internal "name" of the session cache.
305396
 			#  Used to distinguish which TLS context
305396
 			#  sessions belong to.
305396
diff --git a/raddb/sites-available/tls b/raddb/sites-available/tls
305396
index 1ba876745..df687584e 100644
305396
--- a/raddb/sites-available/tls
305396
+++ b/raddb/sites-available/tls
305396
@@ -231,6 +231,14 @@ listen {
305396
 		      #  Deleting the entire "cache" subsection
305396
 		      #  Also disables caching.
305396
 		      #
305396
+		      #
305396
+		      #  As of version 3.0.4-8 (upstream 3.0.14), the session
305396
+		      #  cache requires the use of the "name" and
305396
+		      #  "persist_dir" configuration items, below.
305396
+		      #
305396
+		      #  The internal OpenSSL session cache has been
305396
+		      #  permanently disabled.
305396
+		      #
305396
 		      #  You can disallow resumption for a
305396
 		      #  particular user by adding the following
305396
 		      #  attribute to the control item list:
305396
@@ -251,15 +259,6 @@ listen {
305396
 		      lifetime = 24 # hours
305396
 
305396
 		      #
305396
-		      #  The maximum number of entries in the
305396
-		      #  cache.  Set to "0" for "infinite".
305396
-		      #
305396
-		      #  This could be set to the number of users
305396
-		      #  who are logged in... which can be a LOT.
305396
-		      #
305396
-		      max_entries = 255
305396
-
305396
-		      #
305396
 		      #  Internal "name" of the session cache.
305396
 		      #  Used to distinguish which TLS context
305396
 		      #  sessions belong to.
305396
diff --git a/src/main/tls.c b/src/main/tls.c
305396
index 42b538c4c..b790d2dc1 100644
305396
--- a/src/main/tls.c
305396
+++ b/src/main/tls.c
305396
@@ -2489,9 +2489,9 @@ post_ca:
305396
 		}
305396
 
305396
 		/*
305396
-		 *	Cache it, and DON'T auto-clear it.
305396
+		 *	Cache it, DON'T auto-clear it, and disable the internal OpenSSL session cache.
305396
 		 */
305396
-		SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_SERVER | SSL_SESS_CACHE_NO_AUTO_CLEAR);
305396
+		SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_SERVER | SSL_SESS_CACHE_NO_AUTO_CLEAR | SSL_SESS_CACHE_NO_INTERNAL);
305396
 
305396
 		SSL_CTX_set_session_id_context(ctx,
305396
 					       (unsigned char *) conf->session_context_id,
305396
-- 
305396
2.11.0
305396