Fix bug introduced by the attempt to fix client side external session
authorLutz Jänicke <jaenicke@openssl.org>
Wed, 20 Nov 2002 10:48:05 +0000 (10:48 +0000)
committerLutz Jänicke <jaenicke@openssl.org>
Wed, 20 Nov 2002 10:48:05 +0000 (10:48 +0000)
caching (#288): now internal caching failed (#351):
Make sure, that cipher_id is set before comparing.
Submitted by:
Reviewed by:
PR: 288 (and 351)

CHANGES
ssl/s3_clnt.c

diff --git a/CHANGES b/CHANGES
index 635262aff6704fdf7fac910cb500d216352beb64..e29a9a5efd2e2bf800764c8f096eb83a8fe942a4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,13 @@
 
  Changes between 0.9.6g and 0.9.6h  [xx XXX xxxx]
 
+  *) Bugfix: client side session caching did not work with external caching,
+     because the session->cipher setting was not restored when reloading
+     from the external cache. This problem was masked, when
+     SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG (part of SSL_OP_ALL) was set.
+     (Found by Steve Haslam <steve@araqnid.ddts.net>.)
+     [Lutz Jaenicke]
+
   *) Fix client_certificate (ssl/s2_clnt.c): The permissible total
      length of the REQUEST-CERTIFICATE message is 18 .. 34, not 17 .. 33.
      [Zeev Lieber <zeev-l@yahoo.com>]
index 22a0b097ac7cbe6824ffd8037efa337ab91351a2..727fae88f1a4bc096a2acbb431e1f669fb903fa9 100644 (file)
@@ -695,6 +695,11 @@ static int ssl3_get_server_hello(SSL *s)
                goto f_err;
                }
 
+       /* Depending on the session caching (internal/external), the cipher
+          and/or cipher_id values may not be set. Make sure that
+          cipher_id is set and use it for comparison. */
+       if (s->session->cipher)
+               s->session->cipher_id = s->session->cipher->id;
        if (s->hit && (s->session->cipher_id != c->id))
                {
                if (!(s->options &