From e7a28df70bcf8677df6c5270eff8bbe8858b8fe9 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 13 Jan 2017 13:34:49 +0000 Subject: [PATCH] Add a TODO around handling of SSL_get_session() and SSL_get1_session() These functions are problematic in TLSv1.3 because the server sends the NewSessionTicket message after the handshake has finished. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2259) --- ssl/ssl_sess.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index c6d5c1247f..0d9bd7a528 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -44,6 +44,15 @@ static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s); static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *s); static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck); +/* + * TODO(TLS1.3): SSL_get_session() and SSL_get1_session() are problematic in + * TLS1.3 because, unlike in earlier protocol versions, the session ticket + * may not have been sent yet even though a handshake has finished. The session + * ticket data could come in sometime later...or even change if multiple session + * ticket messages are sent from the server. We need to work out how to deal + * with this. + */ + SSL_SESSION *SSL_get_session(const SSL *ssl) /* aka SSL_get0_session; gets 0 objects, just returns a copy of the pointer */ { -- 2.25.1