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/run-ptest19
4 files changed, 55 insertions, 51 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..cf5ff356ee 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@@ -1552,16 +1552,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'