Blame SOURCES/openssl-fips-0.9.8e-cve-2010-4180.patch

c4366c
*) Disable code workaround for ancient and obsolete Netscape browsers
c4366c
and servers: an attacker can use it in a ciphersuite downgrade attack.
c4366c
Thanks to Martin Rex for discovering this bug. CVE-2010-4180
c4366c
diff -up openssl-fips-0.9.8e/doc/ssl/SSL_CTX_set_options.pod.disable-nsbug openssl-fips-0.9.8e/doc/ssl/SSL_CTX_set_options.pod
c4366c
--- openssl-fips-0.9.8e/doc/ssl/SSL_CTX_set_options.pod.disable-nsbug	2010-12-07 17:45:32.000000000 +0100
c4366c
+++ openssl-fips-0.9.8e/doc/ssl/SSL_CTX_set_options.pod	2010-12-07 17:45:33.000000000 +0100
c4366c
@@ -78,18 +78,7 @@ this breaks this server so 16 bytes is t
c4366c
 
c4366c
 =item SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
c4366c
 
c4366c
-ssl3.netscape.com:443, first a connection is established with RC4-MD5.
c4366c
-If it is then resumed, we end up using DES-CBC3-SHA.  It should be
c4366c
-RC4-MD5 according to 7.6.1.3, 'cipher_suite'.
c4366c
-
c4366c
-Netscape-Enterprise/2.01 (https://merchant.netscape.com) has this bug.
c4366c
-It only really shows up when connecting via SSLv2/v3 then reconnecting
c4366c
-via SSLv3. The cipher list changes....
c4366c
-
c4366c
-NEW INFORMATION.  Try connecting with a cipher list of just
c4366c
-DES-CBC-SHA:RC4-MD5.  For some weird reason, each new connection uses
c4366c
-RC4-MD5, but a re-connect tries to use DES-CBC-SHA.  So netscape, when
c4366c
-doing a re-connect, always takes the first cipher in the cipher list.
c4366c
+This option has no effect anymore.
c4366c
 
c4366c
 =item SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
c4366c
 
c4366c
diff -up openssl-fips-0.9.8e/ssl/ssl.h.disable-nsbug openssl-fips-0.9.8e/ssl/ssl.h
c4366c
--- openssl-fips-0.9.8e/ssl/ssl.h.disable-nsbug	2010-12-07 17:45:32.000000000 +0100
c4366c
+++ openssl-fips-0.9.8e/ssl/ssl.h	2010-12-07 17:45:33.000000000 +0100
c4366c
@@ -482,7 +482,7 @@ typedef struct ssl_session_st
c4366c
 #define SSL_OP_NETSCAPE_CHALLENGE_BUG			0x00000002L
c4366c
 /* Allow initial connection to servers that don't support RI */
c4366c
 #define SSL_OP_LEGACY_SERVER_CONNECT			0x00000004L
c4366c
-#define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG		0x00000008L /* can break some security expectations */
c4366c
+#define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG		0x00000008L /* no effect anymore */
c4366c
 #define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG		0x00000010L
c4366c
 #define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER		0x00000020L
c4366c
 #define SSL_OP_MSIE_SSLV2_RSA_PADDING			0x00000040L /* no effect since 0.9.7h and 0.9.8b */
c4366c
diff -up openssl-fips-0.9.8e/ssl/s3_clnt.c.disable-nsbug openssl-fips-0.9.8e/ssl/s3_clnt.c
c4366c
--- openssl-fips-0.9.8e/ssl/s3_clnt.c.disable-nsbug	2010-12-07 17:45:32.000000000 +0100
c4366c
+++ openssl-fips-0.9.8e/ssl/s3_clnt.c	2010-12-07 17:45:33.000000000 +0100
c4366c
@@ -752,8 +752,11 @@ int ssl3_get_server_hello(SSL *s)
c4366c
 		s->session->cipher_id = s->session->cipher->id;
c4366c
 	if (s->hit && (s->session->cipher_id != c->id))
c4366c
 		{
c4366c
+/* Workaround is now obsolete */
c4366c
+#if 0
c4366c
 		if (!(s->options &
c4366c
 			SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG))
c4366c
+#endif
c4366c
 			{
c4366c
 			al=SSL_AD_ILLEGAL_PARAMETER;
c4366c
 			SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED);
c4366c
diff -up openssl-fips-0.9.8e/ssl/s3_srvr.c.disable-nsbug openssl-fips-0.9.8e/ssl/s3_srvr.c
c4366c
--- openssl-fips-0.9.8e/ssl/s3_srvr.c.disable-nsbug	2010-12-07 17:46:11.000000000 +0100
c4366c
+++ openssl-fips-0.9.8e/ssl/s3_srvr.c	2010-12-07 17:46:15.000000000 +0100
c4366c
@@ -870,12 +870,14 @@ int ssl3_get_client_hello(SSL *s)
c4366c
 			}
c4366c
 		if (j == 0)
c4366c
 			{
c4366c
+#if 0
c4366c
 			if ((s->options & SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG) && (sk_SSL_CIPHER_num(ciphers) == 1))
c4366c
 				{
c4366c
 				/* Very bad for multi-threading.... */
c4366c
 				s->session->cipher=sk_SSL_CIPHER_value(ciphers, 0);
c4366c
 				}
c4366c
 			else
c4366c
+#endif
c4366c
 				{
c4366c
 				/* we need to have the cipher in the cipher
c4366c
 				 * list if we are asked to reuse it */