fix support for receiving fragmented handshake messages
authorBodo Möller <bodo@openssl.org>
Wed, 29 Nov 2006 14:45:14 +0000 (14:45 +0000)
committerBodo Möller <bodo@openssl.org>
Wed, 29 Nov 2006 14:45:14 +0000 (14:45 +0000)
CHANGES
ssl/d1_pkt.c
ssl/s23_clnt.c
ssl/s23_srvr.c
ssl/s3_pkt.c
ssl/s3_srvr.c

diff --git a/CHANGES b/CHANGES
index 8a91de7eb73ee634b518011bc7111a96716f303d..e1b33745e503f5b1391f6db9c1478b9101a0269d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,13 @@
 
  Changes between 0.9.8d and 0.9.8e  [XX xxx XXXX]
 
+  *) Have SSL/TLS server implementation tolerate "mismatched" record
+     protocol version while receiving ClientHello even if the
+     ClientHello is fragmented.  (The server can't insist on the
+     particular protocol version it has chosen before the ServerHello
+     message has informed the client about his choice.)
+     [Bodo Moeller]
+
   *) Add RFC 3779 support.
      [Rob Austein for ARIN, Ben Laurie]
 
      differing sizes.
      [Richard Levitte]
 
+ Changes between 0.9.7l and 0.9.7m  [xx XXX xxxx]
+
+  *) Have SSL/TLS server implementation tolerate "mismatched" record
+     protocol version while receiving ClientHello even if the
+     ClientHello is fragmented.  (The server can't insist on the
+     particular protocol version it has chosen before the ServerHello
+     message has informed the client about his choice.)
+     [Bodo Moeller]
+
+  *) Load error codes if they are not already present instead of using a
+     static variable. This allows them to be cleanly unloaded and reloaded.
+     [Steve Henson]
+
  Changes between 0.9.7k and 0.9.7l  [28 Sep 2006]
 
   *) Introduce limits to prevent malicious keys being able to
index f8f45165255606d995e962f7d63e0d5533c48add..8270419a8dceac6b69db4cf54733305d885c29b8 100644 (file)
@@ -533,11 +533,7 @@ again:
                n2s(p,rr->length);
 
                /* Lets check version */
-               if (s->first_packet)
-                       {
-                       s->first_packet=0;
-                       }
-               else
+               if (!s->first_packet)
                        {
                        if (version != s->version)
                                {
index ed4ee72393ef65a3df468a4b513c6c74eb439d0e..769dabdbb83cd34f9cd27a6c6f035e477d5ff717 100644 (file)
@@ -574,7 +574,6 @@ static int ssl23_get_server_hello(SSL *s)
        if (!ssl_get_new_session(s,0))
                goto err;
 
-       s->first_packet=1;
        return(SSL_connect(s));
 err:
        return(-1);
index da4f377e76ead2d2bc16e4252e068cbab29e12da..6637bb954906d1d79d3224783255d85fd8d38299 100644 (file)
@@ -565,7 +565,6 @@ int ssl23_get_client_hello(SSL *s)
        s->init_num=0;
 
        if (buf != buf_space) OPENSSL_free(buf);
-       s->first_packet=1;
        return(SSL_accept(s));
 err:
        if (buf != buf_space) OPENSSL_free(buf);
index d0f54e297bb7af5e53ff732363c5c6c85b530dd4..44c7c143fe7e9c75e40633de41bbbb7410051d6b 100644 (file)
@@ -277,11 +277,7 @@ again:
                n2s(p,rr->length);
 
                /* Lets check version */
-               if (s->first_packet)
-                       {
-                       s->first_packet=0;
-                       }
-               else
+               if (!s->first_packet)
                        {
                        if (version != s->version)
                                {
index 9f84e3e4dcd53e14b07782552fba4e0eb633116f..a74e541acb9c7b1395df48aaf5e884d453fdb46e 100644 (file)
@@ -680,9 +680,9 @@ int ssl3_get_client_hello(SSL *s)
         */
        if (s->state == SSL3_ST_SR_CLNT_HELLO_A)
                {
-               s->first_packet=1;
                s->state=SSL3_ST_SR_CLNT_HELLO_B;
                }
+       s->first_packet=1;
        n=s->method->ssl_get_message(s,
                SSL3_ST_SR_CLNT_HELLO_B,
                SSL3_ST_SR_CLNT_HELLO_C,
@@ -691,6 +691,7 @@ int ssl3_get_client_hello(SSL *s)
                &ok);
 
        if (!ok) return((int)n);
+       s->first_packet=0;
        d=p=(unsigned char *)s->init_msg;
 
        /* use version from inside client hello, not from record header