diff options
author | Xin LI <delphij@FreeBSD.org> | 2016-01-30 06:12:03 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2016-01-30 06:12:03 +0000 |
commit | 76061d993c05ba35f39d4f5083419629aee1b57c (patch) | |
tree | 67c1089c1105871c669c7265561f43a71f376378 | |
parent | a3f8b44f4615a98ace3f14adc17963dc0dc2c9d4 (diff) | |
download | src-76061d993c05ba35f39d4f5083419629aee1b57c.tar.gz src-76061d993c05ba35f39d4f5083419629aee1b57c.zip |
Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability.
Security: CVE-2015-3197
Security: FreeBSD-SA-16:11.openssl
Approved by: so
Notes
Notes:
svn path=/releng/10.2/; revision=295061
-rw-r--r-- | UPDATING | 4 | ||||
-rw-r--r-- | crypto/openssl/ssl/s2_srvr.c | 15 | ||||
-rw-r--r-- | sys/conf/newvers.sh | 2 |
3 files changed, 18 insertions, 3 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 p12 FreeBSD-SA-16:11.openssl + + Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability. [SA-16:11] + 20160127 p11 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 4289272b73d3..8ab7a6aefac5 100644 --- a/crypto/openssl/ssl/s2_srvr.c +++ b/crypto/openssl/ssl/s2_srvr.c @@ -402,7 +402,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); return (-1); @@ -687,8 +687,12 @@ static int get_client_hello(SSL *s) prio = cs; allow = cl; } + + /* 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--; } @@ -697,6 +701,13 @@ 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 diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index e31b380752a0..eb1b8c575873 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.2" -BRANCH="RELEASE-p11" +BRANCH="RELEASE-p12" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi |