summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssl/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl')
-rw-r--r--meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch55
-rw-r--r--meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch4
-rw-r--r--meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch28
-rw-r--r--meta/recipes-connectivity/openssl/openssl/CVE-2024-2511.patch120
-rw-r--r--meta/recipes-connectivity/openssl/openssl/bti.patch58
-rw-r--r--meta/recipes-connectivity/openssl/openssl/run-ptest19
6 files changed, 55 insertions, 229 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch b/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch
index aa2e5bb800..5b7365a353 100644
--- a/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch
+++ b/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch
@@ -7,26 +7,19 @@ Upstream-Status: Submitted [https://github.com/openssl/openssl/pull/22481]
7 7
8Signed-off-by: William Lyu <William.Lyu@windriver.com> 8Signed-off-by: William Lyu <William.Lyu@windriver.com>
9--- 9---
10 test/helpers/handshake.c | 139 +++++++++++++++++++++++++++++---------- 10 test/helpers/handshake.c | 137 +++++++++++++++++++++++++++++----------
11 test/helpers/handshake.h | 70 +++++++++++++++++++- 11 test/helpers/handshake.h | 70 +++++++++++++++++++-
12 test/ssl_test.c | 44 +++++++++++++ 12 test/ssl_test.c | 44 +++++++++++++
13 3 files changed, 218 insertions(+), 35 deletions(-) 13 3 files changed, 217 insertions(+), 34 deletions(-)
14 14
15diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c 15diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c
16index e0422469e4..ae2ad59dd4 100644 16index f611b3a..5703b48 100644
17--- a/test/helpers/handshake.c 17--- a/test/helpers/handshake.c
18+++ b/test/helpers/handshake.c 18+++ b/test/helpers/handshake.c
19@@ -1,5 +1,5 @@ 19@@ -25,6 +25,102 @@
20 /*
21- * Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved.
22+ * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved.
23 *
24 * Licensed under the Apache License 2.0 (the "License"). You may not use
25 * this file except in compliance with the License. You can obtain a copy
26@@ -24,6 +24,102 @@
27 #include <netinet/sctp.h> 20 #include <netinet/sctp.h>
28 #endif 21 #endif
29 22
30+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ 23+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */
31+/* Maps string names to various enumeration type */ 24+/* Maps string names to various enumeration type */
32+typedef struct { 25+typedef struct {
@@ -126,10 +119,10 @@ index e0422469e4..ae2ad59dd4 100644
126 HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void) 119 HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void)
127 { 120 {
128 HANDSHAKE_RESULT *ret; 121 HANDSHAKE_RESULT *ret;
129@@ -719,15 +815,6 @@ static void configure_handshake_ssl(SSL *server, SSL *client, 122@@ -726,15 +822,6 @@ static void configure_handshake_ssl(SSL *server, SSL *client,
130 SSL_set_post_handshake_auth(client, 1); 123 SSL_set_post_handshake_auth(client, 1);
131 } 124 }
132 125
133-/* The status for each connection phase. */ 126-/* The status for each connection phase. */
134-typedef enum { 127-typedef enum {
135- PEER_SUCCESS, 128- PEER_SUCCESS,
@@ -142,10 +135,10 @@ index e0422469e4..ae2ad59dd4 100644
142 /* An SSL object and associated read-write buffers. */ 135 /* An SSL object and associated read-write buffers. */
143 typedef struct peer_st { 136 typedef struct peer_st {
144 SSL *ssl; 137 SSL *ssl;
145@@ -1074,17 +1161,6 @@ static void do_shutdown_step(PEER *peer) 138@@ -1081,17 +1168,6 @@ static void do_shutdown_step(PEER *peer)
146 } 139 }
147 } 140 }
148 141
149-typedef enum { 142-typedef enum {
150- HANDSHAKE, 143- HANDSHAKE,
151- RENEG_APPLICATION_DATA, 144- RENEG_APPLICATION_DATA,
@@ -160,10 +153,10 @@ index e0422469e4..ae2ad59dd4 100644
160 static int renegotiate_op(const SSL_TEST_CTX *test_ctx) 153 static int renegotiate_op(const SSL_TEST_CTX *test_ctx)
161 { 154 {
162 switch (test_ctx->handshake_mode) { 155 switch (test_ctx->handshake_mode) {
163@@ -1162,19 +1238,6 @@ static void do_connect_step(const SSL_TEST_CTX *test_ctx, PEER *peer, 156@@ -1169,19 +1245,6 @@ static void do_connect_step(const SSL_TEST_CTX *test_ctx, PEER *peer,
164 } 157 }
165 } 158 }
166 159
167-typedef enum { 160-typedef enum {
168- /* Both parties succeeded. */ 161- /* Both parties succeeded. */
169- HANDSHAKE_SUCCESS, 162- HANDSHAKE_SUCCESS,
@@ -180,10 +173,10 @@ index e0422469e4..ae2ad59dd4 100644
180 /* 173 /*
181 * Determine the handshake outcome. 174 * Determine the handshake outcome.
182 * last_status: the status of the peer to have acted last. 175 * last_status: the status of the peer to have acted last.
183@@ -1539,6 +1602,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( 176@@ -1546,6 +1609,10 @@ static HANDSHAKE_RESULT *do_handshake_internal(
184 177
185 start = time(NULL); 178 start = time(NULL);
186 179
187+ save_loop_history(&(ret->history), 180+ save_loop_history(&(ret->history),
188+ phase, status, server.status, client.status, 181+ phase, status, server.status, client.status,
189+ client_turn_count, client_turn); 182+ client_turn_count, client_turn);
@@ -191,10 +184,10 @@ index e0422469e4..ae2ad59dd4 100644
191 /* 184 /*
192 * Half-duplex handshake loop. 185 * Half-duplex handshake loop.
193 * Client and server speak to each other synchronously in the same process. 186 * Client and server speak to each other synchronously in the same process.
194@@ -1560,6 +1627,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( 187@@ -1567,6 +1634,10 @@ static HANDSHAKE_RESULT *do_handshake_internal(
195 0 /* server went last */); 188 0 /* server went last */);
196 } 189 }
197 190
198+ save_loop_history(&(ret->history), 191+ save_loop_history(&(ret->history),
199+ phase, status, server.status, client.status, 192+ phase, status, server.status, client.status,
200+ client_turn_count, client_turn); 193+ client_turn_count, client_turn);
@@ -203,7 +196,7 @@ index e0422469e4..ae2ad59dd4 100644
203 case HANDSHAKE_SUCCESS: 196 case HANDSHAKE_SUCCESS:
204 client_turn_count = 0; 197 client_turn_count = 0;
205diff --git a/test/helpers/handshake.h b/test/helpers/handshake.h 198diff --git a/test/helpers/handshake.h b/test/helpers/handshake.h
206index 78b03f9f4b..b9967c2623 100644 199index 78b03f9..b9967c2 100644
207--- a/test/helpers/handshake.h 200--- a/test/helpers/handshake.h
208+++ b/test/helpers/handshake.h 201+++ b/test/helpers/handshake.h
209@@ -1,5 +1,5 @@ 202@@ -1,5 +1,5 @@
@@ -214,9 +207,9 @@ index 78b03f9f4b..b9967c2623 100644
214 * Licensed under the Apache License 2.0 (the "License"). You may not use 207 * Licensed under the Apache License 2.0 (the "License"). You may not use
215 * this file except in compliance with the License. You can obtain a copy 208 * this file except in compliance with the License. You can obtain a copy
216@@ -12,6 +12,11 @@ 209@@ -12,6 +12,11 @@
217 210
218 #include "ssl_test_ctx.h" 211 #include "ssl_test_ctx.h"
219 212
220+#define MAX_HANDSHAKE_HISTORY_ENTRY_BIT 4 213+#define MAX_HANDSHAKE_HISTORY_ENTRY_BIT 4
221+#define MAX_HANDSHAKE_HISTORY_ENTRY (1 << MAX_HANDSHAKE_HISTORY_ENTRY_BIT) 214+#define MAX_HANDSHAKE_HISTORY_ENTRY (1 << MAX_HANDSHAKE_HISTORY_ENTRY_BIT)
222+#define MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK \ 215+#define MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK \
@@ -228,7 +221,7 @@ index 78b03f9f4b..b9967c2623 100644
228@@ -22,6 +27,63 @@ typedef struct ctx_data_st { 221@@ -22,6 +27,63 @@ typedef struct ctx_data_st {
229 char *session_ticket_app_data; 222 char *session_ticket_app_data;
230 } CTX_DATA; 223 } CTX_DATA;
231 224
232+typedef enum { 225+typedef enum {
233+ HANDSHAKE, 226+ HANDSHAKE,
234+ RENEG_APPLICATION_DATA, 227+ RENEG_APPLICATION_DATA,
@@ -296,25 +289,25 @@ index 78b03f9f4b..b9967c2623 100644
296+ /* handshake loop history */ 289+ /* handshake loop history */
297+ HANDSHAKE_HISTORY history; 290+ HANDSHAKE_HISTORY history;
298 } HANDSHAKE_RESULT; 291 } HANDSHAKE_RESULT;
299 292
300 HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void); 293 HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void);
301@@ -95,4 +159,8 @@ int configure_handshake_ctx_for_srp(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, 294@@ -95,4 +159,8 @@ int configure_handshake_ctx_for_srp(SSL_CTX *server_ctx, SSL_CTX *server2_ctx,
302 CTX_DATA *server2_ctx_data, 295 CTX_DATA *server2_ctx_data,
303 CTX_DATA *client_ctx_data); 296 CTX_DATA *client_ctx_data);
304 297
305+const char *handshake_connect_phase_name(connect_phase_t phase); 298+const char *handshake_connect_phase_name(connect_phase_t phase);
306+const char *handshake_status_name(handshake_status_t handshake_status); 299+const char *handshake_status_name(handshake_status_t handshake_status);
307+const char *handshake_peer_status_name(peer_status_t peer_status); 300+const char *handshake_peer_status_name(peer_status_t peer_status);
308+ 301+
309 #endif /* OSSL_TEST_HANDSHAKE_HELPER_H */ 302 #endif /* OSSL_TEST_HANDSHAKE_HELPER_H */
310diff --git a/test/ssl_test.c b/test/ssl_test.c 303diff --git a/test/ssl_test.c b/test/ssl_test.c
311index ea608518f9..9d6b093c81 100644 304index ea60851..9d6b093 100644
312--- a/test/ssl_test.c 305--- a/test/ssl_test.c
313+++ b/test/ssl_test.c 306+++ b/test/ssl_test.c
314@@ -26,6 +26,44 @@ static OSSL_LIB_CTX *libctx = NULL; 307@@ -26,6 +26,44 @@ static OSSL_LIB_CTX *libctx = NULL;
315 /* Currently the section names are of the form test-<number>, e.g. test-15. */ 308 /* Currently the section names are of the form test-<number>, e.g. test-15. */
316 #define MAX_TESTCASE_NAME_LENGTH 100 309 #define MAX_TESTCASE_NAME_LENGTH 100
317 310
318+static void print_handshake_history(const HANDSHAKE_HISTORY *history) 311+static void print_handshake_history(const HANDSHAKE_HISTORY *history)
319+{ 312+{
320+ size_t first_idx; 313+ size_t first_idx;
diff --git a/meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch b/meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch
index 502a7aaf32..7043188973 100644
--- a/meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch
+++ b/meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch
@@ -17,10 +17,10 @@ Signed-off-by: Tim Orling <tim.orling@konsulko.com>
17 1 file changed, 10 deletions(-) 17 1 file changed, 10 deletions(-)
18 18
19diff --git a/Configure b/Configure 19diff --git a/Configure b/Configure
20index 4569952..adf019b 100755 20index fff97bd..5ee54c1 100755
21--- a/Configure 21--- a/Configure
22+++ b/Configure 22+++ b/Configure
23@@ -1422,16 +1422,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) 23@@ -1551,16 +1551,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m)
24 push @{$config{shared_ldflag}}, "-mno-cygwin"; 24 push @{$config{shared_ldflag}}, "-mno-cygwin";
25 } 25 }
26 26
diff --git a/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch b/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch
index bafdbaa46f..687d682976 100644
--- a/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch
+++ b/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch
@@ -30,23 +30,26 @@ Update to fix buildpaths qa issue for '-ffile-prefix-map'.
30Signed-off-by: Khem Raj <raj.khem@gmail.com> 30Signed-off-by: Khem Raj <raj.khem@gmail.com>
31 31
32--- 32---
33 Configurations/unix-Makefile.tmpl | 12 +++++++++++- 33 Configurations/unix-Makefile.tmpl | 16 +++++++++++++++-
34 crypto/build.info | 2 +- 34 crypto/build.info | 2 +-
35 2 files changed, 12 insertions(+), 2 deletions(-) 35 2 files changed, 16 insertions(+), 2 deletions(-)
36 36
37Index: openssl-3.0.4/Configurations/unix-Makefile.tmpl 37diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
38=================================================================== 38index 09303c4..011bda1 100644
39--- openssl-3.0.4.orig/Configurations/unix-Makefile.tmpl 39--- a/Configurations/unix-Makefile.tmpl
40+++ openssl-3.0.4/Configurations/unix-Makefile.tmpl 40+++ b/Configurations/unix-Makefile.tmpl
41@@ -472,13 +472,23 @@ BIN_LDFLAGS={- join(' ', $target{bin_lfl 41@@ -502,13 +502,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
42 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} 42 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
43 BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS) 43 BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
44 44
45-# CPPFLAGS_Q is used for one thing only: to build up buildinf.h 45-# CPPFLAGS_Q is used for one thing only: to build up buildinf.h
46+# *_Q variables are used for one thing only: to build up buildinf.h 46+# *_Q variables are used for one thing only: to build up buildinf.h
47 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g; 47 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
48+ $cppflags1 =~ s|-isystem/[^ ]+/usr/include||g;
48 $cppflags2 =~ s|([\\"])|\\$1|g; 49 $cppflags2 =~ s|([\\"])|\\$1|g;
50+ $cppflags2 =~ s|-isystem/[^ ]+/usr/include||g;
49 $lib_cppflags =~ s|([\\"])|\\$1|g; 51 $lib_cppflags =~ s|([\\"])|\\$1|g;
52+ $lib_cppflags =~ s|-isystem/[^ ]+/usr/include||g;
50 join(' ', $lib_cppflags || (), $cppflags2 || (), 53 join(' ', $lib_cppflags || (), $cppflags2 || (),
51 $cppflags1 || ()) -} 54 $cppflags1 || ()) -}
52 55
@@ -54,6 +57,7 @@ Index: openssl-3.0.4/Configurations/unix-Makefile.tmpl
54+ s|-fdebug-prefix-map=[^ ]+|-fdebug-prefix-map=|g; 57+ s|-fdebug-prefix-map=[^ ]+|-fdebug-prefix-map=|g;
55+ s|-fmacro-prefix-map=[^ ]+|-fmacro-prefix-map=|g; 58+ s|-fmacro-prefix-map=[^ ]+|-fmacro-prefix-map=|g;
56+ s|-ffile-prefix-map=[^ ]+|-ffile-prefix-map=|g; 59+ s|-ffile-prefix-map=[^ ]+|-ffile-prefix-map=|g;
60+ s|-isystem/[^ ]+/usr/include ||g;
57+ } 61+ }
58+ join(' ', @{$config{CFLAGS}}) -} 62+ join(' ', @{$config{CFLAGS}}) -}
59+ 63+
@@ -63,11 +67,11 @@ Index: openssl-3.0.4/Configurations/unix-Makefile.tmpl
63 PERLASM_SCHEME= {- $target{perlasm_scheme} -} 67 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
64 68
65 # For x86 assembler: Set PROCESSOR to 386 if you want to support 69 # For x86 assembler: Set PROCESSOR to 386 if you want to support
66Index: openssl-3.0.4/crypto/build.info 70diff --git a/crypto/build.info b/crypto/build.info
67=================================================================== 71index aee5c46..95c9577 100644
68--- openssl-3.0.4.orig/crypto/build.info 72--- a/crypto/build.info
69+++ openssl-3.0.4/crypto/build.info 73+++ b/crypto/build.info
70@@ -109,7 +109,7 @@ DEFINE[../libcrypto]=$UPLINKDEF 74@@ -115,7 +115,7 @@ DEFINE[../libcrypto]=$UPLINKDEF
71 75
72 DEPEND[info.o]=buildinf.h 76 DEPEND[info.o]=buildinf.h
73 DEPEND[cversion.o]=buildinf.h 77 DEPEND[cversion.o]=buildinf.h
diff --git a/meta/recipes-connectivity/openssl/openssl/CVE-2024-2511.patch b/meta/recipes-connectivity/openssl/openssl/CVE-2024-2511.patch
deleted file mode 100644
index 8772f716d5..0000000000
--- a/meta/recipes-connectivity/openssl/openssl/CVE-2024-2511.patch
+++ /dev/null
@@ -1,120 +0,0 @@
1From e9d7083e241670332e0443da0f0d4ffb52829f08 Mon Sep 17 00:00:00 2001
2From: Matt Caswell <matt@openssl.org>
3Date: Tue, 5 Mar 2024 15:43:53 +0000
4Subject: [PATCH] Fix unconstrained session cache growth in TLSv1.3
5
6In TLSv1.3 we create a new session object for each ticket that we send.
7We do this by duplicating the original session. If SSL_OP_NO_TICKET is in
8use then the new session will be added to the session cache. However, if
9early data is not in use (and therefore anti-replay protection is being
10used), then multiple threads could be resuming from the same session
11simultaneously. If this happens and a problem occurs on one of the threads,
12then the original session object could be marked as not_resumable. When we
13duplicate the session object this not_resumable status gets copied into the
14new session object. The new session object is then added to the session
15cache even though it is not_resumable.
16
17Subsequently, another bug means that the session_id_length is set to 0 for
18sessions that are marked as not_resumable - even though that session is
19still in the cache. Once this happens the session can never be removed from
20the cache. When that object gets to be the session cache tail object the
21cache never shrinks again and grows indefinitely.
22
23CVE-2024-2511
24
25Reviewed-by: Neil Horman <nhorman@openssl.org>
26Reviewed-by: Tomas Mraz <tomas@openssl.org>
27(Merged from https://github.com/openssl/openssl/pull/24043)
28
29CVE: CVE-2024-2511
30Upstream-Status: Backport [https://github.com/openssl/openssl/commit/e9d7083e241670332e0443da0f0d4ffb52829f08]
31Signed-off-by: Peter Marko <peter.marko@siemens.com>
32---
33 ssl/ssl_lib.c | 5 +++--
34 ssl/ssl_sess.c | 28 ++++++++++++++++++++++------
35 ssl/statem/statem_srvr.c | 5 ++---
36 3 files changed, 27 insertions(+), 11 deletions(-)
37
38diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
39index 4afb43bc86e54..c51529ddab5bb 100644
40--- a/ssl/ssl_lib.c
41+++ b/ssl/ssl_lib.c
42@@ -4457,9 +4457,10 @@ void ssl_update_cache(SSL_CONNECTION *s, int mode)
43
44 /*
45 * If the session_id_length is 0, we are not supposed to cache it, and it
46- * would be rather hard to do anyway :-)
47+ * would be rather hard to do anyway :-). Also if the session has already
48+ * been marked as not_resumable we should not cache it for later reuse.
49 */
50- if (s->session->session_id_length == 0)
51+ if (s->session->session_id_length == 0 || s->session->not_resumable)
52 return;
53
54 /*
55diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
56index 3dcc4d81e5bc6..1fa6d17c46863 100644
57--- a/ssl/ssl_sess.c
58+++ b/ssl/ssl_sess.c
59@@ -127,16 +127,11 @@ SSL_SESSION *SSL_SESSION_new(void)
60 return ss;
61 }
62
63-SSL_SESSION *SSL_SESSION_dup(const SSL_SESSION *src)
64-{
65- return ssl_session_dup(src, 1);
66-}
67-
68 /*
69 * Create a new SSL_SESSION and duplicate the contents of |src| into it. If
70 * ticket == 0 then no ticket information is duplicated, otherwise it is.
71 */
72-SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
73+static SSL_SESSION *ssl_session_dup_intern(const SSL_SESSION *src, int ticket)
74 {
75 SSL_SESSION *dest;
76
77@@ -265,6 +260,27 @@ SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
78 return NULL;
79 }
80
81+SSL_SESSION *SSL_SESSION_dup(const SSL_SESSION *src)
82+{
83+ return ssl_session_dup_intern(src, 1);
84+}
85+
86+/*
87+ * Used internally when duplicating a session which might be already shared.
88+ * We will have resumed the original session. Subsequently we might have marked
89+ * it as non-resumable (e.g. in another thread) - but this copy should be ok to
90+ * resume from.
91+ */
92+SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket)
93+{
94+ SSL_SESSION *sess = ssl_session_dup_intern(src, ticket);
95+
96+ if (sess != NULL)
97+ sess->not_resumable = 0;
98+
99+ return sess;
100+}
101+
102 const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len)
103 {
104 if (len)
105diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
106index 853af8c0aa9f9..d5f0ab091dacc 100644
107--- a/ssl/statem/statem_srvr.c
108+++ b/ssl/statem/statem_srvr.c
109@@ -2445,9 +2445,8 @@ CON_FUNC_RETURN tls_construct_server_hello(SSL_CONNECTION *s, WPACKET *pkt)
110 * so the following won't overwrite an ID that we're supposed
111 * to send back.
112 */
113- if (s->session->not_resumable ||
114- (!(SSL_CONNECTION_GET_CTX(s)->session_cache_mode & SSL_SESS_CACHE_SERVER)
115- && !s->hit))
116+ if (!(SSL_CONNECTION_GET_CTX(s)->session_cache_mode & SSL_SESS_CACHE_SERVER)
117+ && !s->hit)
118 s->session->session_id_length = 0;
119
120 if (usetls13) {
diff --git a/meta/recipes-connectivity/openssl/openssl/bti.patch b/meta/recipes-connectivity/openssl/openssl/bti.patch
deleted file mode 100644
index 748576c30c..0000000000
--- a/meta/recipes-connectivity/openssl/openssl/bti.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From ba8a599395f8b770c76316b5f5b0f3838567014f Mon Sep 17 00:00:00 2001
2From: Tom Cosgrove <tom.cosgrove@arm.com>
3Date: Tue, 26 Mar 2024 13:18:00 +0000
4Subject: [PATCH] aarch64: fix BTI in bsaes assembly code
5
6In Arm systems where BTI is enabled but the Crypto extensions are not (more
7likely in FVPs than in real hardware), the bit-sliced assembler code will
8be used. However, this wasn't annotated with BTI instructions when BTI was
9enabled, so the moment libssl jumps into this code it (correctly) aborts.
10
11Solve this by adding the missing BTI landing pads.
12
13Upstream-Status: Submitted [https://github.com/openssl/openssl/pull/23982]
14Signed-off-by: Ross Burton <ross.burton@arm.com>
15---
16 crypto/aes/asm/bsaes-armv8.pl | 5 ++++-
17 1 file changed, 4 insertions(+), 1 deletion(-)
18
19diff --git a/crypto/aes/asm/bsaes-armv8.pl b/crypto/aes/asm/bsaes-armv8.pl
20index b3c97e439f..c3c5ff3e05 100644
21--- a/crypto/aes/asm/bsaes-armv8.pl
22+++ b/crypto/aes/asm/bsaes-armv8.pl
23@@ -1018,6 +1018,7 @@ _bsaes_key_convert:
24 // Initialisation vector overwritten with last quadword of ciphertext
25 // No output registers, usual AAPCS64 register preservation
26 ossl_bsaes_cbc_encrypt:
27+ AARCH64_VALID_CALL_TARGET
28 cmp x2, #128
29 bhs .Lcbc_do_bsaes
30 b AES_cbc_encrypt
31@@ -1270,7 +1271,7 @@ ossl_bsaes_cbc_encrypt:
32 // Output text filled in
33 // No output registers, usual AAPCS64 register preservation
34 ossl_bsaes_ctr32_encrypt_blocks:
35-
36+ AARCH64_VALID_CALL_TARGET
37 cmp x2, #8 // use plain AES for
38 blo .Lctr_enc_short // small sizes
39
40@@ -1476,6 +1477,7 @@ ossl_bsaes_ctr32_encrypt_blocks:
41 // Output ciphertext filled in
42 // No output registers, usual AAPCS64 register preservation
43 ossl_bsaes_xts_encrypt:
44+ AARCH64_VALID_CALL_TARGET
45 // Stack layout:
46 // sp ->
47 // nrounds*128-96 bytes: key schedule
48@@ -1921,6 +1923,7 @@ ossl_bsaes_xts_encrypt:
49 // Output plaintext filled in
50 // No output registers, usual AAPCS64 register preservation
51 ossl_bsaes_xts_decrypt:
52+ AARCH64_VALID_CALL_TARGET
53 // Stack layout:
54 // sp ->
55 // nrounds*128-96 bytes: key schedule
56--
572.34.1
58
diff --git a/meta/recipes-connectivity/openssl/openssl/run-ptest b/meta/recipes-connectivity/openssl/openssl/run-ptest
index c89ec5afa1..cd29bb1446 100644
--- a/meta/recipes-connectivity/openssl/openssl/run-ptest
+++ b/meta/recipes-connectivity/openssl/openssl/run-ptest
@@ -1,12 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2 2
3set -e 3set -eu
4 4
5# Optional arguments are 'list' to lists all tests, or the test name (base name 5# Optional arguments are 'list' to lists the tests, or the test name (base name
6# ie test_evp, not 03_test_evp.t). 6# ie test_evp, not 03_test_evp.t). Without any arguments we run all tests.
7
8if test $# -gt 0; then
9 TESTS=$*
10else
11 # Skip test_symbol_presence as this is for developers
12 TESTS="alltests -test_symbol_presence"
13fi
7 14
8export TOP=. 15export TOP=.
9# OPENSSL_ENGINES is relative from the test binaries 16# Run four jobs in parallel
10export OPENSSL_ENGINES=../engines 17export HARNESS_JOBS=4
11 18
12{ HARNESS_JOBS=4 perl ./test/run_tests.pl $* || echo "FAIL: openssl" ; } | sed -u -r -e '/(.*) \.*.ok/ s/^/PASS: /g' -r -e '/Dubious(.*)/ s/^/FAIL: /g' -e '/(.*) \.*.skipped: (.*)/ s/^/SKIP: /g' 19{ perl ./test/run_tests.pl $TESTS || echo "FAIL: openssl" ; } | sed -u -r -e '/(.*) \.*.ok/ s/^/PASS: /g' -r -e '/Dubious(.*)/ s/^/FAIL: /g' -e '/(.*) \.*.skipped: (.*)/ s/^/SKIP: /g'