Reset s->tlsext_ticket_expected in ssl_scan_serverhello_tlsext.
authorEmilia Kasper <emilia@openssl.org>
Wed, 19 Nov 2014 14:42:43 +0000 (15:42 +0100)
committerEmilia Kasper <emilia@openssl.org>
Thu, 20 Nov 2014 14:20:16 +0000 (15:20 +0100)
This ensures that it's zeroed even if the SSL object is reused
(as in ssltest.c). It also ensures that it applies to DTLS, too.

Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit a06cd5d056c6a5b1d161786873e21a5e53d554d8)

ssl/s3_clnt.c
ssl/t1_lib.c

index 403b68420510dea7479d172c2b0e3a058e82208b..4b86f17419893e4843faefe144a8ee0e2ea93179 100644 (file)
@@ -226,14 +226,6 @@ int ssl3_connect(SSL *s)
                        s->renegotiate=1;
                        s->state=SSL_ST_CONNECT;
                        s->ctx->stats.sess_connect_renegotiate++;
-#ifndef OPENSSL_NO_TLSEXT
-                       /*
-                        * If renegotiating, the server may choose to not issue
-                        * a new ticket, so reset the flag. It will be set to
-                        * the right value when parsing ServerHello extensions.
-                        */
-                       s->tlsext_ticket_expected = 0;
-#endif
                        /* break */
                case SSL_ST_BEFORE:
                case SSL_ST_CONNECT:
index f5728c28d97dd7eadf45808b5fffe4c3b34cf443..c7032f717d403082eb77aaf46b87663c27f841b3 100644 (file)
@@ -1513,6 +1513,7 @@ int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
 #ifndef OPENSSL_NO_NEXTPROTONEG
        s->s3->next_proto_neg_seen = 0;
 #endif
+        s->tlsext_ticket_expected = 0;
 
 #ifndef OPENSSL_NO_HEARTBEATS
        s->tlsext_heartbeat &= ~(SSL_TLSEXT_HB_ENABLED |