diff options
author | Matt Caswell <matt@openssl.org> | 2018-06-21 16:54:55 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-06-26 18:09:46 +0100 |
commit | e880d4e58d1afe4d6e2d76646a8fbbe95fe05d40 (patch) | |
tree | 825b5beff2a3a473ea211fef7fe306e007e91042 /ssl/statem/extensions_srvr.c | |
parent | 6cc0b3c2171e26379e898574cb6d42b8d8dcc113 (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/extensions_srvr.c')
-rw-r--r-- | ssl/statem/extensions_srvr.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c index 48be0444af..f58ed0b582 100644 --- a/ssl/statem/extensions_srvr.c +++ b/ssl/statem/extensions_srvr.c @@ -1159,7 +1159,13 @@ int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x, uint32_t ticket_age = 0, now, agesec, agems; int ret; - if ((s->options & SSL_OP_NO_TICKET) != 0) + /* + * 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) ret = tls_get_stateful_ticket(s, &identity, &sess); else ret = tls_decrypt_ticket(s, PACKET_data(&identity), |