Skip to content

Commit

Permalink
Remove export ciphers from the DEFAULT cipher list
Browse files Browse the repository at this point in the history
They are moved to the COMPLEMENTOFDEFAULT instead.
This also fixes SSLv2 to be part of COMPLEMENTOFDEFAULT.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit f417997)

Conflicts:
	ssl/ssl_ciph.c
  • Loading branch information
kroeckx committed Mar 7, 2015
1 parent 0440d4e commit bc2e18a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGES
Expand Up @@ -4,7 +4,8 @@

Changes between 1.0.1l and 1.0.1m [xx XXX xxxx]

*)
*) Removed the export ciphers from the DEFAULT ciphers
[Kurt Roeckx]

Changes between 1.0.1k and 1.0.1l [15 Jan 2015]

Expand Down
4 changes: 2 additions & 2 deletions doc/apps/ciphers.pod
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion ssl/ssl.h
Expand Up @@ -334,7 +334,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
Expand Down
11 changes: 8 additions & 3 deletions ssl/ssl_ciph.c
Expand Up @@ -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
Expand Down Expand Up @@ -997,7 +997,10 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id,
cp->algorithm_enc, cp->algorithm_mac, cp->algorithm_ssl,
cp->algo_strength);
#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))
Expand All @@ -1016,6 +1019,8 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id,
continue;
}

ok:

#ifdef CIPHER_DEBUG
fprintf(stderr, "Action = %d\n", rule);
#endif
Expand Down

0 comments on commit bc2e18a

Please sign in to comment.