Fix unconstrained session cache growth in TLSv1.3
[openssl.git] / ssl / statem / statem_srvr.c
index 99085a4cc11b0ced11fdf9820f7087ce520b789a..065e0b318a403e25b4198b89b68951b0c3397b7f 100644 (file)
@@ -2425,9 +2425,8 @@ CON_FUNC_RETURN tls_construct_server_hello(SSL_CONNECTION *s, WPACKET *pkt)
      * so the following won't overwrite an ID that we're supposed
      * to send back.
      */
-    if (s->session->not_resumable ||
-        (!(SSL_CONNECTION_GET_CTX(s)->session_cache_mode & SSL_SESS_CACHE_SERVER)
-         && !s->hit))
+    if (!(SSL_CONNECTION_GET_CTX(s)->session_cache_mode & SSL_SESS_CACHE_SERVER)
+            && !s->hit)
         s->session->session_id_length = 0;
 
     if (usetls13) {