Remove export ciphers from the DEFAULT cipher list
authorKurt Roeckx <kurt@roeckx.be>
Wed, 4 Mar 2015 20:57:52 +0000 (21:57 +0100)
committerKurt Roeckx <kurt@roeckx.be>
Sat, 7 Mar 2015 22:02:19 +0000 (23:02 +0100)
They are moved to the COMPLEMENTOFDEFAULT instead.
This also fixes SSLv2 to be part of COMPLEMENTOFDEFAULT.

Reviewed-by: Rich Salz <rsalz@openssl.org>
CHANGES
doc/apps/ciphers.pod
ssl/ssl.h
ssl/ssl_ciph.c

diff --git a/CHANGES b/CHANGES
index c1a07d7336139fdfb18f8ebc768743e7523b87dd..11d93b659180c420212a2ac5d50eefde3aabc3cf 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,7 +4,8 @@
 
  Changes between 1.0.2 and 1.0.2a [xx XXX xxxx]
 
-  *)
+  *) Removed the export ciphers from the DEFAULT ciphers
+     [Kurt Roeckx]
 
  Changes between 1.0.1l and 1.0.2 [22 Jan 2015]
 
index 4eeb55be2cd00d19790ce01b183e514ef5426671..e9280bc5021c8709d516ac171c23951c0f9e8842 100644 (file)
@@ -109,8 +109,8 @@ The following is a list of all permitted cipher strings and their meanings.
 
 =item B<DEFAULT>
 
-the default cipher list. This is determined at compile time and, as of OpenSSL
-1.0.0, is normally B<ALL:!aNULL:!eNULL>. This must be the first cipher string
+the default cipher list. This is determined at compile time and
+is normally B<ALL:!EXPORT:!aNULL:!eNULL:!SSLv2>. This must be the firstcipher string
 specified.
 
 =item B<COMPLEMENTOFDEFAULT>
index 2b0f6628c1badf1201790793772892a3bf02171e..a6d845dc994fc1110b9028cae7da86dbb598d5e3 100644 (file)
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -338,7 +338,7 @@ extern "C" {
  * The following cipher list is used by default. It also is substituted when
  * an application-defined cipher list string starts with 'DEFAULT'.
  */
-# define SSL_DEFAULT_CIPHER_LIST "ALL:!aNULL:!eNULL:!SSLv2"
+# define SSL_DEFAULT_CIPHER_LIST "ALL:!EXPORT:!aNULL:!eNULL:!SSLv2"
 /*
  * As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always
  * starts with a reasonable order, and all we have to do for DEFAULT is
index b038c55aef4ed551dcf32318d21cf4e94f705015..2cc9a4a21f75a65eddeff50e668bc118e8c2aa3e 100644 (file)
@@ -235,8 +235,8 @@ static const SSL_CIPHER cipher_aliases[] = {
      * "COMPLEMENTOFDEFAULT" (does *not* include ciphersuites not found in
      * ALL!)
      */
-    {0, SSL_TXT_CMPDEF, 0, SSL_kEDH | SSL_kEECDH, SSL_aNULL, ~SSL_eNULL, 0, 0,
-     0, 0, 0, 0},
+    {0, SSL_TXT_CMPDEF, 0, 0, SSL_aNULL, ~SSL_eNULL, 0, ~SSL_SSLV2,
+     SSL_EXP_MASK, 0, 0, 0},
 
     /*
      * key exchange aliases (some of those using only a single bit here
@@ -1027,6 +1027,10 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id,
             if (cipher_id && cipher_id != cp->id)
                 continue;
 #endif
+            if (algo_strength == SSL_EXP_MASK && SSL_C_IS_EXPORT(cp))
+                goto ok;
+            if (alg_ssl == ~SSL_SSLV2 && cp->algorithm_ssl == SSL_SSLV2)
+                goto ok;
             if (alg_mkey && !(alg_mkey & cp->algorithm_mkey))
                 continue;
             if (alg_auth && !(alg_auth & cp->algorithm_auth))
@@ -1045,6 +1049,8 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id,
                 continue;
         }
 
+    ok:
+
 #ifdef CIPHER_DEBUG
         fprintf(stderr, "Action = %d\n", rule);
 #endif