Don't cache stateless tickets in TLSv1.3
authorMatt Caswell <matt@openssl.org>
Fri, 18 May 2018 10:31:31 +0000 (11:31 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 21 May 2018 09:36:03 +0000 (10:36 +0100)
commitee94ec2ef88e0ec25dedf2829d8e48dff0aa1c50
tree9cd04bdad174f00d3a4c3456ea316ae094903950
parent511190b691183a1fb160e7e05e2974dc73cab0c6
Don't cache stateless tickets in TLSv1.3

In TLSv1.2 and below we always cache new sessions by default on the server
side in the internal cache (even when we're using session tickets). This is
in order to support resumption from a session id.

In TLSv1.3 there is no session id. It is only possible to resume using the
ticket. Therefore, in the default case,  there is no point in caching the
session in the internal store.

There is still a reason to call the external cache new session callback
because applications may be using the callbacks just to know about when
sessions are created (and not necessarily implementing a full cache). If
the application also implements the remove session callback then we are
forced to also store it in the internal cache so that we can create
timeout events. Otherwise the external cache could just fill up
indefinitely.

This mostly addresses the issue described in #5628. That issue also proposes
having an option to not create full stateless tickets when using the
internal cache. That aspect hasn't been addressed yet.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/6293)
ssl/ssl_lib.c
test/sslapitest.c