<pre style='margin:0'>
Clemens Lang (neverpanic) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/9000a4c0877eb4754cb6c785705b018198d942d9">https://github.com/macports/macports-ports/commit/9000a4c0877eb4754cb6c785705b018198d942d9</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 9000a4c0877 openssl3: Fix CVE-2024-2511
</span>9000a4c0877 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 9000a4c0877eb4754cb6c785705b018198d942d9
</span>Author: Clemens Lang <cal@macports.org>
AuthorDate: Tue Apr 9 12:32:04 2024 +0200
<span style='display:block; white-space:pre;color:#404040;'> openssl3: Fix CVE-2024-2511
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> See https://www.openssl.org/news/secadv/20240408.txt for the upstream
</span><span style='display:block; white-space:pre;color:#404040;'> advisory.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> No revbump because there's no ABI change.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> CVE: CVE-2024-2511
</span>---
devel/openssl3/Portfile | 21 ++--
.../7e4d731b1c07201ad9374c1cd9ac5263bdf35bce.patch | 116 +++++++++++++++++++++
.../e9d7083e241670332e0443da0f0d4ffb52829f08.patch | 116 +++++++++++++++++++++
3 files changed, 245 insertions(+), 8 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/openssl3/Portfile b/devel/openssl3/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 0d06cec14b8..08f356b7b61 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/openssl3/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/openssl3/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -13,7 +13,7 @@ name openssl$major_v
</span> # For rolling back to 3.1.4 release where needed. Must now stay.
epoch 1
version ${major_v}.2.1
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span>
# Please revbump these ports when updating the openssl3 version/revision
# - freeradius (#43461)
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -54,7 +54,9 @@ checksums rmd160 0182f83617754e1a2b0f6864679a7cd9c088e172 \
</span> sha256 83c7329fe52c850677d75e5d0b0ca245309b97e8ecbcfdc1dfdc4ab9fac35b39 \
size 17733249
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# 3.2.0 is currently broken for OS < 10.14
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles e9d7083e241670332e0443da0f0d4ffb52829f08.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# 3.2.0 is currently broken for OS < 10.14, see #68766
</span> if {${os.platform} eq "darwin" && ${os.major} < 18} {
subport ${name}-devel {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -63,14 +65,17 @@ if {${os.platform} eq "darwin" && ${os.major} < 18} {
</span>
if {$subport eq $name} {
conflicts ${name}-devel
<span style='display:block; white-space:pre;background:#ffe0e0;'>- version ${major_v}.1.5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ version ${major_v}.1.5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ distname openssl-${version}
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- distname openssl-${version}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ checksums rmd160 9c3e80f27e0b15b6b46774a944d75cf034358474 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 6ae015467dabf0469b139ada93319327be24b98251ffaeceda0221848dc09262 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 15663524
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- checksums rmd160 9c3e80f27e0b15b6b46774a944d75cf034358474 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 6ae015467dabf0469b139ada93319327be24b98251ffaeceda0221848dc09262 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size 15663524
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-replace e9d7083e241670332e0443da0f0d4ffb52829f08.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 7e4d731b1c07201ad9374c1cd9ac5263bdf35bce.patch
</span> }
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/openssl3/files/7e4d731b1c07201ad9374c1cd9ac5263bdf35bce.patch b/devel/openssl3/files/7e4d731b1c07201ad9374c1cd9ac5263bdf35bce.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..2b002ec5cf6
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/openssl3/files/7e4d731b1c07201ad9374c1cd9ac5263bdf35bce.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,116 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 7e4d731b1c07201ad9374c1cd9ac5263bdf35bce Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Matt Caswell <matt@openssl.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Tue, 5 Mar 2024 15:43:53 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] Fix unconstrained session cache growth in TLSv1.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+In TLSv1.3 we create a new session object for each ticket that we send.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+We do this by duplicating the original session. If SSL_OP_NO_TICKET is in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+use then the new session will be added to the session cache. However, if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+early data is not in use (and therefore anti-replay protection is being
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+used), then multiple threads could be resuming from the same session
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+simultaneously. If this happens and a problem occurs on one of the threads,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then the original session object could be marked as not_resumable. When we
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+duplicate the session object this not_resumable status gets copied into the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new session object. The new session object is then added to the session
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+cache even though it is not_resumable.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subsequently, another bug means that the session_id_length is set to 0 for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+sessions that are marked as not_resumable - even though that session is
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+still in the cache. Once this happens the session can never be removed from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+the cache. When that object gets to be the session cache tail object the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+cache never shrinks again and grows indefinitely.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+CVE-2024-2511
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Reviewed-by: Neil Horman <nhorman@openssl.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Reviewed-by: Tomas Mraz <tomas@openssl.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(Merged from https://github.com/openssl/openssl/pull/24044)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ssl/ssl_lib.c | 5 +++--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ssl/ssl_sess.c | 28 ++++++++++++++++++++++------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ssl/statem/statem_srvr.c | 5 ++---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 3 files changed, 27 insertions(+), 11 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b5cc4af2f0302..e747b7f90aa71 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./ssl/ssl_lib.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./ssl/ssl_lib.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3737,9 +3737,10 @@ void ssl_update_cache(SSL *s, int mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * If the session_id_length is 0, we are not supposed to cache it, and it
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * would be rather hard to do anyway :-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * would be rather hard to do anyway :-). Also if the session has already
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * been marked as not_resumable we should not cache it for later reuse.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (s->session->session_id_length == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (s->session->session_id_length == 0 || s->session->not_resumable)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index bf84e792251b8..241cf43c46296 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./ssl/ssl_sess.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./ssl/ssl_sess.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -154,16 +154,11 @@ SSL_SESSION *SSL_SESSION_new(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ss;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-SSL_SESSION *SSL_SESSION_dup(const SSL_SESSION *src)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return ssl_session_dup(src, 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Create a new SSL_SESSION and duplicate the contents of |src| into it. If
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ticket == 0 then no ticket information is duplicated, otherwise it is.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static SSL_SESSION *ssl_session_dup_intern(const SSL_SESSION *src, int ticket)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SSL_SESSION *dest;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -287,6 +282,27 @@ SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++SSL_SESSION *SSL_SESSION_dup(const SSL_SESSION *src)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return ssl_session_dup_intern(src, 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Used internally when duplicating a session which might be already shared.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * We will have resumed the original session. Subsequently we might have marked
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * it as non-resumable (e.g. in another thread) - but this copy should be ok to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * resume from.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SSL_SESSION *sess = ssl_session_dup_intern(src, ticket);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (sess != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sess->not_resumable = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return sess;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 5d59d53563ed8..8e493176f658e 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./ssl/statem/statem_srvr.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./ssl/statem/statem_srvr.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2338,9 +2338,8 @@ int tls_construct_server_hello(SSL *s, WPACKET *pkt)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * so the following won't overwrite an ID that we're supposed
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * to send back.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (s->session->not_resumable ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (!(s->ctx->session_cache_mode & SSL_SESS_CACHE_SERVER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- && !s->hit))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!(s->ctx->session_cache_mode & SSL_SESS_CACHE_SERVER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && !s->hit)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ s->session->session_id_length = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (usetls13) {
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/openssl3/files/e9d7083e241670332e0443da0f0d4ffb52829f08.patch b/devel/openssl3/files/e9d7083e241670332e0443da0f0d4ffb52829f08.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..a3827fdc6e9
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/openssl3/files/e9d7083e241670332e0443da0f0d4ffb52829f08.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,116 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From e9d7083e241670332e0443da0f0d4ffb52829f08 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Matt Caswell <matt@openssl.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Tue, 5 Mar 2024 15:43:53 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] Fix unconstrained session cache growth in TLSv1.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+In TLSv1.3 we create a new session object for each ticket that we send.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+We do this by duplicating the original session. If SSL_OP_NO_TICKET is in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+use then the new session will be added to the session cache. However, if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+early data is not in use (and therefore anti-replay protection is being
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+used), then multiple threads could be resuming from the same session
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+simultaneously. If this happens and a problem occurs on one of the threads,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+then the original session object could be marked as not_resumable. When we
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+duplicate the session object this not_resumable status gets copied into the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new session object. The new session object is then added to the session
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+cache even though it is not_resumable.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subsequently, another bug means that the session_id_length is set to 0 for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+sessions that are marked as not_resumable - even though that session is
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+still in the cache. Once this happens the session can never be removed from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+the cache. When that object gets to be the session cache tail object the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+cache never shrinks again and grows indefinitely.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+CVE-2024-2511
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Reviewed-by: Neil Horman <nhorman@openssl.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Reviewed-by: Tomas Mraz <tomas@openssl.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(Merged from https://github.com/openssl/openssl/pull/24043)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ssl/ssl_lib.c | 5 +++--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ssl/ssl_sess.c | 28 ++++++++++++++++++++++------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ssl/statem/statem_srvr.c | 5 ++---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 3 files changed, 27 insertions(+), 11 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 4afb43bc86e54..c51529ddab5bb 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./ssl/ssl_lib.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./ssl/ssl_lib.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4457,9 +4457,10 @@ void ssl_update_cache(SSL_CONNECTION *s, int mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * If the session_id_length is 0, we are not supposed to cache it, and it
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * would be rather hard to do anyway :-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * would be rather hard to do anyway :-). Also if the session has already
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * been marked as not_resumable we should not cache it for later reuse.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (s->session->session_id_length == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (s->session->session_id_length == 0 || s->session->not_resumable)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 3dcc4d81e5bc6..1fa6d17c46863 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./ssl/ssl_sess.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./ssl/ssl_sess.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -127,16 +127,11 @@ SSL_SESSION *SSL_SESSION_new(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ss;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-SSL_SESSION *SSL_SESSION_dup(const SSL_SESSION *src)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return ssl_session_dup(src, 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Create a new SSL_SESSION and duplicate the contents of |src| into it. If
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ticket == 0 then no ticket information is duplicated, otherwise it is.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static SSL_SESSION *ssl_session_dup_intern(const SSL_SESSION *src, int ticket)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SSL_SESSION *dest;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -265,6 +260,27 @@ SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++SSL_SESSION *SSL_SESSION_dup(const SSL_SESSION *src)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return ssl_session_dup_intern(src, 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Used internally when duplicating a session which might be already shared.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * We will have resumed the original session. Subsequently we might have marked
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * it as non-resumable (e.g. in another thread) - but this copy should be ok to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * resume from.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SSL_SESSION *sess = ssl_session_dup_intern(src, ticket);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (sess != NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sess->not_resumable = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return sess;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 853af8c0aa9f9..d5f0ab091dacc 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./ssl/statem/statem_srvr.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./ssl/statem/statem_srvr.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2445,9 +2445,8 @@ CON_FUNC_RETURN tls_construct_server_hello(SSL_CONNECTION *s, WPACKET *pkt)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * so the following won't overwrite an ID that we're supposed
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * to send back.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (s->session->not_resumable ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (!(SSL_CONNECTION_GET_CTX(s)->session_cache_mode & SSL_SESS_CACHE_SERVER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- && !s->hit))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!(SSL_CONNECTION_GET_CTX(s)->session_cache_mode & SSL_SESS_CACHE_SERVER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && !s->hit)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ s->session->session_id_length = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (usetls13) {
</span></pre><pre style='margin:0'>
</pre>