diff options
author | Matt Caswell <matt@openssl.org> | 2024-03-15 17:58:42 +0000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-04-08 12:09:42 +0200 |
commit | c342f4b8bd2d0b375b0e22337057c2eab47d9b96 (patch) | |
tree | 69a1a573e2f3fe57f533dea4fbf70a8bf46576ec | |
parent | e32ad41b48c28d82339de064b05d5e269e5aed97 (diff) |
Hardening around not_resumable sessions
Make sure we can't inadvertently use a not_resumable session
Related to CVE-2024-2511
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24044)
-rw-r--r-- | ssl/ssl_sess.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 241cf43c46..5ce0d308c1 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -533,6 +533,12 @@ SSL_SESSION *lookup_sess_in_cache(SSL *s, const unsigned char *sess_id, ret = s->session_ctx->get_session_cb(s, sess_id, sess_id_len, ©); if (ret != NULL) { + if (ret->not_resumable) { + /* If its not resumable then ignore this session */ + if (!copy) + SSL_SESSION_free(ret); + return NULL; + } ssl_tsan_counter(s->session_ctx, &s->session_ctx->stats.sess_cb_hit); |