summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssl')
-rw-r--r--meta/recipes-connectivity/openssl/files/environment.d-openssl.sh25
-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
-rw-r--r--meta/recipes-connectivity/openssl/openssl_3.5.0.bb (renamed from meta/recipes-connectivity/openssl/openssl_3.2.1.bb)133
8 files changed, 153 insertions, 289 deletions
diff --git a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
index 6f23490c87..71d378734c 100644
--- a/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
+++ b/meta/recipes-connectivity/openssl/files/environment.d-openssl.sh
@@ -1,5 +1,24 @@
1export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/openssl.cnf" 1export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/openssl.cnf"
2export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/certs"
3export SSL_CERT_FILE="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/certs/ca-certificates.crt"
4export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/" 2export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/"
5export OPENSSL_ENGINES="$OECORE_NATIVE_SYSROOT/usr/lib/engines-3" 3export OPENSSL_ENGINES="$OECORE_NATIVE_SYSROOT/usr/lib/engines-3"
4export BB_ENV_PASSTHROUGH_ADDITIONS="${BB_ENV_PASSTHROUGH_ADDITIONS:-} OPENSSL_CONF OPENSSL_MODULES OPENSSL_ENGINES"
5
6# Respect host env SSL_CERT_FILE/SSL_CERT_DIR first, then auto-detected host cert, then cert in buildtools
7# CAFILE/CAPATH is auto-deteced when source buildtools
8if [ -z "$SSL_CERT_FILE" ]; then
9 if [ -n "$CAFILE" ];then
10 export SSL_CERT_FILE="$CAFILE"
11 elif [ -e "${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/ca-certificates.crt" ];then
12 export SSL_CERT_FILE="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/certs/ca-certificates.crt"
13 fi
14fi
15
16if [ -z "$SSL_CERT_DIR" ]; then
17 if [ -n "$CAPATH" ];then
18 export SSL_CERT_DIR="$CAPATH"
19 elif [ -e "${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/ca-certificates.crt" ];then
20 export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/usr/lib/ssl-3/certs"
21 fi
22fi
23
24export BB_ENV_PASSTHROUGH_ADDITIONS="${BB_ENV_PASSTHROUGH_ADDITIONS:-} SSL_CERT_DIR SSL_CERT_FILE"
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'
diff --git a/meta/recipes-connectivity/openssl/openssl_3.2.1.bb b/meta/recipes-connectivity/openssl/openssl_3.5.0.bb
index d37b68abbb..0f5c28dafa 100644
--- a/meta/recipes-connectivity/openssl/openssl_3.2.1.bb
+++ b/meta/recipes-connectivity/openssl/openssl_3.5.0.bb
@@ -12,15 +12,13 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
12 file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ 12 file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \
13 file://0001-Configure-do-not-tweak-mips-cflags.patch \ 13 file://0001-Configure-do-not-tweak-mips-cflags.patch \
14 file://0001-Added-handshake-history-reporting-when-test-fails.patch \ 14 file://0001-Added-handshake-history-reporting-when-test-fails.patch \
15 file://bti.patch \
16 file://CVE-2024-2511.patch \
17 " 15 "
18 16
19SRC_URI:append:class-nativesdk = " \ 17SRC_URI:append:class-nativesdk = " \
20 file://environment.d-openssl.sh \ 18 file://environment.d-openssl.sh \
21 " 19 "
22 20
23SRC_URI[sha256sum] = "83c7329fe52c850677d75e5d0b0ca245309b97e8ecbcfdc1dfdc4ab9fac35b39" 21SRC_URI[sha256sum] = "344d0a79f1a9b08029b0744e2cc401a43f9c90acd1044d09a530b4885a8e9fc0"
24 22
25inherit lib_package multilib_header multilib_script ptest perlnative manpages 23inherit lib_package multilib_header multilib_script ptest perlnative manpages
26MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" 24MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
@@ -33,10 +31,13 @@ PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,crypt
33PACKAGECONFIG[no-tls1] = "no-tls1" 31PACKAGECONFIG[no-tls1] = "no-tls1"
34PACKAGECONFIG[no-tls1_1] = "no-tls1_1" 32PACKAGECONFIG[no-tls1_1] = "no-tls1_1"
35PACKAGECONFIG[manpages] = "" 33PACKAGECONFIG[manpages] = ""
34PACKAGECONFIG[fips] = "enable-fips"
36 35
37B = "${WORKDIR}/build" 36B = "${WORKDIR}/build"
38do_configure[cleandirs] = "${B}" 37do_configure[cleandirs] = "${B}"
39 38
39EXTRA_OECONF = "${@bb.utils.contains('PTEST_ENABLED', '1', '', 'no-tests', d)}"
40
40#| ./libcrypto.so: undefined reference to `getcontext' 41#| ./libcrypto.so: undefined reference to `getcontext'
41#| ./libcrypto.so: undefined reference to `setcontext' 42#| ./libcrypto.so: undefined reference to `setcontext'
42#| ./libcrypto.so: undefined reference to `makecontext' 43#| ./libcrypto.so: undefined reference to `makecontext'
@@ -45,12 +46,15 @@ EXTRA_OECONF:append:libc-musl:powerpc64 = " no-asm"
45 46
46# adding devrandom prevents openssl from using getrandom() which is not available on older glibc versions 47# adding devrandom prevents openssl from using getrandom() which is not available on older glibc versions
47# (native versions can be built with newer glibc, but then relocated onto a system with older glibc) 48# (native versions can be built with newer glibc, but then relocated onto a system with older glibc)
48EXTRA_OECONF:class-native = "--with-rand-seed=os,devrandom" 49EXTRA_OECONF:append:class-native = " --with-rand-seed=os,devrandom"
49EXTRA_OECONF:class-nativesdk = "--with-rand-seed=os,devrandom" 50EXTRA_OECONF:append:class-nativesdk = " --with-rand-seed=os,devrandom"
50 51
51# Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate. 52# Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate.
52CFLAGS:append:class-native = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" 53EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"'
53CFLAGS:append:class-nativesdk = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" 54EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"'
55
56#| threads_pthread.c:(.text+0x372): undefined reference to `__atomic_is_lock_free'
57EXTRA_OECONF:append:toolchain-clang:x86 = " -latomic"
54 58
55# This allows disabling deprecated or undesirable crypto algorithms. 59# This allows disabling deprecated or undesirable crypto algorithms.
56# The default is to trust upstream choices. 60# The default is to trust upstream choices.
@@ -137,21 +141,26 @@ do_configure () {
137 ;; 141 ;;
138 esac 142 esac
139 143
140 useprefix=${prefix}
141 if [ "x$useprefix" = "x" ]; then
142 useprefix=/
143 fi
144 # WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the 144 # WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the
145 # environment variables set by bitbake. Adjust the environment variables instead. 145 # environment variables set by bitbake. Adjust the environment variables instead.
146 PERLEXTERNAL="$(realpath ${S}/external/perl/Text-Template-*/lib)" 146 PERLEXTERNAL="$(realpath ${S}/external/perl/Text-Template-*/lib)"
147 test -d "$PERLEXTERNAL" || bberror "PERLEXTERNAL '$PERLEXTERNAL' not found!" 147 test -d "$PERLEXTERNAL" || bberror "PERLEXTERNAL '$PERLEXTERNAL' not found!"
148 HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="$PERLEXTERNAL" \ 148 HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="$PERLEXTERNAL" \
149 perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} ${DEPRECATED_CRYPTO_FLAGS} --prefix=$useprefix --openssldir=${libdir}/ssl-3 --libdir=${libdir} $target 149 perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} ${DEPRECATED_CRYPTO_FLAGS} --prefix=${prefix} --openssldir=${libdir}/ssl-3 --libdir=${baselib} $target
150 perl ${B}/configdata.pm --dump 150 perl ${B}/configdata.pm --dump
151} 151}
152 152
153do_compile:append () {
154 # The test suite binaries are large and we don't need the debugging in them
155 if test -d ${B}/test; then
156 find ${B}/test -type f -executable -exec ${STRIP} {} \;
157 fi
158}
159
153do_install () { 160do_install () {
154 oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install_sw install_ssldirs ${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'install_docs', '', d)} 161 oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install_sw install_ssldirs \
162 ${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'install_docs', '', d)} \
163 ${@bb.utils.contains('PACKAGECONFIG', 'fips', 'install_fips', '', d)}
155 164
156 oe_multilib_header openssl/opensslconf.h 165 oe_multilib_header openssl/opensslconf.h
157 oe_multilib_header openssl/configuration.h 166 oe_multilib_header openssl/configuration.h
@@ -169,63 +178,72 @@ do_install () {
169 ln -sf ${@oe.path.relative('${libdir}/ssl-3', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-3/certs 178 ln -sf ${@oe.path.relative('${libdir}/ssl-3', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-3/certs
170 ln -sf ${@oe.path.relative('${libdir}/ssl-3', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-3/private 179 ln -sf ${@oe.path.relative('${libdir}/ssl-3', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-3/private
171 ln -sf ${@oe.path.relative('${libdir}/ssl-3', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-3/openssl.cnf 180 ln -sf ${@oe.path.relative('${libdir}/ssl-3', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-3/openssl.cnf
181
182 # Generate fipsmodule.cnf in pkg_postinst_ontarget
183 if ${@bb.utils.contains('PACKAGECONFIG', 'fips', 'true', 'false', d)}; then
184 rm -f ${D}${libdir}/ssl-3/fipsmodule.cnf
185 fi
172} 186}
173 187
174do_install:append:class-native () { 188do_install:append:class-native () {
175 create_wrapper ${D}${bindir}/openssl \ 189 create_wrapper ${D}${bindir}/openssl \
176 OPENSSL_CONF=${libdir}/ssl-3/openssl.cnf \ 190 OPENSSL_CONF=\${OPENSSL_CONF:-${libdir}/ssl-3/openssl.cnf} \
177 SSL_CERT_DIR=${libdir}/ssl-3/certs \ 191 SSL_CERT_DIR=\${SSL_CERT_DIR:-${libdir}/ssl-3/certs} \
178 SSL_CERT_FILE=${libdir}/ssl-3/cert.pem \ 192 SSL_CERT_FILE=\${SSL_CERT_FILE:-${libdir}/ssl-3/cert.pem} \
179 OPENSSL_ENGINES=${libdir}/engines-3 \ 193 OPENSSL_ENGINES=\${OPENSSL_ENGINES:-${libdir}/engines-3} \
180 OPENSSL_MODULES=${libdir}/ossl-modules 194 OPENSSL_MODULES=\${OPENSSL_MODULES:-${libdir}/ossl-modules}
181} 195}
182 196
183do_install:append:class-nativesdk () { 197do_install:append:class-nativesdk () {
184 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d 198 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
185 install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh 199 install -m 644 ${UNPACKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
186 sed 's|/usr/lib/ssl/|/usr/lib/ssl-3/|g' -i ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
187} 200}
188 201
189PTEST_BUILD_HOST_FILES += "configdata.pm" 202PTEST_BUILD_HOST_FILES += "configdata.pm"
190PTEST_BUILD_HOST_PATTERN = "perl_version =" 203PTEST_BUILD_HOST_PATTERN = "perl_version ="
191do_install_ptest () { 204do_install_ptest() {
192 install -d ${D}${PTEST_PATH}/test 205 install -m644 ${S}/Configure ${B}/configdata.pm ${D}${PTEST_PATH}
193 install -m755 ${B}/test/p_test.so ${D}${PTEST_PATH}/test 206 cp -rf ${S}/Configurations ${S}/external ${D}${PTEST_PATH}/
194 install -m755 ${B}/test/p_minimal.so ${D}${PTEST_PATH}/test
195 install -m755 ${B}/test/provider_internal_test.cnf ${D}${PTEST_PATH}/test
196
197 # Prune the build tree
198 rm -f ${B}/fuzz/*.* ${B}/test/*.*
199
200 cp ${S}/Configure ${B}/configdata.pm ${D}${PTEST_PATH}
201 sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm
202 cp -r ${S}/external ${B}/test ${S}/test ${B}/fuzz ${S}/util ${B}/util ${D}${PTEST_PATH}
203
204 # For test_shlibload
205 ln -s ${libdir}/libcrypto.so.1.1 ${D}${PTEST_PATH}/
206 ln -s ${libdir}/libssl.so.1.1 ${D}${PTEST_PATH}/
207 207
208 install -d ${D}${PTEST_PATH}/apps 208 install -d ${D}${PTEST_PATH}/apps
209 ln -s ${bindir}/openssl ${D}${PTEST_PATH}/apps 209 ln -s ${bindir}/openssl ${D}${PTEST_PATH}/apps
210 install -m644 ${S}/apps/*.pem ${S}/apps/*.srl ${S}/apps/openssl.cnf ${D}${PTEST_PATH}/apps
211 install -m755 ${B}/apps/CA.pl ${D}${PTEST_PATH}/apps
212
213 install -d ${D}${PTEST_PATH}/engines
214 install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines
215 install -m755 ${B}/engines/loader_attic.so ${D}${PTEST_PATH}/engines
216 install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines
217 210
218 install -d ${D}${PTEST_PATH}/providers 211 cd ${S}
219 install -m755 ${B}/providers/legacy.so ${D}${PTEST_PATH}/providers 212 find test/certs test/ct test/d2i-tests test/recipes test/ocsp-tests test/ssl-tests test/smime-certs -type f -exec install -m644 -D {} ${D}${PTEST_PATH}/{} \;
213 find apps test -name \*.cnf -exec install -m644 -D {} ${D}${PTEST_PATH}/{} \;
214 find apps test -name \*.der -exec install -m644 -D {} ${D}${PTEST_PATH}/{} \;
215 find apps test -name \*.pem -exec install -m644 -D {} ${D}${PTEST_PATH}/{} \;
216 find util -name \*.p[lm] -exec install -m644 -D {} ${D}${PTEST_PATH}/{} \;
217
218 cd ${B}
219 # Everything but .? (.o and .d)
220 find test -type f -name \*[^.]? -exec install -m755 -D {} ${D}${PTEST_PATH}/{} \;
221 find apps test -name \*.cnf -exec install -m644 -D {} ${D}${PTEST_PATH}/{} \;
222 find apps test -name \*.pem -exec install -m644 -D {} ${D}${PTEST_PATH}/{} \;
223 find apps test -name \*.srl -exec install -m644 -D {} ${D}${PTEST_PATH}/{} \;
224 install -m755 ${B}/util/*wrap.* ${D}${PTEST_PATH}/util/
225
226 install -m755 ${B}/apps/CA.pl ${D}${PTEST_PATH}/apps/
227 install -m755 ${S}/test/*.pl ${D}${PTEST_PATH}/test/
228 install -m755 ${S}/test/shibboleth.pfx ${D}${PTEST_PATH}/test/
229 install -m755 ${S}/test/*.bin ${D}${PTEST_PATH}/test/
230 install -m755 ${S}/test/dane*.in ${D}${PTEST_PATH}/test/
231 install -m755 ${S}/test/smcont*.txt ${D}${PTEST_PATH}/test/
232 install -m755 ${S}/test/ssl_test.tmpl ${D}${PTEST_PATH}/test/
233
234 sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm ${D}${PTEST_PATH}/util/wrap.pl
220 235
221 install -d ${D}${PTEST_PATH}/Configurations 236 install -d ${D}${PTEST_PATH}/engines
222 cp -rf ${S}/Configurations/* ${D}${PTEST_PATH}/Configurations/ 237 install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines/
223 238 install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines/
224 # seems to be needed with perl 5.32.1 239 ln -s ${libdir}/engines-3/loader_attic.so ${D}${PTEST_PATH}/engines/
225 install -d ${D}${PTEST_PATH}/util/perl/recipes 240 ln -s ${libdir}/ossl-modules/ ${D}${PTEST_PATH}/providers
226 cp ${D}${PTEST_PATH}/test/recipes/tconversion.pl ${D}${PTEST_PATH}/util/perl/recipes/ 241}
227 242
228 sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/util/wrap.pl 243pkg_postinst_ontarget:${PN}-ossl-module-fips () {
244 if test -f ${libdir}/ossl-modules/fips.so; then
245 ${bindir}/openssl fipsinstall -out ${libdir}/ssl-3/fipsmodule.cnf -module ${libdir}/ossl-modules/fips.so
246 fi
229} 247}
230 248
231# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto 249# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
@@ -233,7 +251,7 @@ do_install_ptest () {
233# file to be installed for both the openssl-bin package and the libcrypto 251# file to be installed for both the openssl-bin package and the libcrypto
234# package since the openssl-bin package depends on the libcrypto package. 252# package since the openssl-bin package depends on the libcrypto package.
235 253
236PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc ${PN}-ossl-module-legacy" 254PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips"
237 255
238FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}" 256FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}"
239FILES:libssl = "${libdir}/libssl${SOLIBS}" 257FILES:libssl = "${libdir}/libssl${SOLIBS}"
@@ -245,6 +263,7 @@ FILES:${PN}-engines = "${libdir}/engines-3"
245FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3" 263FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3"
246FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash" 264FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash"
247FILES:${PN}-ossl-module-legacy = "${libdir}/ossl-modules/legacy.so" 265FILES:${PN}-ossl-module-legacy = "${libdir}/ossl-modules/legacy.so"
266FILES:${PN}-ossl-module-fips = "${libdir}/ossl-modules/fips.so"
248FILES:${PN} =+ "${libdir}/ssl-3/* ${libdir}/ossl-modules/" 267FILES:${PN} =+ "${libdir}/ssl-3/* ${libdir}/ossl-modules/"
249FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh" 268FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
250 269
@@ -252,13 +271,13 @@ CONFFILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
252 271
253RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy" 272RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy"
254RDEPENDS:${PN}-misc = "perl" 273RDEPENDS:${PN}-misc = "perl"
255RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed" 274RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed openssl-engines openssl-ossl-module-legacy"
256 275
257RDEPENDS:${PN}-bin += "openssl-conf" 276RDEPENDS:${PN}-bin += "openssl-conf"
258 277
278# The test suite is installed stripped
279INSANE_SKIP:${PN} = "already-stripped"
280
259BBCLASSEXTEND = "native nativesdk" 281BBCLASSEXTEND = "native nativesdk"
260 282
261CVE_PRODUCT = "openssl:openssl" 283CVE_PRODUCT = "openssl:openssl"
262
263CVE_VERSION_SUFFIX = "alphabetical"
264