]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Tell openssl to build its TLS contexts with security level 1
authorNick Mathewson <nickm@torproject.org>
Fri, 7 Sep 2018 12:57:14 +0000 (08:57 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 7 Sep 2018 13:15:06 +0000 (09:15 -0400)
Fixes bug 27344, where we'd break compatibility with old tors by
rejecting RSA1024 and DH1024.

changes/bug27344 [new file with mode: 0644]
configure.ac
src/common/tortls.c

diff --git a/changes/bug27344 b/changes/bug27344
new file mode 100644 (file)
index 0000000..9f66855
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor features (compatibility):
+    - Tell OpenSSL to maintain backward compatibility with previous
+      RSA1024/DH1024 users in Tor. With OpenSSL 1.1.1-pre6, these ciphers
+      are disabled by default. Closes ticket 27344.
index 76b3f423aed9fb42506c9f9d4d5edd6189e4cb2c..5ac3579d7009bcfc3d0e6b4650a0ce926f5584ba 100644 (file)
@@ -678,6 +678,7 @@ AC_CHECK_FUNCS([ \
                 SSL_get_client_ciphers \
                 SSL_get_client_random \
                SSL_CIPHER_find \
+                SSL_CTX_set_security_level \
                TLS_method
               ])
 
index 4cbe8b10e50d4a3261fbe07cf26bb47be415e1fe..1f2fe1ce186a6ccb8fe24c098508e8bb212e59bb 100644 (file)
@@ -1130,6 +1130,11 @@ tor_tls_context_new(crypto_pk_t *identity, unsigned int key_lifetime,
   if (!(result->ctx = SSL_CTX_new(SSLv23_method())))
     goto error;
 #endif
+#ifdef HAVE_SSL_CTX_SET_SECURITY_LEVEL
+  /* Level 1 re-enables RSA1024 and DH1024 for compatibility with old tors */
+  SSL_CTX_set_security_level(result->ctx, 1);
+#endif
+
   SSL_CTX_set_options(result->ctx, SSL_OP_NO_SSLv2);
   SSL_CTX_set_options(result->ctx, SSL_OP_NO_SSLv3);
 
@@ -2555,4 +2560,3 @@ evaluate_ecgroup_for_tls(const char *ecgroup)
 
   return ret;
 }
-