From: Emilia Kasper Date: Wed, 19 Nov 2014 14:42:43 +0000 (+0100) Subject: Reset s->tlsext_ticket_expected in ssl_scan_serverhello_tlsext. X-Git-Tag: OpenSSL_1_0_2-pre-reformat~123 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce5f32cfa717fa3bbc13b99974b57bd8660e454a;p=openssl Reset s->tlsext_ticket_expected in ssl_scan_serverhello_tlsext. 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 (cherry picked from commit a06cd5d056c6a5b1d161786873e21a5e53d554d8) --- diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 3c270fee2d..16a39c824b 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -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: diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index f85a0b8c08..160ce7628a 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -2560,6 +2560,7 @@ static int ssl_scan_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char #ifndef OPENSSL_NO_NEXTPROTONEG s->s3->next_proto_neg_seen = 0; #endif + s->tlsext_ticket_expected = 0; if (s->s3->alpn_selected) {