Disable renegotiation.
authorBen Laurie <ben@openssl.org>
Thu, 5 Nov 2009 11:28:37 +0000 (11:28 +0000)
committerBen Laurie <ben@openssl.org>
Thu, 5 Nov 2009 11:28:37 +0000 (11:28 +0000)
CHANGES
ssl/s3_srvr.c
ssl/ssl.h
ssl/ssl_err.c

diff --git a/CHANGES b/CHANGES
index 800288673d7be3fc199a13b97cf5a709d775cd61..73cc1dec309ad37f14df0bb33cb297caf68a0154 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,13 @@
 
  Changes between 0.9.8k and 0.9.8l  [xx XXX xxxx]
 
+  *) Disable renegotiation completely - this fixes a severe security
+     problem at the cost of breaking all renegotiation. Renegotiation
+     can be re-enabled by setting
+     OPENSSL_ENABLE_UNSAFE_LEGACY_SESSION_RENEGOTATION at
+     compile-time. This is really not recommended.
+     [Ben Laurie]
+
   *) Fixes to stateless session resumption handling. Use initial_ctx when
      issuing and attempting to decrypt tickets in case it has changed during
      servername handling. Use a non-zero length session ID when attempting
index c698513a093951056937f27e8251150378c17523..057a9fad62c4b413ef2cbe0c45c723838b1eab8a 100644 (file)
@@ -718,6 +718,15 @@ int ssl3_get_client_hello(SSL *s)
 #endif
        STACK_OF(SSL_CIPHER) *ciphers=NULL;
 
+#ifndef OPENSSL_ENABLE_UNSAFE_LEGACY_SESSION_RENEGOTATION
+       if (s->new_session)
+               {
+               al=SSL_AD_HANDSHAKE_FAILURE;
+               SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_NO_RENEGOTIATION);
+               goto f_err;
+               }
+#endif  /* ndef OPENSSL_ENABLE_UNSAFE_LEGACY_SESSION_RENEGOTATION */
+
        /* We do this so that we will respond with our native type.
         * If we are TLSv1 and we get SSLv3, we will respond with TLSv1,
         * This down switching should be handled by a different method.
index 5982616222f6760f0f6490330fbb7e4627f7fbae..f94f0f0e9442f108acea7ea5e41f8d99f2c5a2c1 100644 (file)
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -1969,6 +1969,7 @@ void ERR_load_SSL_strings(void);
 #define SSL_R_NO_PRIVATE_KEY_ASSIGNED                   190
 #define SSL_R_NO_PROTOCOLS_AVAILABLE                    191
 #define SSL_R_NO_PUBLICKEY                              192
+#define SSL_R_NO_RENEGOTIATION                          319
 #define SSL_R_NO_SHARED_CIPHER                          193
 #define SSL_R_NO_VERIFY_CALLBACK                        194
 #define SSL_R_NULL_SSL_CTX                              195
index f965463bfa8888b2cfbf95dc3a81cd999cec8ead..898dc109797bd125c5b05f111730823bdddf5991 100644 (file)
@@ -388,6 +388,7 @@ static ERR_STRING_DATA SSL_str_reasons[]=
 {ERR_REASON(SSL_R_NO_PRIVATE_KEY_ASSIGNED),"no private key assigned"},
 {ERR_REASON(SSL_R_NO_PROTOCOLS_AVAILABLE),"no protocols available"},
 {ERR_REASON(SSL_R_NO_PUBLICKEY)          ,"no publickey"},
+{ERR_REASON(SSL_R_NO_RENEGOTIATION)      ,"no renegotiation"},
 {ERR_REASON(SSL_R_NO_SHARED_CIPHER)      ,"no shared cipher"},
 {ERR_REASON(SSL_R_NO_VERIFY_CALLBACK)    ,"no verify callback"},
 {ERR_REASON(SSL_R_NULL_SSL_CTX)          ,"null ssl ctx"},