summaryrefslogtreecommitdiffstats
path: root/ssl/s3_clnt.c
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2014-10-28 17:35:59 +0100
committerEmilia Kasper <emilia@openssl.org>2014-10-28 17:41:49 +0100
commit9bdedec0cf37b923024377c0280a1c134e9c49c6 (patch)
tree5e1faff75760eba97ab97943208b54f9a355e12b /ssl/s3_clnt.c
parentf63fa8b10a08fcd344f08df16b43c19dadb17055 (diff)
Tighten session ticket handling
Tighten client-side session ticket handling during renegotiation: ensure that the client only accepts a session ticket if the server sends the extension anew in the ServerHello. Previously, a TLS client would reuse the old extension state and thus accept a session ticket if one was announced in the initial ServerHello. Reviewed-by: Bodo Moeller <bodo@openssl.org> (cherry picked from commit d663df2399d1d9d6015bcfd2ec87b925ea3558a2) Conflicts: CHANGES
Diffstat (limited to 'ssl/s3_clnt.c')
-rw-r--r--ssl/s3_clnt.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
index 263e6348c9..1e691b9a63 100644
--- a/ssl/s3_clnt.c
+++ b/ssl/s3_clnt.c
@@ -225,6 +225,14 @@ 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:
@@ -2223,7 +2231,7 @@ int ssl3_get_new_session_ticket(SSL *s)
}
memcpy(s->session->tlsext_tick, p, ticklen);
s->session->tlsext_ticklen = ticklen;
- /* There are two ways to detect a resumed ticket sesion.
+ /* There are two ways to detect a resumed ticket session.
* One is to set an appropriate session ID and then the server
* must return a match in ServerHello. This allows the normal
* client session ID matching to work and we know much