summaryrefslogtreecommitdiffstats
path: root/ssl/statem/statem_srvr.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-06-21 16:54:55 +0100
committerMatt Caswell <matt@openssl.org>2018-06-26 18:09:46 +0100
commite880d4e58d1afe4d6e2d76646a8fbbe95fe05d40 (patch)
tree825b5beff2a3a473ea211fef7fe306e007e91042 /ssl/statem/statem_srvr.c
parent6cc0b3c2171e26379e898574cb6d42b8d8dcc113 (diff)
Use stateful tickets if we are doing anti-replay
During anti-replay we cache the ticket anyway, so there is no point in using a full stateless ticket. Fixes #6391 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Viktor Dukhovni <viktor@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6563)
Diffstat (limited to 'ssl/statem/statem_srvr.c')
-rw-r--r--ssl/statem/statem_srvr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
index ab16e632fd..9c44be0301 100644
--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -4082,7 +4082,13 @@ int tls_construct_new_session_ticket(SSL *s, WPACKET *pkt)
tctx->generate_ticket_cb(s, tctx->ticket_cb_data) == 0)
goto err;
- if ((s->options & SSL_OP_NO_TICKET) != 0 && SSL_IS_TLS13(s)) {
+ /*
+ * If we are using anti-replay protection then we behave as if
+ * SSL_OP_NO_TICKET is set - we are caching tickets anyway so there
+ * is no point in using full stateless tickets.
+ */
+ if (((s->options & SSL_OP_NO_TICKET) != 0 || s->max_early_data > 0)
+ && SSL_IS_TLS13(s)) {
if (!construct_stateful_ticket(s, pkt, age_add_u.age_add, tick_nonce)) {
/* SSLfatal() already called */
goto err;