Blame SOURCES/vsftpd-2.2.2-tlsv1_2.patch

ac8676
diff --git a/parseconf.c b/parseconf.c
ac8676
index a2c715b..33a1349 100644
ac8676
--- a/parseconf.c
ac8676
+++ b/parseconf.c
ac8676
@@ -85,6 +85,8 @@ parseconf_bool_array[] =
ac8676
   { "ssl_sslv2", &tunable_sslv2 },
ac8676
   { "ssl_sslv3", &tunable_sslv3 },
ac8676
   { "ssl_tlsv1", &tunable_tlsv1 },
ac8676
+  { "ssl_tlsv1_1", &tunable_tlsv1_1 },
ac8676
+  { "ssl_tlsv1_2", &tunable_tlsv1_2 },
ac8676
   { "tilde_user_enable", &tunable_tilde_user_enable },
ac8676
   { "force_anon_logins_ssl", &tunable_force_anon_logins_ssl },
ac8676
   { "force_anon_data_ssl", &tunable_force_anon_data_ssl },
ac8676
diff --git a/ssl.c b/ssl.c
ac8676
index da23f87..94c2b6b 100644
ac8676
--- a/ssl.c
ac8676
+++ b/ssl.c
ac8676
@@ -135,6 +135,14 @@ ssl_init(struct vsf_session* p_sess)
ac8676
     {
ac8676
       options |= SSL_OP_NO_TLSv1;
ac8676
     }
ac8676
+    if (!tunable_tlsv1_1)
ac8676
+    {
ac8676
+      options |= SSL_OP_NO_TLSv1_1;
ac8676
+    }
ac8676
+    if (!tunable_tlsv1_2)
ac8676
+    {
ac8676
+      options |= SSL_OP_NO_TLSv1_2;
ac8676
+    }
ac8676
     SSL_CTX_set_options(p_ctx, options);
ac8676
     if (tunable_rsa_cert_file)
ac8676
     {
ac8676
diff --git a/tunables.c b/tunables.c
ac8676
index 742284e..08d5490 100644
ac8676
--- a/tunables.c
ac8676
+++ b/tunables.c
ac8676
@@ -66,6 +66,8 @@ int tunable_force_local_data_ssl;
ac8676
 int tunable_sslv2;
ac8676
 int tunable_sslv3;
ac8676
 int tunable_tlsv1;
ac8676
+int tunable_tlsv1_1;
ac8676
+int tunable_tlsv1_2;
ac8676
 int tunable_tilde_user_enable;
ac8676
 int tunable_force_anon_logins_ssl;
ac8676
 int tunable_force_anon_data_ssl;
ac8676
@@ -209,7 +211,9 @@ tunables_load_defaults()
ac8676
   tunable_force_local_data_ssl = 1;
ac8676
   tunable_sslv2 = 0;
ac8676
   tunable_sslv3 = 0;
ac8676
-  tunable_tlsv1 = 1;
ac8676
+  tunable_tlsv1 = 0;
ac8676
+  tunable_tlsv1_1 = 0;
ac8676
+  tunable_tlsv1_2 = 1;
ac8676
   tunable_tilde_user_enable = 0;
ac8676
   tunable_force_anon_logins_ssl = 0;
ac8676
   tunable_force_anon_data_ssl = 0;
ac8676
diff --git a/tunables.h b/tunables.h
ac8676
index 3e2d40c..a466427 100644
ac8676
--- a/tunables.h
ac8676
+++ b/tunables.h
ac8676
@@ -67,6 +67,8 @@ extern int tunable_force_local_data_ssl;      /* Require local data uses SSL */
ac8676
 extern int tunable_sslv2;                     /* Allow SSLv2 */
ac8676
 extern int tunable_sslv3;                     /* Allow SSLv3 */
ac8676
 extern int tunable_tlsv1;                     /* Allow TLSv1 */
ac8676
+extern int tunable_tlsv1_1;                   /* Allow TLSv1.1 */
ac8676
+extern int tunable_tlsv1_2;                   /* Allow TLSv1.2 */
ac8676
 extern int tunable_tilde_user_enable;         /* Support e.g. ~chris */
ac8676
 extern int tunable_force_anon_logins_ssl;     /* Require anon logins use SSL */
ac8676
 extern int tunable_force_anon_data_ssl;       /* Require anon data uses SSL */
ac8676
diff --git a/vsftpd.conf.5 b/vsftpd.conf.5
ac8676
index cf1ae34..6f36b1b 100644
ac8676
--- a/vsftpd.conf.5
ac8676
+++ b/vsftpd.conf.5
ac8676
@@ -506,7 +506,7 @@ Default: YES
ac8676
 Only applies if
ac8676
 .BR ssl_enable
ac8676
 is activated. If enabled, this option will permit SSL v2 protocol connections.
ac8676
-TLS v1 connections are preferred.
ac8676
+TLS v1.2 connections are preferred.
ac8676
 
ac8676
 Default: NO
ac8676
 .TP
ac8676
@@ -514,7 +514,7 @@ Default: NO
ac8676
 Only applies if
ac8676
 .BR ssl_enable
ac8676
 is activated. If enabled, this option will permit SSL v3 protocol connections.
ac8676
-TLS v1 connections are preferred.
ac8676
+TLS v1.2 connections are preferred.
ac8676
 
ac8676
 Default: NO
ac8676
 .TP
ac8676
@@ -522,7 +522,23 @@ Default: NO
ac8676
 Only applies if
ac8676
 .BR ssl_enable
ac8676
 is activated. If enabled, this option will permit TLS v1 protocol connections.
ac8676
-TLS v1 connections are preferred.
ac8676
+TLS v1.2 connections are preferred.
ac8676
+
ac8676
+Default: NO
ac8676
+.TP
ac8676
+.B ssl_tlsv1_1
ac8676
+Only applies if
ac8676
+.BR ssl_enable
ac8676
+is activated. If enabled, this option will permit TLS v1.1 protocol connections.
ac8676
+TLS v1.2 connections are preferred.
ac8676
+
ac8676
+Default: NO
ac8676
+.TP
ac8676
+.B ssl_tlsv1_2
ac8676
+Only applies if
ac8676
+.BR ssl_enable
ac8676
+is activated. If enabled, this option will permit TLS v1.2 protocol connections.
ac8676
+TLS v1.2 connections are preferred.
ac8676
 
ac8676
 Default: YES
ac8676
 .TP