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/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)131
6 files changed, 153 insertions, 109 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/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 1682b6f8cc..0f5c28dafa 100644
--- a/meta/recipes-connectivity/openssl/openssl_3.2.1.bb
+++ b/meta/recipes-connectivity/openssl/openssl_3.5.0.bb
@@ -18,7 +18,7 @@ SRC_URI:append:class-nativesdk = " \
18 file://environment.d-openssl.sh \ 18 file://environment.d-openssl.sh \
19 " 19 "
20 20
21SRC_URI[sha256sum] = "83c7329fe52c850677d75e5d0b0ca245309b97e8ecbcfdc1dfdc4ab9fac35b39" 21SRC_URI[sha256sum] = "344d0a79f1a9b08029b0744e2cc401a43f9c90acd1044d09a530b4885a8e9fc0"
22 22
23inherit lib_package multilib_header multilib_script ptest perlnative manpages 23inherit lib_package multilib_header multilib_script ptest perlnative manpages
24MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" 24MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
@@ -31,10 +31,13 @@ PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,crypt
31PACKAGECONFIG[no-tls1] = "no-tls1" 31PACKAGECONFIG[no-tls1] = "no-tls1"
32PACKAGECONFIG[no-tls1_1] = "no-tls1_1" 32PACKAGECONFIG[no-tls1_1] = "no-tls1_1"
33PACKAGECONFIG[manpages] = "" 33PACKAGECONFIG[manpages] = ""
34PACKAGECONFIG[fips] = "enable-fips"
34 35
35B = "${WORKDIR}/build" 36B = "${WORKDIR}/build"
36do_configure[cleandirs] = "${B}" 37do_configure[cleandirs] = "${B}"
37 38
39EXTRA_OECONF = "${@bb.utils.contains('PTEST_ENABLED', '1', '', 'no-tests', d)}"
40
38#| ./libcrypto.so: undefined reference to `getcontext' 41#| ./libcrypto.so: undefined reference to `getcontext'
39#| ./libcrypto.so: undefined reference to `setcontext' 42#| ./libcrypto.so: undefined reference to `setcontext'
40#| ./libcrypto.so: undefined reference to `makecontext' 43#| ./libcrypto.so: undefined reference to `makecontext'
@@ -43,12 +46,15 @@ EXTRA_OECONF:append:libc-musl:powerpc64 = " no-asm"
43 46
44# 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
45# (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)
46EXTRA_OECONF:class-native = "--with-rand-seed=os,devrandom" 49EXTRA_OECONF:append:class-native = " --with-rand-seed=os,devrandom"
47EXTRA_OECONF:class-nativesdk = "--with-rand-seed=os,devrandom" 50EXTRA_OECONF:append:class-nativesdk = " --with-rand-seed=os,devrandom"
48 51
49# 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.
50CFLAGS: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"'
51CFLAGS: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"
52 58
53# This allows disabling deprecated or undesirable crypto algorithms. 59# This allows disabling deprecated or undesirable crypto algorithms.
54# The default is to trust upstream choices. 60# The default is to trust upstream choices.
@@ -135,21 +141,26 @@ do_configure () {
135 ;; 141 ;;
136 esac 142 esac
137 143
138 useprefix=${prefix}
139 if [ "x$useprefix" = "x" ]; then
140 useprefix=/
141 fi
142 # 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
143 # environment variables set by bitbake. Adjust the environment variables instead. 145 # environment variables set by bitbake. Adjust the environment variables instead.
144 PERLEXTERNAL="$(realpath ${S}/external/perl/Text-Template-*/lib)" 146 PERLEXTERNAL="$(realpath ${S}/external/perl/Text-Template-*/lib)"
145 test -d "$PERLEXTERNAL" || bberror "PERLEXTERNAL '$PERLEXTERNAL' not found!" 147 test -d "$PERLEXTERNAL" || bberror "PERLEXTERNAL '$PERLEXTERNAL' not found!"
146 HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="$PERLEXTERNAL" \ 148 HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="$PERLEXTERNAL" \
147 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
148 perl ${B}/configdata.pm --dump 150 perl ${B}/configdata.pm --dump
149} 151}
150 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
151do_install () { 160do_install () {
152 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)}
153 164
154 oe_multilib_header openssl/opensslconf.h 165 oe_multilib_header openssl/opensslconf.h
155 oe_multilib_header openssl/configuration.h 166 oe_multilib_header openssl/configuration.h
@@ -167,63 +178,72 @@ do_install () {
167 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
168 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
169 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
170} 186}
171 187
172do_install:append:class-native () { 188do_install:append:class-native () {
173 create_wrapper ${D}${bindir}/openssl \ 189 create_wrapper ${D}${bindir}/openssl \
174 OPENSSL_CONF=${libdir}/ssl-3/openssl.cnf \ 190 OPENSSL_CONF=\${OPENSSL_CONF:-${libdir}/ssl-3/openssl.cnf} \
175 SSL_CERT_DIR=${libdir}/ssl-3/certs \ 191 SSL_CERT_DIR=\${SSL_CERT_DIR:-${libdir}/ssl-3/certs} \
176 SSL_CERT_FILE=${libdir}/ssl-3/cert.pem \ 192 SSL_CERT_FILE=\${SSL_CERT_FILE:-${libdir}/ssl-3/cert.pem} \
177 OPENSSL_ENGINES=${libdir}/engines-3 \ 193 OPENSSL_ENGINES=\${OPENSSL_ENGINES:-${libdir}/engines-3} \
178 OPENSSL_MODULES=${libdir}/ossl-modules 194 OPENSSL_MODULES=\${OPENSSL_MODULES:-${libdir}/ossl-modules}
179} 195}
180 196
181do_install:append:class-nativesdk () { 197do_install:append:class-nativesdk () {
182 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d 198 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
183 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
184 sed 's|/usr/lib/ssl/|/usr/lib/ssl-3/|g' -i ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
185} 200}
186 201
187PTEST_BUILD_HOST_FILES += "configdata.pm" 202PTEST_BUILD_HOST_FILES += "configdata.pm"
188PTEST_BUILD_HOST_PATTERN = "perl_version =" 203PTEST_BUILD_HOST_PATTERN = "perl_version ="
189do_install_ptest () { 204do_install_ptest() {
190 install -d ${D}${PTEST_PATH}/test 205 install -m644 ${S}/Configure ${B}/configdata.pm ${D}${PTEST_PATH}
191 install -m755 ${B}/test/p_test.so ${D}${PTEST_PATH}/test 206 cp -rf ${S}/Configurations ${S}/external ${D}${PTEST_PATH}/
192 install -m755 ${B}/test/p_minimal.so ${D}${PTEST_PATH}/test
193 install -m755 ${B}/test/provider_internal_test.cnf ${D}${PTEST_PATH}/test
194
195 # Prune the build tree
196 rm -f ${B}/fuzz/*.* ${B}/test/*.*
197
198 cp ${S}/Configure ${B}/configdata.pm ${D}${PTEST_PATH}
199 sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm
200 cp -r ${S}/external ${B}/test ${S}/test ${B}/fuzz ${S}/util ${B}/util ${D}${PTEST_PATH}
201
202 # For test_shlibload
203 ln -s ${libdir}/libcrypto.so.1.1 ${D}${PTEST_PATH}/
204 ln -s ${libdir}/libssl.so.1.1 ${D}${PTEST_PATH}/
205 207
206 install -d ${D}${PTEST_PATH}/apps 208 install -d ${D}${PTEST_PATH}/apps
207 ln -s ${bindir}/openssl ${D}${PTEST_PATH}/apps 209 ln -s ${bindir}/openssl ${D}${PTEST_PATH}/apps
208 install -m644 ${S}/apps/*.pem ${S}/apps/*.srl ${S}/apps/openssl.cnf ${D}${PTEST_PATH}/apps
209 install -m755 ${B}/apps/CA.pl ${D}${PTEST_PATH}/apps
210
211 install -d ${D}${PTEST_PATH}/engines
212 install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines
213 install -m755 ${B}/engines/loader_attic.so ${D}${PTEST_PATH}/engines
214 install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines
215 210
216 install -d ${D}${PTEST_PATH}/providers 211 cd ${S}
217 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
218 235
219 install -d ${D}${PTEST_PATH}/Configurations 236 install -d ${D}${PTEST_PATH}/engines
220 cp -rf ${S}/Configurations/* ${D}${PTEST_PATH}/Configurations/ 237 install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines/
221 238 install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines/
222 # seems to be needed with perl 5.32.1 239 ln -s ${libdir}/engines-3/loader_attic.so ${D}${PTEST_PATH}/engines/
223 install -d ${D}${PTEST_PATH}/util/perl/recipes 240 ln -s ${libdir}/ossl-modules/ ${D}${PTEST_PATH}/providers
224 cp ${D}${PTEST_PATH}/test/recipes/tconversion.pl ${D}${PTEST_PATH}/util/perl/recipes/ 241}
225 242
226 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
227} 247}
228 248
229# 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
@@ -231,7 +251,7 @@ do_install_ptest () {
231# 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
232# package since the openssl-bin package depends on the libcrypto package. 252# package since the openssl-bin package depends on the libcrypto package.
233 253
234PACKAGES =+ "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"
235 255
236FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}" 256FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}"
237FILES:libssl = "${libdir}/libssl${SOLIBS}" 257FILES:libssl = "${libdir}/libssl${SOLIBS}"
@@ -243,6 +263,7 @@ FILES:${PN}-engines = "${libdir}/engines-3"
243FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3" 263FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3"
244FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash" 264FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash"
245FILES:${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"
246FILES:${PN} =+ "${libdir}/ssl-3/* ${libdir}/ossl-modules/" 267FILES:${PN} =+ "${libdir}/ssl-3/* ${libdir}/ossl-modules/"
247FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh" 268FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
248 269
@@ -250,13 +271,13 @@ CONFFILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
250 271
251RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy" 272RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy"
252RDEPENDS:${PN}-misc = "perl" 273RDEPENDS:${PN}-misc = "perl"
253RDEPENDS:${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"
254 275
255RDEPENDS:${PN}-bin += "openssl-conf" 276RDEPENDS:${PN}-bin += "openssl-conf"
256 277
278# The test suite is installed stripped
279INSANE_SKIP:${PN} = "already-stripped"
280
257BBCLASSEXTEND = "native nativesdk" 281BBCLASSEXTEND = "native nativesdk"
258 282
259CVE_PRODUCT = "openssl:openssl" 283CVE_PRODUCT = "openssl:openssl"
260
261CVE_VERSION_SUFFIX = "alphabetical"
262