Fix session resumption
authorMatt Caswell <matt@openssl.org>
Wed, 5 Aug 2015 12:33:52 +0000 (13:33 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 1 Sep 2015 23:29:00 +0000 (00:29 +0100)
Commit f0348c842e7 introduced a problem with session resumption. The
version for the session is fixed when the session is created. By moving
the creation of the session earlier in the process the version is fixed
*before* version negotiation has completed when processing the ServerHello
on the client side. This fix updates the session version after version neg
has completed.

Reviewed-by: Emilia Käsper <emilia@openssl.org>
ssl/s23_clnt.c

index acbbe312ef0fbb8d0b580649c2b4668966636875..f782010c4782c87df1140e18c124ccf7bf38e53c 100644 (file)
@@ -736,6 +736,8 @@ static int ssl23_get_server_hello(SSL *s)
             goto err;
         }
 
             goto err;
         }
 
+        s->session->ssl_version = s->version;
+
         /* ensure that TLS_MAX_VERSION is up-to-date */
         OPENSSL_assert(s->version <= TLS_MAX_VERSION);
 
         /* ensure that TLS_MAX_VERSION is up-to-date */
         OPENSSL_assert(s->version <= TLS_MAX_VERSION);