diff options
author | delphij <delphij@FreeBSD.org> | 2016-01-30 06:12:03 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2016-01-30 06:12:03 +0000 |
commit | a4d15ab47c63b949c292515d36cc6e405d8e941c (patch) | |
tree | e4695fef63e1a4979a9c0d67674631ef93b6e98c | |
parent | c6068befe92b8a57c14895fce91c3f9f484112ae (diff) | |
download | FreeBSD-src-a4d15ab47c63b949c292515d36cc6e405d8e941c.zip FreeBSD-src-a4d15ab47c63b949c292515d36cc6e405d8e941c.tar.gz |
Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability.
Security: CVE-2015-3197
Security: FreeBSD-SA-16:11.openssl
Approved by: so
-rw-r--r-- | UPDATING | 4 | ||||
-rw-r--r-- | crypto/openssl/ssl/s2_srvr.c | 17 | ||||
-rw-r--r-- | sys/conf/newvers.sh | 2 |
3 files changed, 19 insertions, 4 deletions
@@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20160130 p29 FreeBSD-SA-16:11.openssl + + Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability. [SA-16:11] + 20160127 p28 FreeBSD-SA-16:09.ntp FreeBSD-SA-16:10.linux diff --git a/crypto/openssl/ssl/s2_srvr.c b/crypto/openssl/ssl/s2_srvr.c index 18e2813..d645e02 100644 --- a/crypto/openssl/ssl/s2_srvr.c +++ b/crypto/openssl/ssl/s2_srvr.c @@ -400,7 +400,7 @@ static int get_client_master_key(SSL *s) } cp=ssl2_get_cipher_by_char(p); - if (cp == NULL) + if (cp == NULL || sk_SSL_CIPHER_find(s->session->ciphers, cp) < 0) { ssl2_return_error(s,SSL2_PE_NO_CIPHER); SSLerr(SSL_F_GET_CLIENT_MASTER_KEY, SSL_R_NO_CIPHER_MATCH); @@ -698,9 +698,12 @@ static int get_client_hello(SSL *s) prio = cs; allow = cl; } - for (z=0; z<sk_SSL_CIPHER_num(prio); z++) + /* Generate list of SSLv2 ciphers shared between client and server */ + for (z = 0; z < sk_SSL_CIPHER_num(prio); z++) { - if (sk_SSL_CIPHER_find(allow,sk_SSL_CIPHER_value(prio,z)) < 0) + const SSL_CIPHER *cp = sk_SSL_CIPHER_value(prio, z); + if ((cp->algorithm_ssl & SSL_SSLV2) == 0 || + sk_SSL_CIPHER_find(allow, cp) < 0) { (void)sk_SSL_CIPHER_delete(prio,z); z--; @@ -711,6 +714,14 @@ static int get_client_hello(SSL *s) sk_SSL_CIPHER_free(s->session->ciphers); s->session->ciphers = prio; } + + /* Make sure we have at least one cipher in common */ + if (sk_SSL_CIPHER_num(s->session->ciphers) == 0) + { + ssl2_return_error(s, SSL2_PE_NO_CIPHER); + SSLerr(SSL_F_GET_CLIENT_HELLO, SSL_R_NO_CIPHER_MATCH); + return -1; + } /* s->session->ciphers should now have a list of * ciphers that are on both the client and server. * This list is ordered by the order the client sent diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index e496f8f..1f2c412 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="RELEASE-p28" +BRANCH="RELEASE-p29" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi |