diff options
author | Matt Caswell <matt@openssl.org> | 2019-06-14 12:46:13 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-06-18 13:36:25 +0100 |
commit | 45436e611b3e11c948ea9f3273df971c9bb4c122 (patch) | |
tree | 7375c0044906ae4c519f1614c233aa06003e3f44 /ssl/ssl_sess.c | |
parent | e7a4682d0b347f0dfba629f4601a28801e54ad67 (diff) |
Fix a race condition in supported groups handling
In TLSv1.3 the supported groups can be negotiated each time a handshake
occurs, regardless of whether we are resuming or not. We should not store
the supported groups information in the session because session objects
can be shared between multiple threads and we can end up with race
conditions. For most users this won't be seen because, by default, we
use stateless tickets in TLSv1.3 which don't get shared. However if you
use SSL_OP_NO_TICKET (to get stateful tickets in TLSv1.3) then this can
happen.
The answer is to move the supported the supported group information into
the SSL object instead.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/9162)
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r-- | ssl/ssl_sess.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 508182a41b..9809fcc882 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -125,7 +125,6 @@ SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket) dest->ext.hostname = NULL; #ifndef OPENSSL_NO_EC dest->ext.ecpointformats = NULL; - dest->ext.supportedgroups = NULL; #endif dest->ext.tick = NULL; dest->ext.alpn_selected = NULL; @@ -201,14 +200,6 @@ SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket) if (dest->ext.ecpointformats == NULL) goto err; } - if (src->ext.supportedgroups) { - dest->ext.supportedgroups = - OPENSSL_memdup(src->ext.supportedgroups, - src->ext.supportedgroups_len - * sizeof(*src->ext.supportedgroups)); - if (dest->ext.supportedgroups == NULL) - goto err; - } #endif if (ticket != 0 && src->ext.tick != NULL) { @@ -797,9 +788,6 @@ void SSL_SESSION_free(SSL_SESSION *ss) OPENSSL_free(ss->ext.ecpointformats); ss->ext.ecpointformats = NULL; ss->ext.ecpointformats_len = 0; - OPENSSL_free(ss->ext.supportedgroups); - ss->ext.supportedgroups = NULL; - ss->ext.supportedgroups_len = 0; #endif /* OPENSSL_NO_EC */ #ifndef OPENSSL_NO_PSK OPENSSL_free(ss->psk_identity_hint); |