]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Hardening around not_resumable sessions
authorMatt Caswell <matt@openssl.org>
Fri, 15 Mar 2024 17:58:42 +0000 (17:58 +0000)
committerTomas Mraz <tomas@openssl.org>
Mon, 8 Apr 2024 10:07:42 +0000 (12:07 +0200)
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/24042)

(cherry picked from commit 21df7f04f6c4a560b4de56d10e1e58958c7e566d)

ssl/ssl_sess.c

index 60ceacde4effec0972904b13f60373e874576956..eaa9595f8c2f2ecbcb064848d6f075fcea270362 100644 (file)
@@ -519,6 +519,12 @@ SSL_SESSION *lookup_sess_in_cache(SSL_CONNECTION *s,
                                              sess_id, sess_id_len, &copy);
 
         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);