openssl: upgrade to 4.0.1 and fix dependent recipes
cover openssl: upgrade to 4.0.1 and fix dependent recipes
This series upgrades OpenSSL from 3.5.7 to 4.0.1 and fixes all dependent recipes that break due to API changes in OpenSSL 4.0.
OpenSSL 4.0 is a major release with several breaking changes:
- ENGINE API fully removed
- SSLv3 support removed
- Per-version TLS method functions (SSLv3_method etc.) removed
- ASN1_STRING made opaque
- const qualifiers added to X509 getter functions
Patches:
1/7 openssl: upgrade 3.5.7 -> 4.0.1
2/7 python3: backport OpenSSL 4.0 support (CPython commit 3364e7e62fa2) 3/7 socat: fix ASN1_STRING opaque struct access
4/7 rust: upgrade 1.96.1 -> 1.97.1 (openssl-sys 0.9.114 adds 4.0 support) 5/7 serf: fix ASN1_STRING opaque struct access
6/7 u-boot-tools: backport Provider API (replaces removed ENGINE API) 7/7 kea: add const qualifiers to X509 pointers
Dependencies:
- wpa-supplicant 2.12 upgrade (already under review):
https://patchwork.yoctoproject.org/project/oe-core/patch/[email protected]/
Testing:
- bitbake world: passes on qemux86-64, qemuarm64, qemuarm, qemuriscv64
- openssl ptest on qemux86-64: 362 files, 4310 tests, all passed (338 passed, 24 skipped - fips/lms/rc5/tfo/compression - all expected)
Notes on upstream status:
- python3: fix on CPython main, backport PR #146403 closed without merge
- socat: submitted to [email protected]
- rust: based on Deepesh's patchwork submission, fixed missing rust-source rename and dropped merged 0005-remap-OUT_DIR patch
- serf: fix in trunk (r1935023), no release yet
- u-boot-tools: PR #918 open since March 2026, under review
- kea: tracked as issue #4673, milestone kea3.3.2
This series depends on the following patches already on the list:
- Ankur Tyagi's wpa-supplicant 2.12 upgrade (under review)
- Deepesh Varatharajan's rust 1.97.1 upgrade (we resolved the remaining issues: missing rust-source rename and stale 0005-remap-OUT_DIR patch that was already merged upstream)
Sharing this early to get feedback and see if there are other recipes that break with OpenSSL 4.0 that we may have missed. The wpa-supplicant and rust dependencies are not yet merged, but the series is complete enough to build world on qemux86-64.
Deepesh Varatharajan (1):
rust: Upgrade 1.96.1 -> 1.97.1
Jaipaul Cheernam (6):
openssl: upgrade 3.5.7 -> 4.0.1
python3: backport OpenSSL 4.0 support from upstream
socat: fix build with OpenSSL 4.0
serf: fix build with OpenSSL 4.0
u-boot-tools: fix build with OpenSSL 4.0
kea: fix build with OpenSSL 4.0
.../classes-recipe/rust-target-config.bbclass | 5 +
meta/conf/distro/include/tcmode-default.inc | 2 +-
meta/lib/oeqa/selftest/cases/rust.py | 3 +-
...Add-support-for-OpenSSL-Provider-API.patch | 300 ++++++++++++++
.../u-boot/u-boot-tools_2026.07.bb | 4 +-
...-qualifiers-to-OpenSSL-X509-pointers.patch | 49 +++
meta/recipes-connectivity/kea/kea_3.2.0.bb | 1 +
...ke-history-reporting-when-test-fails.patch | 366 ------------------
...1-Configure-do-not-tweak-mips-cflags.patch | 6 +-
...sysroot-and-debug-prefix-map-from-co.patch | 11 +-
.../0001-extend-check_cwm-test-timeout.patch | 4 +-
.../{openssl_3.5.7.bb => openssl_4.0.1.bb} | 23 +-
...penSSL-4.0-use-ASN1_STRING-accessors.patch | 31 ++
.../socat/socat_1.8.1.3.bb | 1 +
...146207-Add-support-for-OpenSSL-4.0.0.patch | 257 ++++++++++++
.../recipes-devtools/python/python3_3.14.7.bb | 1 +
.../rust/{cargo_1.96.1.bb => cargo_1.97.1.bb} | 0
...lain-syscalls-as-their-time64-varian.patch | 81 ----
...xplicit-tail-calls-disable-two-tests.patch | 39 --
...lls-ignore-tests-on-unsupported-llvm.patch | 96 -----
...ild-script-path-leakage-in-artifacts.patch | 28 --
...ibstd-rs_1.96.1.bb => libstd-rs_1.97.1.bb} | 0
....96.1.bb => rust-cross-canadian_1.97.1.bb} | 0
meta/recipes-devtools/rust/rust-snapshot.inc | 104 ++---
meta/recipes-devtools/rust/rust-source.inc | 6 +-
...source_1.96.1.bb => rust-source_1.97.1.bb} | 0
.../rust/{rust_1.96.1.bb => rust_1.97.1.bb} | 3 +
...penSSL-4.0-use-ASN1_STRING-accessors.patch | 35 ++
meta/recipes-support/serf/serf_1.3.10.bb | 1 +
29 files changed, 759 insertions(+), 698 deletions(-)
create mode 100644 meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch
create mode 100644 meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch
delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch
rename meta/recipes-connectivity/openssl/{openssl_3.5.7.bb => openssl_4.0.1.bb} (88%)
create mode 100644 meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
create mode 100644 meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch
rename meta/recipes-devtools/rust/{cargo_1.96.1.bb => cargo_1.97.1.bb} (100%)
delete mode 100644 meta/recipes-devtools/rust/files/0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch
delete mode 100644 meta/recipes-devtools/rust/files/0003-explicit-tail-calls-disable-two-tests.patch
delete mode 100644 meta/recipes-devtools/rust/files/0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch
delete mode 100644 meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch
rename meta/recipes-devtools/rust/{libstd-rs_1.96.1.bb => libstd-rs_1.97.1.bb} (100%)
rename meta/recipes-devtools/rust/{rust-cross-canadian_1.96.1.bb => rust-cross-canadian_1.97.1.bb} (100%)
rename meta/recipes-devtools/rust/{rust-source_1.96.1.bb => rust-source_1.97.1.bb} (100%)
rename meta/recipes-devtools/rust/{rust_1.96.1.bb => rust_1.97.1.bb} (98%)
create mode 100644 meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patchPATCH 1/7 openssl: upgrade 3.5.7 -> 4.0.1
Upgrade OpenSSL from 3.5.7 to 4.0.1. This is a major version upgrade.
Changelog: https://github.com/openssl/openssl/blob/openssl-4.0.1/CHANGES.md
New CVE fixes not already in 3.5.7:
* CVE-2026-28386: Fixed OOB read in AES-CFB-128 on x86-64 with AVX-512
* CVE-2026-35188: Fixed double-free when checking OCSP stapled response
* CVE-2026-42765: Fixed NULL deref in cert verification with OCSP
* CVE-2026-42771: Fixed OOB read in X509_VERIFY_PARAM_set1_email()
Major breaking changes in 4.0.0:
* Removed support for engines. The ENGINE API is fully removed.
* Removed support for SSLv3. SSLv3 has been deprecated since 2015.
* Removed support for the SSLv2 Client Hello.
* Removed per-version TLS method functions (SSLv3_method(),
TLSv1_method(), TLSv1_1_method(), TLSv1_2_method()).
* Removed c_rehash script tool. Use 'openssl rehash' instead.
* ASN1_STRING has been made opaque.
* Numerous API function signatures changed to include const qualifiers.
* libcrypto no longer cleans up globally allocated data via atexit().
* Added AKID verification checks when X509_V_FLAG_X509_STRICT is set.
* Support of deprecated elliptic curves in TLS disabled at compile-time by default.
Recipe changes:
* Drop 0001-Added-handshake-history-reporting-when-test-fails.patch
(merged upstream via PR #22481).
* Refresh remaining patches against the new version.
* Remove ENGINE API artifacts: engines package, dasync.so/ossltest.so ptest installation, ENGINESDIR references, OPENSSL_ENGINES wrapper variable, and cryptodev-linux PACKAGECONFIG.
Tested: ptest on qemux86-64:
Files=362, Tests=4310, Result: PASS
Passed: 338, Skipped: 24 (fips, lms, rc5, tfo, compression, sslversions, sslkeylogfile, external tests - all expected)
Failed: 0
---
...ke-history-reporting-when-test-fails.patch | 366 ------------------
...1-Configure-do-not-tweak-mips-cflags.patch | 6 +-
...sysroot-and-debug-prefix-map-from-co.patch | 11 +-
.../0001-extend-check_cwm-test-timeout.patch | 4 +-
.../{openssl_3.5.7.bb => openssl_4.0.1.bb} | 23 +-
5 files changed, 16 insertions(+), 394 deletions(-)
delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch
rename meta/recipes-connectivity/openssl/{openssl_3.5.7.bb => openssl_4.0.1.bb} (88%)meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0 -366
@@ -1,366 +0,0 @@ -From 5ba65051fea0513db0d997f0ab7cafb9826ed74a Mon Sep 17 00:00:00 2001 -From: William Lyu <[email protected]> -Date: Fri, 20 Oct 2023 16:22:37 -0400 -Subject: [PATCH] Added handshake history reporting when test fails - -Upstream-Status: Submitted [https://github.com/openssl/openssl/pull/22481] - -Signed-off-by: William Lyu <[email protected]> ---- - test/helpers/handshake.c | 136 ++++++++++++++++++++++++++++++--------- - test/helpers/handshake.h | 70 +++++++++++++++++++- - test/ssl_test.c | 44 +++++++++++++ - 3 files changed, 217 insertions(+), 33 deletions(-) - -diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c -index f611b3a..5703b48 100644 ---- a/test/helpers/handshake.c -+++ b/test/helpers/handshake.c -@@ -25,6 +25,102 @@ - #include <netinet/sctp.h> - #endif - -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+/* Maps string names to various enumeration type */ -+typedef struct { -+ const char *name; -+ int value; -+} enum_name_map; -+ -+static const enum_name_map connect_phase_names[] = { -+ {"Handshake", HANDSHAKE}, -+ {"RenegAppData", RENEG_APPLICATION_DATA}, -+ {"RenegSetup", RENEG_SETUP}, -+ {"RenegHandshake", RENEG_HANDSHAKE}, -+ {"AppData", APPLICATION_DATA}, -+ {"Shutdown", SHUTDOWN}, -+ {"ConnectionDone", CONNECTION_DONE} -+}; -+ -+static const enum_name_map peer_status_names[] = { -+ {"PeerSuccess", PEER_SUCCESS}, -+ {"PeerRetry", PEER_RETRY}, -+ {"PeerError", PEER_ERROR}, -+ {"PeerWaiting", PEER_WAITING}, -+ {"PeerTestFail", PEER_TEST_FAILURE} -+}; -+ -+static const enum_name_map handshake_status_names[] = { -+ {"HandshakeSuccess", HANDSHAKE_SUCCESS}, -+ {"ClientError", CLIENT_ERROR}, -+ {"ServerError", SERVER_ERROR}, -+ {"InternalError", INTERNAL_ERROR}, -+ {"HandshakeRetry", HANDSHAKE_RETRY} -+}; -+ -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+static const char *enum_name(const enum_name_map *enums, size_t num_enums, -+ int value) -+{ -+ size_t i; -+ for (i = 0; i < num_enums; i++) { -+ if (enums[i].value == value) { -+ return enums[i].name; -+ } -+ } -+ return "InvalidValue"; -+} -+ -+const char *handshake_connect_phase_name(connect_phase_t phase) -+{ -+ return enum_name(connect_phase_names, OSSL_NELEM(connect_phase_names), -+ (int)phase); -+} -+ -+const char *handshake_status_name(handshake_status_t handshake_status) -+{ -+ return enum_name(handshake_status_names, OSSL_NELEM(handshake_status_names), -+ (int)handshake_status); -+} -+ -+const char *handshake_peer_status_name(peer_status_t peer_status) -+{ -+ return enum_name(peer_status_names, OSSL_NELEM(peer_status_names), -+ (int)peer_status); -+} -+ -+static void save_loop_history(HANDSHAKE_HISTORY *history, -+ connect_phase_t phase, -+ handshake_status_t handshake_status, -+ peer_status_t server_status, -+ peer_status_t client_status, -+ int client_turn_count, -+ int is_client_turn) -+{ -+ HANDSHAKE_HISTORY_ENTRY *new_entry = NULL; -+ -+ /* -+ * Create a new history entry for a handshake loop with statuses given in -+ * the arguments. Potentially evicting the oldest entry when the -+ * ring buffer is full. -+ */ -+ ++(history->last_idx); -+ history->last_idx &= MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ -+ new_entry = &((history->entries)[history->last_idx]); -+ new_entry->phase = phase; -+ new_entry->handshake_status = handshake_status; -+ new_entry->server_status = server_status; -+ new_entry->client_status = client_status; -+ new_entry->client_turn_count = client_turn_count; -+ new_entry->is_client_turn = is_client_turn; -+ -+ /* Evict the oldest handshake loop entry when the ring buffer is full. */ -+ if (history->entry_count < MAX_HANDSHAKE_HISTORY_ENTRY) { -+ ++(history->entry_count); -+ } -+} -+ - HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void) - { - HANDSHAKE_RESULT *ret; -@@ -724,15 +820,6 @@ static void configure_handshake_ssl(SSL *server, SSL *client, - SSL_set_post_handshake_auth(client, 1); - } - --/* The status for each connection phase. */ --typedef enum { -- PEER_SUCCESS, -- PEER_RETRY, -- PEER_ERROR, -- PEER_WAITING, -- PEER_TEST_FAILURE --} peer_status_t; -- - /* An SSL object and associated read-write buffers. */ - typedef struct peer_st { - SSL *ssl; -@@ -1077,16 +1164,6 @@ static void do_shutdown_step(PEER *peer) - } - } - --typedef enum { -- HANDSHAKE, -- RENEG_APPLICATION_DATA, -- RENEG_SETUP, -- RENEG_HANDSHAKE, -- APPLICATION_DATA, -- SHUTDOWN, -- CONNECTION_DONE --} connect_phase_t; -- - static int renegotiate_op(const SSL_TEST_CTX *test_ctx) - { - switch (test_ctx->handshake_mode) { -@@ -1164,19 +1241,6 @@ static void do_connect_step(const SSL_TEST_CTX *test_ctx, PEER *peer, - } - } - --typedef enum { -- /* Both parties succeeded. */ -- HANDSHAKE_SUCCESS, -- /* Client errored. */ -- CLIENT_ERROR, -- /* Server errored. */ -- SERVER_ERROR, -- /* Peers are in inconsistent state. */ -- INTERNAL_ERROR, -- /* One or both peers not done. */ -- HANDSHAKE_RETRY --} handshake_status_t; -- - /* - * Determine the handshake outcome. - * last_status: the status of the peer to have acted last. -@@ -1541,6 +1605,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( - - start = time(NULL); - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - /* - * Half-duplex handshake loop. - * Client and server speak to each other synchronously in the same process. -@@ -1562,6 +1630,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( - 0 /* server went last */); - } - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - switch (status) { - case HANDSHAKE_SUCCESS: - client_turn_count = 0; -diff --git a/test/helpers/handshake.h b/test/helpers/handshake.h -index 78b03f9..b9967c2 100644 ---- a/test/helpers/handshake.h -+++ b/test/helpers/handshake.h -@@ -1,5 +1,5 @@ - /* -- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. -+ * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy -@@ -12,6 +12,11 @@ - - #include "ssl_test_ctx.h" - -+#define MAX_HANDSHAKE_HISTORY_ENTRY_BIT 4 -+#define MAX_HANDSHAKE_HISTORY_ENTRY (1 << MAX_HANDSHAKE_HISTORY_ENTRY_BIT) -+#define MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK \ -+ ((1 << MAX_HANDSHAKE_HISTORY_ENTRY_BIT) - 1) -+ - typedef struct ctx_data_st { - unsigned char *npn_protocols; - size_t npn_protocols_len; -@@ -22,6 +27,63 @@ typedef struct ctx_data_st { - char *session_ticket_app_data; - } CTX_DATA; - -+typedef enum { -+ HANDSHAKE, -+ RENEG_APPLICATION_DATA, -+ RENEG_SETUP, -+ RENEG_HANDSHAKE, -+ APPLICATION_DATA, -+ SHUTDOWN, -+ CONNECTION_DONE -+} connect_phase_t; -+ -+/* The status for each connection phase. */ -+typedef enum { -+ PEER_SUCCESS, -+ PEER_RETRY, -+ PEER_ERROR, -+ PEER_WAITING, -+ PEER_TEST_FAILURE -+} peer_status_t; -+ -+typedef enum { -+ /* Both parties succeeded. */ -+ HANDSHAKE_SUCCESS, -+ /* Client errored. */ -+ CLIENT_ERROR, -+ /* Server errored. */ -+ SERVER_ERROR, -+ /* Peers are in inconsistent state. */ -+ INTERNAL_ERROR, -+ /* One or both peers not done. */ -+ HANDSHAKE_RETRY -+} handshake_status_t; -+ -+/* Stores the various status information in a handshake loop. */ -+typedef struct handshake_history_entry_st { -+ connect_phase_t phase; -+ handshake_status_t handshake_status; -+ peer_status_t server_status; -+ peer_status_t client_status; -+ int client_turn_count; -+ int is_client_turn; -+} HANDSHAKE_HISTORY_ENTRY; -+ -+typedef struct handshake_history_st { -+ /* Implemented using ring buffer. */ -+ /* -+ * The valid entries are |entries[last_idx]|, |entries[last_idx-1]|, -+ * ..., etc., going up to |entry_count| number of entries. Note that when -+ * the index into the array |entries| becomes < 0, we wrap around to -+ * the end of |entries|. -+ */ -+ HANDSHAKE_HISTORY_ENTRY entries[MAX_HANDSHAKE_HISTORY_ENTRY]; -+ /* The number of valid entries in |entries| array. */ -+ size_t entry_count; -+ /* The index of the last valid entry in the |entries| array. */ -+ size_t last_idx; -+} HANDSHAKE_HISTORY; -+ - typedef struct handshake_result { - ssl_test_result_t result; - /* These alerts are in the 2-byte format returned by the info_callback. */ -@@ -77,6 +139,8 @@ typedef struct handshake_result { - char *cipher; - /* session ticket application data */ - char *result_session_ticket_app_data; -+ /* handshake loop history */ -+ HANDSHAKE_HISTORY history; - } HANDSHAKE_RESULT; - - HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void); -@@ -95,4 +159,8 @@ int configure_handshake_ctx_for_srp(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, - CTX_DATA *server2_ctx_data, - CTX_DATA *client_ctx_data); - -+const char *handshake_connect_phase_name(connect_phase_t phase); -+const char *handshake_status_name(handshake_status_t handshake_status); -+const char *handshake_peer_status_name(peer_status_t peer_status); -+ - #endif /* OSSL_TEST_HANDSHAKE_HELPER_H */ -diff --git a/test/ssl_test.c b/test/ssl_test.c -index ea60851..9d6b093 100644 ---- a/test/ssl_test.c -+++ b/test/ssl_test.c -@@ -26,6 +26,44 @@ static OSSL_LIB_CTX *libctx = NULL; - /* Currently the section names are of the form test-<number>, e.g. test-15. */ - #define MAX_TESTCASE_NAME_LENGTH 100 - -+static void print_handshake_history(const HANDSHAKE_HISTORY *history) -+{ -+ size_t first_idx; -+ size_t i; -+ size_t cur_idx; -+ const HANDSHAKE_HISTORY_ENTRY *cur_entry; -+ const char header_template[] = "|%14s|%16s|%16s|%16s|%17s|%14s|"; -+ const char body_template[] = "|%14s|%16s|%16s|%16s|%17d|%14s|"; -+ -+ TEST_info("The following is the server/client state " -+ "in the most recent %d handshake loops.", -+ MAX_HANDSHAKE_HISTORY_ENTRY); -+ -+ TEST_note("==================================================" -+ "=================================================="); -+ TEST_note(header_template, -+ "phase", "handshake status", "server status", -+ "client status", "client turn count", "is client turn"); -+ TEST_note("+--------------+----------------+----------------" -+ "+----------------+-----------------+--------------+"); -+ -+ first_idx = (history->last_idx - history->entry_count + 1) & -+ MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ for (i = 0; i < history->entry_count; ++i) { -+ cur_idx = (first_idx + i) & MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ cur_entry = &(history->entries)[cur_idx]; -+ TEST_note(body_template, -+ handshake_connect_phase_name(cur_entry->phase), -+ handshake_status_name(cur_entry->handshake_status), -+ handshake_peer_status_name(cur_entry->server_status), -+ handshake_peer_status_name(cur_entry->client_status), -+ cur_entry->client_turn_count, -+ cur_entry->is_client_turn ? "true" : "false"); -+ } -+ TEST_note("==================================================" -+ "=================================================="); -+} -+ - static const char *print_alert(int alert) - { - return alert ? SSL_alert_desc_string_long(alert) : "no alert"; -@@ -388,6 +426,12 @@ static int check_test(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) - ret &= check_client_sign_type(result, test_ctx); - ret &= check_client_ca_names(result, test_ctx); - } -+ -+ /* Print handshake loop history if any check fails. */ -+ if (!ret) { -+ print_handshake_history(&(result->history)); -+ } -+ - return ret; - } - --- -2.25.1 -
meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch +3 -3
@@ -1,4 +1,4 @@ -From 0377f0d5b5c1079e3b9a80881f4dcc891cbe9f9a Mon Sep 17 00:00:00 2001 +From b5cee0cb0f14a78056ef7722a34b361491f1fdda Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <[email protected]> Date: Tue, 30 May 2023 09:11:27 -0700 Subject: [PATCH] Configure: do not tweak mips cflags
@@ -17,10 +17,10 @@ Signed-off-by: Tim Orling <[email protected]> 1 file changed, 10 deletions(-) diff --git a/Configure b/Configure -index fff97bd..5ee54c1 100755 +index c05a30b..db8adee 100755 --- a/Configure +++ b/Configure -@@ -1557,16 +1557,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) +@@ -1575,16 +1575,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) push @{$config{shared_ldflag}}, "-mno-cygwin"; }
meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +5 -6
@@ -1,4 +1,4 @@ -From 5985253f2c9025d7c127443a3a9938946f80c2a1 Mon Sep 17 00:00:00 2001 +From 6df53bfebcf8ca65910a18220a6576fb110918a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <[email protected]> Date: Tue, 6 Nov 2018 14:50:47 +0100 Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map from compiler
@@ -28,17 +28,16 @@ Signed-off-by: Kai Kang <[email protected]> Update to fix buildpaths qa issue for '-ffile-prefix-map'. Signed-off-by: Khem Raj <[email protected]> - --- Configurations/unix-Makefile.tmpl | 16 +++++++++++++++- crypto/build.info | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl -index 09303c4..011bda1 100644 +index eff66e5..bc48f51 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl -@@ -514,13 +514,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), +@@ -503,13 +503,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
@@ -68,10 +67,10 @@ index 09303c4..011bda1 100644 # For x86 assembler: Set PROCESSOR to 386 if you want to support diff --git a/crypto/build.info b/crypto/build.info -index aee5c46..95c9577 100644 +index 8e4a885..95b0902 100644 --- a/crypto/build.info +++ b/crypto/build.info -@@ -115,7 +115,7 @@ DEFINE[../libcrypto]=$UPLINKDEF +@@ -114,7 +114,7 @@ DEFINE[../libcrypto]=$UPLINKDEF DEPEND[info.o]=buildinf.h DEPEND[cversion.o]=buildinf.h
meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patch +2 -2
@@ -1,4 +1,4 @@ -From c7000672296f4c367341aa3415f26c4d9f5e4749 Mon Sep 17 00:00:00 2001 +From 14856dbd767621ce6f162680c00557b54af0effb Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari <[email protected]> Date: Thu, 23 Oct 2025 11:24:36 +0200 Subject: [PATCH] extend check_cwm test timeout
@@ -15,7 +15,7 @@ Signed-off-by: Gyorgy Sarvari <[email protected]> 1 file changed, 5 insertions(+) diff --git a/test/radix/main.c b/test/radix/main.c -index 4a1e886a71..39f8c61ef9 100644 +index 0f3dc11..d925639 100644 --- a/test/radix/main.c +++ b/test/radix/main.c @@ -25,6 +25,11 @@ static int test_script(int idx)
meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +6 -17
@@ -11,7 +11,6 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ file://run-ptest \ file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ file://0001-Configure-do-not-tweak-mips-cflags.patch \ - file://0001-Added-handshake-history-reporting-when-test-fails.patch \ file://0001-extend-check_cwm-test-timeout.patch \ "
@@ -19,7 +18,7 @@ SRC_URI:append:class-nativesdk = " \ file://environment.d-openssl.sh \ " -SRC_URI[sha256sum] = "a8c0d28a529ca480f9f36cf5792e2cd21984552a3c8e4aa11a24aa31aeac98e8" +SRC_URI[sha256sum] = "2db3f3a0d6ea4b59e1f094ace2c8cd536dffb87cdc39084c5afa1e6f7f37dd09" inherit lib_package multilib_header multilib_script ptest perlnative manpages MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
@@ -33,7 +32,6 @@ PACKAGECONFIG ?= "" PACKAGECONFIG:class-native = "" PACKAGECONFIG:class-nativesdk = "" -PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module" PACKAGECONFIG[legacy] = ",no-legacy" PACKAGECONFIG[tls1] = ",no-tls1" PACKAGECONFIG[tls1_1] = ",no-tls1_1"
@@ -57,8 +55,8 @@ EXTRA_OECONF:append:class-native = " --with-rand-seed=os,devrandom" EXTRA_OECONF:append:class-nativesdk = " --with-rand-seed=os,devrandom" # Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate. -EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' -EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"' #| threads_pthread.c:(.text+0x372): undefined reference to `__atomic_is_lock_free' EXTRA_OECONF:append:toolchain-clang:x86 = " -latomic"
@@ -204,12 +202,10 @@ do_install:append:class-native () { OPENSSL_CONF=\${OPENSSL_CONF:-${libdir}/ssl-3/openssl.cnf} \ SSL_CERT_DIR=\${SSL_CERT_DIR:-${libdir}/ssl-3/certs} \ SSL_CERT_FILE=\${SSL_CERT_FILE:-${libdir}/ssl-3/cert.pem} \ - OPENSSL_ENGINES=\${OPENSSL_ENGINES:-${libdir}/engines-3} \ OPENSSL_MODULES=\${OPENSSL_MODULES:-${libdir}/ossl-modules} - # Setting ENGINESDIR and MODULESDIR to invalid paths prevents host contamination, + # Setting MODULESDIR to invalid paths prevents host contamination, # but also breaks the generated libcrypto.pc file. Post-Fix it manually here. - sed -i 's|^enginesdir=\($.libdir.\)/.*|enginesdir=\1/engines-3|' ${D}${libdir}/pkgconfig/libcrypto.pc sed -i 's|^modulesdir=\($.libdir.\)/.*|modulesdir=\1/ossl-modules|' ${D}${libdir}/pkgconfig/libcrypto.pc }
@@ -252,10 +248,6 @@ do_install_ptest() { sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm ${D}${PTEST_PATH}/util/wrap.pl - install -d ${D}${PTEST_PATH}/engines - install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines/ - install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines/ - ln -s ${libdir}/engines-3/loader_attic.so ${D}${PTEST_PATH}/engines/ ln -s ${libdir}/ossl-modules/ ${D}${PTEST_PATH}/providers }
@@ -270,16 +262,13 @@ pkg_postinst_ontarget:${PN}-ossl-module-fips () { # file to be installed for both the openssl-bin package and the libcrypto # package since the openssl-bin package depends on the libcrypto package. -PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips" +PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips" FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}" FILES:libssl = "${libdir}/libssl${SOLIBS}" FILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf* \ ${libdir}/ssl-3/openssl.cnf* \ " -FILES:${PN}-engines = "${libdir}/engines-3" -# ${prefix} comes from what we pass into --prefix at configure time (which is used for INSTALLTOP) -FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3" FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash" FILES:${PN}-ossl-module-legacy = "${libdir}/ossl-modules/legacy.so" FILES:${PN}-ossl-module-fips = "${libdir}/ossl-modules/fips.so"
@@ -290,7 +279,7 @@ CONFFILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf" RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy" RDEPENDS:${PN}-misc = "perl" -RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed openssl-engines" +RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed" RRECOMMENDS:${PN}-ptest += "${PN}-ossl-module-legacy" RDEPENDS:${PN}-bin += "openssl-conf"
Re: [OE-core] [PATCH 1/7] openssl: upgrade 3.5.7 -> 4.0.1
Quoted 32 lines · Jaipaul Cheernam
Upgrade OpenSSL from 3.5.7 to 4.0.1. This is a major version upgrade.
Changelog: https://github.com/openssl/openssl/blob/openssl-4.0.1/CHANGES.md
New CVE fixes not already in 3.5.7:
* CVE-2026-28386: Fixed OOB read in AES-CFB-128 on x86-64 with AVX-512
* CVE-2026-35188: Fixed double-free when checking OCSP stapled response
* CVE-2026-42765: Fixed NULL deref in cert verification with OCSP
* CVE-2026-42771: Fixed OOB read inX509_VERIFY_PARAM_set1_email()Major breaking changes in 4.0.0:
* Removed support for engines. The ENGINE API is fully removed.
* Removed support for SSLv3. SSLv3 has been deprecated since 2015.
* Removed support for the SSLv2 Client Hello.
* Removed per-version TLS method functions (SSLv3_method(),TLSv1_method(), TLSv1_1_method(), TLSv1_2_method()).* Removed
c_rehashscript tool. Use 'openssl rehash' instead.
*ASN1_STRINGhas been made opaque.
* Numerous API function signatures changed to include const qualifiers.
* libcrypto no longer cleans up globally allocated data viaatexit().
* Added AKID verification checks whenX509_V_FLAG_X509_STRICTis set.
* Support of deprecated elliptic curves in TLS disabled at compile-time by default.Recipe changes:
* Drop 0001-Added-handshake-history-reporting-when-test-fails.patch(merged upstream via PR #22481).* Refresh remaining patches against the new version.
* Remove ENGINE API artifacts: engines package, dasync.so/ossltest.so ptest installation, ENGINESDIR references,OPENSSL_ENGINESwrapper variable, and cryptodev-linux PACKAGECONFIG.
Quoted 6 lines
Tested: ptest on qemux86-64:
Files=362, Tests=4310, Result: PASS
Passed: 338, Skipped: 24 (fips, lms, rc5, tfo, compression, sslversions, sslkeylogfile, external tests - all expected)
Failed: 0
Hi Jaipaul,
Thanks for your patch.
I gave it a go on the autobuilder, and we can see some build issues.
A first one (multilib related ?):
ERROR: lib32-openssl-4.0.1-r0 do_package: Execution of '/srv/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86-pokymllib32-linux/lib32-openssl/4.0.1/temp/run.multilibscript_rename.3735101' failed with exit code 1
...
| mv: cannot stat '/srv/pokybuild/yocto-worker/multilib/build/build/tmp/work/x86-pokymllib32-linux/lib32-openssl/4.0.1/package/usr/bin/c_rehash': No such file or directory | WARNING: exit code 1 from a shell command. | DEBUG: Python function do_package finished
NOTE: recipe lib32-openssl-4.0.1-r0: task do_package: Failed
ERROR: Task (virtual:multilib:lib32:/srv/pokybuild/yocto-worker/multilib/build/layers/openembedded-core/meta/recipes-connectivity/openssl/openssl_4.0.1.bb:do_package) failed with exit code '1'
https://autobuilder.yoctoproject.org/valkyrie/#/builders/92/builds/4374
https://autobuilder.yoctoproject.org/valkyrie/#/builders/92/builds/4374
And a second one:
ERROR: openssl-4.0.1-r0 do_compile: Execution of '/srv/pokybuild/yocto-worker/qemux86-alt/build/build/tmp/work/core2-32-poky-linux/openssl/4.0.1/temp/run.do_compile.3557282' failed with exit code 1
...
| ../sources/openssl-4.0.1/providers/implementations/keymgmt/ml_kem_kmgmt.c:25:10: fatal error: prov/der_wrap.h: No such file or directory | 25 | #include "prov/der_wrap.h" | | ^~~~~~~~~~~~~~~~~ | compilation terminated.
https://autobuilder.yoctoproject.org/valkyrie/#/builders/20/builds/4341
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 2/7 python3: backport OpenSSL 4.0 support from upstream
In reply to Jaipaul CheernamBackport CPython commit 3364e7e62fa24d0e19133fb0f90b1c24ef1110c5:
gh-146207: Add support for OpenSSL 4.0.0 alpha1 (#146217)
OpenSSL 4.0.0 alpha1 removed these functions:
* SSLv3_method()
* TLSv1_method()
* TLSv1_1_method()
* TLSv1_2_method()
Other changes:
* Update test_openssl_version().
* Update multissltests.py for OpenSSL 4.
* Add const qualifier to fix compiler warnings.
Upstream-Status: Backport [https://github.com/python/cpython/commit/3364e7e62fa24d0e19133fb0f90b1c24ef1110c5]
--- ...146207-Add-support-for-OpenSSL-4.0.0.patch | 257 ++++++++++++++++++ .../recipes-devtools/python/python3_3.14.7.bb | 1 + 2 files changed, 258 insertions(+) create mode 100644 meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch
meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch new file +257 -0
@@ -0,0 +1,257 @@ +From 3364e7e62fa24d0e19133fb0f90b1c24ef1110c5 Mon Sep 17 00:00:00 2001 +From: Victor Stinner <[email protected]> +Date: Wed, 25 Mar 2026 07:44:47 +0100 +Subject: [PATCH] gh-146207: Add support for OpenSSL 4.0.0 alpha1 (#146217) + +OpenSSL 4.0.0 alpha1 removed these functions: + +* SSLv3_method() +* TLSv1_method() +* TLSv1_1_method() +* TLSv1_2_method() + +Other changes: + +* Update test_openssl_version(). +* Update multissltests.py for OpenSSL 4. +* Add const qualifier to fix compiler warnings. + +Co-authored-by: Bénédikt Tran <[email protected]> +Signed-off-by: Victor Stinner <[email protected]> + +Upstream-Status: Backport [https://github.com/python/cpython/commit/3364e7e62fa24d0e19133fb0f90b1c24ef1110c5] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + Lib/test/test_ssl.py | 52 ++++++++++++++++++++------------------ + Modules/_ssl.c | 27 ++++++++++++++++---- + Modules/_ssl/cert.c | 3 ++- + Tools/ssl/multissltests.py | 7 ++++- + 4 files changed, 58 insertions(+), 31 deletions(-) + +diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py +index dc795c6bd8a..61355927296 100644 +--- a/Lib/test/test_ssl.py ++++ b/Lib/test/test_ssl.py +@@ -395,7 +395,7 @@ def test_constants(self): + ssl.OP_NO_COMPRESSION + self.assertEqual(ssl.HAS_SNI, True) + self.assertEqual(ssl.HAS_ECDH, True) +- self.assertEqual(ssl.HAS_TLSv1_2, True) ++ self.assertIsInstance(ssl.HAS_TLSv1_2, bool) + self.assertEqual(ssl.HAS_TLSv1_3, True) + ssl.OP_NO_SSLv2 + ssl.OP_NO_SSLv3 +@@ -586,11 +586,11 @@ def test_openssl_version(self): + # Some sanity checks follow + # >= 1.1.1 + self.assertGreaterEqual(n, 0x10101000) +- # < 4.0 +- self.assertLess(n, 0x40000000) ++ # < 5.0 ++ self.assertLess(n, 0x50000000) + major, minor, fix, patch, status = t + self.assertGreaterEqual(major, 1) +- self.assertLess(major, 4) ++ self.assertLess(major, 5) + self.assertGreaterEqual(minor, 0) + self.assertLess(minor, 256) + self.assertGreaterEqual(fix, 0) +@@ -656,12 +656,14 @@ def test_openssl111_deprecations(self): + ssl.OP_NO_TLSv1_2, + ssl.OP_NO_TLSv1_3 + ] +- protocols = [ +- ssl.PROTOCOL_TLSv1, +- ssl.PROTOCOL_TLSv1_1, +- ssl.PROTOCOL_TLSv1_2, +- ssl.PROTOCOL_TLS +- ] ++ protocols = [] ++ if hasattr(ssl, 'PROTOCOL_TLSv1'): ++ protocols.append(ssl.PROTOCOL_TLSv1) ++ if hasattr(ssl, 'PROTOCOL_TLSv1_1'): ++ protocols.append(ssl.PROTOCOL_TLSv1_1) ++ if hasattr(ssl, 'PROTOCOL_TLSv1_2'): ++ protocols.append(ssl.PROTOCOL_TLSv1_2) ++ protocols.append(ssl.PROTOCOL_TLS) + versions = [ + ssl.TLSVersion.SSLv3, + ssl.TLSVersion.TLSv1, +@@ -1205,6 +1207,7 @@ def test_min_max_version(self): + ssl.TLSVersion.TLSv1, + ssl.TLSVersion.TLSv1_1, + ssl.TLSVersion.TLSv1_2, ++ ssl.TLSVersion.TLSv1_3, + ssl.TLSVersion.SSLv3, + } + ) +@@ -1218,7 +1221,7 @@ def test_min_max_version(self): + with self.assertRaises(ValueError): + ctx.minimum_version = 42 + +- if has_tls_protocol(ssl.PROTOCOL_TLSv1_1): ++ if has_tls_protocol('PROTOCOL_TLSv1_1'): + ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_1) + + self.assertIn( +@@ -1675,23 +1678,24 @@ def test__create_stdlib_context(self): + self.assertFalse(ctx.check_hostname) + self._assert_context_options(ctx) + +- if has_tls_protocol(ssl.PROTOCOL_TLSv1): ++ if has_tls_protocol('PROTOCOL_TLSv1'): + with warnings_helper.check_warnings(): + ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1) + self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1) + self.assertEqual(ctx.verify_mode, ssl.CERT_NONE) + self._assert_context_options(ctx) + +- with warnings_helper.check_warnings(): +- ctx = ssl._create_stdlib_context( +- ssl.PROTOCOL_TLSv1_2, +- cert_reqs=ssl.CERT_REQUIRED, +- check_hostname=True +- ) +- self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1_2) +- self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED) +- self.assertTrue(ctx.check_hostname) +- self._assert_context_options(ctx) ++ if has_tls_protocol('PROTOCOL_TLSv1_2'): ++ with warnings_helper.check_warnings(): ++ ctx = ssl._create_stdlib_context( ++ ssl.PROTOCOL_TLSv1_2, ++ cert_reqs=ssl.CERT_REQUIRED, ++ check_hostname=True ++ ) ++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1_2) ++ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED) ++ self.assertTrue(ctx.check_hostname) ++ self._assert_context_options(ctx) + + ctx = ssl._create_stdlib_context(purpose=ssl.Purpose.CLIENT_AUTH) + self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLS_SERVER) +@@ -3654,10 +3658,10 @@ def test_protocol_tlsv1_2(self): + client_options=ssl.OP_NO_TLSv1_2) + + try_protocol_combo(ssl.PROTOCOL_TLS, ssl.PROTOCOL_TLSv1_2, 'TLSv1.2') +- if has_tls_protocol(ssl.PROTOCOL_TLSv1): ++ if has_tls_protocol('PROTOCOL_TLSv1'): + try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1, False) + try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1_2, False) +- if has_tls_protocol(ssl.PROTOCOL_TLSv1_1): ++ if has_tls_protocol('PROTOCOL_TLSv1_1'): + try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1_1, False) + try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1_2, False) + +diff --git a/Modules/_ssl.c b/Modules/_ssl.c +index b45295b4c0c..6f75af86113 100644 +--- a/Modules/_ssl.c ++++ b/Modules/_ssl.c +@@ -164,6 +164,17 @@ static void _PySSLFixErrno(void) { + #error Unsupported OpenSSL version + #endif + ++#if (OPENSSL_VERSION_NUMBER >= 0x40000000L) ++# define OPENSSL_NO_SSL3 ++# define OPENSSL_NO_TLS1 ++# define OPENSSL_NO_TLS1_1 ++# define OPENSSL_NO_TLS1_2 ++# define OPENSSL_NO_SSL3_METHOD ++# define OPENSSL_NO_TLS1_METHOD ++# define OPENSSL_NO_TLS1_1_METHOD ++# define OPENSSL_NO_TLS1_2_METHOD ++#endif ++ + /* OpenSSL API 1.1.0+ does not include version methods */ + #ifndef OPENSSL_NO_SSL3_METHOD + extern const SSL_METHOD *SSLv3_method(void); +@@ -1151,7 +1162,7 @@ _asn1obj2py(_sslmodulestate *state, const ASN1_OBJECT *name, int no_name) + + static PyObject * + _create_tuple_for_attribute(_sslmodulestate *state, +- ASN1_OBJECT *name, ASN1_STRING *value) ++ const ASN1_OBJECT *name, const ASN1_STRING *value) + { + Py_ssize_t buflen; + PyObject *pyattr; +@@ -1180,16 +1191,16 @@ _create_tuple_for_attribute(_sslmodulestate *state, + } + + static PyObject * +-_create_tuple_for_X509_NAME (_sslmodulestate *state, X509_NAME *xname) ++_create_tuple_for_X509_NAME(_sslmodulestate *state, const X509_NAME *xname) + { + PyObject *dn = NULL; /* tuple which represents the "distinguished name" */ + PyObject *rdn = NULL; /* tuple to hold a "relative distinguished name" */ + PyObject *rdnt; + PyObject *attr = NULL; /* tuple to hold an attribute */ + int entry_count = X509_NAME_entry_count(xname); +- X509_NAME_ENTRY *entry; +- ASN1_OBJECT *name; +- ASN1_STRING *value; ++ const X509_NAME_ENTRY *entry; ++ const ASN1_OBJECT *name; ++ const ASN1_STRING *value; + int index_counter; + int rdn_level = -1; + int retcode; +@@ -6967,9 +6978,15 @@ sslmodule_init_constants(PyObject *m) + ADD_INT_CONST("PROTOCOL_TLS", PY_SSL_VERSION_TLS); + ADD_INT_CONST("PROTOCOL_TLS_CLIENT", PY_SSL_VERSION_TLS_CLIENT); + ADD_INT_CONST("PROTOCOL_TLS_SERVER", PY_SSL_VERSION_TLS_SERVER); ++#ifndef OPENSSL_NO_TLS1 + ADD_INT_CONST("PROTOCOL_TLSv1", PY_SSL_VERSION_TLS1); ++#endif ++#ifndef OPENSSL_NO_TLS1_1 + ADD_INT_CONST("PROTOCOL_TLSv1_1", PY_SSL_VERSION_TLS1_1); ++#endif ++#ifndef OPENSSL_NO_TLS1_2 + ADD_INT_CONST("PROTOCOL_TLSv1_2", PY_SSL_VERSION_TLS1_2); ++#endif + + #define ADD_OPTION(NAME, VALUE) if (sslmodule_add_option(m, NAME, (VALUE)) < 0) return -1 + +diff --git a/Modules/_ssl/cert.c b/Modules/_ssl/cert.c +index f2e7be89668..061b0fb3171 100644 +--- a/Modules/_ssl/cert.c ++++ b/Modules/_ssl/cert.c +@@ -128,7 +128,8 @@ _ssl_Certificate_get_info_impl(PySSLCertificate *self) + } + + static PyObject* +-_x509name_print(_sslmodulestate *state, X509_NAME *name, int indent, unsigned long flags) ++_x509name_print(_sslmodulestate *state, const X509_NAME *name, ++ int indent, unsigned long flags) + { + PyObject *res; + BIO *biobuf; +diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py +index 3b4507c6771..48207e5330f 100755 +--- a/Tools/ssl/multissltests.py ++++ b/Tools/ssl/multissltests.py +@@ -429,9 +429,11 @@ def _post_install(self): + def _post_install(self): + if self.version.startswith("3."): + self._post_install_3xx() ++ elif self.version.startswith("4."): ++ self._post_install_4xx() + + def _build_src(self, config_args=()): +- if self.version.startswith("3."): ++ if self.version.startswith(("3.", "4.")): + config_args += ("enable-fips",) + super()._build_src(config_args) + +@@ -447,6 +449,9 @@ def _post_install_3xx(self): + lib64 = self.lib_dir + "64" + os.symlink(lib64, self.lib_dir) + ++ def _post_install_4xx(self): ++ self._post_install_3xx() ++ + @property + def short_version(self): + """Short version for OpenSSL download URL""" +-- +2.25.1 +
meta/recipes-devtools/python/python3_3.14.7.bb +1 -0
@@ -22,6 +22,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-Avoid-shebang-overflow-on-python-config.py.patch \ file://0001-Update-test_sysconfig-for-posix_user-purelib.patch \ file://0001-prefer-valid-entrypoints.patch \ + file://0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch \ " SRC_URI:append:class-native = " \ file://0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch \
PATCH 3/7 socat: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 made ASN1_STRING opaque. socat directly accesses pName->d.iPAddress->data and pName->d.iPAddress->length which is no longer allowed.
Use ASN1_STRING_get0_data() and ASN1_STRING_length() accessor functions instead. These have been available since OpenSSL 1.1.0 so this is backward compatible.
Upstream-Status: Submitted [[email protected]]
--- ...penSSL-4.0-use-ASN1_STRING-accessors.patch | 31 +++++++++++++++++++ .../socat/socat_1.8.1.3.bb | 1 + 2 files changed, 32 insertions(+) create mode 100644 meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jaipaul Cheernam <[email protected]> +Date: Thu, 13 Aug 2026 07:00:00 +0000 +Subject: [PATCH] Fix build with OpenSSL 4.0: use ASN1_STRING accessors + +OpenSSL 4.0 made ASN1_STRING opaque. Direct access to struct members +(->data, ->length) is no longer possible. Use the accessor functions +ASN1_STRING_get0_data() and ASN1_STRING_length() instead. + +These accessors have been available since OpenSSL 1.1.0, so this change +is backward compatible. + +Upstream-Status: Submitted [[email protected]] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + xio-openssl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/xio-openssl.c ++++ b/xio-openssl.c +@@ -1898,8 +1898,8 @@ + case GEN_IPADD: + { + /* binary address format */ +- const unsigned char *data = pName->d.iPAddress->data; +- size_t len = pName->d.iPAddress->length; ++ const unsigned char *data = ASN1_STRING_get0_data(pName->d.iPAddress); ++ size_t len = ASN1_STRING_length(pName->d.iPAddress); + char aBuffer[INET6_ADDRSTRLEN]; /* canonical peername */ + struct in6_addr ip6bin; +
meta/recipes-connectivity/socat/socat_1.8.1.3.bb +1 -0
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \ file://0001-fix-compile-procan.c-failed.patch \ + file://0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch \ " SRC_URI[sha256sum] = "25bc6476292b2e614220989c77b0b6fca87bb2525d9747b31a6639b1fb602418"
PATCH 4/7 rust: Upgrade 1.96.1 -> 1.97.1
In reply to Jaipaul CheernamFrom: Deepesh Varatharajan <[email protected]>
1.97.1
Rust 1.97.1 is a point release that fixes a critical miscompilation in an LLVM optimization (rust-lang/rust#159035) that has been silently affecting generated code since at least Rust 1.87.
https://github.com/rust-lang/rust/releases/tag/1.97.1
1.97.0
Rust Changes:
https://github.com/rust-lang/rust/releases/tag/1.97.0
Cargo Changes:
https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-197-2026-07-09
Release highlights:
- v0 symbol mangling scheme now default
- New allow-by-default dead_code_pub_in_binary lint
- Cargo: stabilized build.warnings and resolver.lockfile-path configs
- Multiple new stabilized APIs (isolate_highest_one, bit_width, etc)
Drop merged patches:
0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch
(merged upstream in vendored libc 0.2.186)
0003-explicit-tail-calls-disable-two-tests.patch
(backport from fb9e970c1f93 and 250beb317422)
0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch
(backport from ded0aaba6ce2)
rust-target-config: Set frame-pointer to non-leaf for aarch64
The upstream rustc aarch64-unknown-linux-gnu target specifies "frame-pointer": "non-leaf" as required by the AArch64 AAPCS64 ABI [1]. OE custom target JSON was missing this, causing codegen differences that led to test failures in tests/assembly-llvm/issue-141649.rs.
Set frame-pointer to non-leaf for aarch64 in rust_gen_target() to match the upstream target configuration.
[1] https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#the-frame-pointer
Updated files:
rust-source.inc: updated sha256sum, removed merged patches, added new patches rust-snapshot.inc: updated SNAPSHOT_VERSION 1.95.0 -> 1.96.0 with all arch checksums tcmode-default.inc: updated RUSTVERSION 1.96.1% -> 1.97.0% rust_1.97.0.bb: remove vendored .a files from installed sources
(fix dwarfsrcfiles failure on non-ELF wit-bindgen-0.57.1 archive)
Selftest Changes:
Exclude tests/ui/codegen/huge-stacks.rs (fails in QEMU emulated
environments due to resource limits — new test in 1.97.0. Upstream discussion - https://github.com/rust-lang/rust/issues/158557)
Fix stale exclusion path: tests/assembly-llvm/c-variadic-arm.rs ->
tests/assembly-llvm/c-variadic/arm.rs (file moved to subdirectory)
Excluded tests:
+---------+---------+---------+ | Before | After | Skipped | +---------+---------+---------+ | 41 | 42 | +1 | +---------+---------+---------+
rust v1.97.0 (from autobuilder)
+-------------+---------+---------+ | Machine | Passed | Skipped | +-------------+---------+---------+ | qemux86-64 | 22752 | 762 | | qemux86 | 22505 | 1009 | | qemuarm64 | 22579 | 935 | | qemuarm | 22486 | 1028 | | qemuriscv64 | 22528 | 986 | +-------------+---------+---------+
Test results difference (1.97.0 - 1.96.0):
+-------------+--------+---------+ | Machine | Passed | Skipped | +-------------+--------+---------+ | qemux86-64 | +316 | +30 | | qemux86 | +315 | +31 | | qemuarm64 | +317 | +29 | | qemuarm | +314 | +32 | | qemuriscv64 | +312 | +34 | +-------------+--------+---------+
Reproducibility: PASSED (x86-64)
---
.../classes-recipe/rust-target-config.bbclass | 5 +
meta/conf/distro/include/tcmode-default.inc | 2 +-
meta/lib/oeqa/selftest/cases/rust.py | 3 +-
.../rust/{cargo_1.96.1.bb => cargo_1.97.1.bb} | 0
...lain-syscalls-as-their-time64-varian.patch | 81 --------------
...xplicit-tail-calls-disable-two-tests.patch | 39 -------
...lls-ignore-tests-on-unsupported-llvm.patch | 96 ----------------
...ild-script-path-leakage-in-artifacts.patch | 28 -----
...ibstd-rs_1.96.1.bb => libstd-rs_1.97.1.bb} | 0
....96.1.bb => rust-cross-canadian_1.97.1.bb} | 0
meta/recipes-devtools/rust/rust-snapshot.inc | 104 +++++++++---------
meta/recipes-devtools/rust/rust-source.inc | 6 +-
...source_1.96.1.bb => rust-source_1.97.1.bb} | 0
.../rust/{rust_1.96.1.bb => rust_1.97.1.bb} | 3 +
14 files changed, 64 insertions(+), 303 deletions(-)
rename meta/recipes-devtools/rust/{cargo_1.96.1.bb => cargo_1.97.1.bb} (100%)
delete mode 100644 meta/recipes-devtools/rust/files/0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch
delete mode 100644 meta/recipes-devtools/rust/files/0003-explicit-tail-calls-disable-two-tests.patch
delete mode 100644 meta/recipes-devtools/rust/files/0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch
delete mode 100644 meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch
rename meta/recipes-devtools/rust/{libstd-rs_1.96.1.bb => libstd-rs_1.97.1.bb} (100%)
rename meta/recipes-devtools/rust/{rust-cross-canadian_1.96.1.bb => rust-cross-canadian_1.97.1.bb} (100%)
rename meta/recipes-devtools/rust/{rust-source_1.96.1.bb => rust-source_1.97.1.bb} (100%)
rename meta/recipes-devtools/rust/{rust_1.96.1.bb => rust_1.97.1.bb} (98%)meta/classes-recipe/rust-target-config.bbclass +5 -0
@@ -454,6 +454,11 @@ def rust_gen_target(d, thing, wd, arch): tspec['has-thread-local'] = True tspec['position-independent-executables'] = True tspec['panic-strategy'] = d.getVar("RUST_PANIC_STRATEGY") + # AArch64 AAPCS64 requires non-leaf frame pointers per + # https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#the-frame-pointer + # This matches the upstream aarch64-unknown-linux-gnu target in rustc. + if arch == "aarch64": + tspec['frame-pointer'] = "non-leaf" if "musl" in tspec['llvm-target']: tspec['crt-static-respected'] = True
meta/conf/distro/include/tcmode-default.inc +1 -1
@@ -12,7 +12,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext" GCCVERSION ?= "16.%" SDKGCCVERSION ?= "${GCCVERSION}" GLIBCVERSION ?= "2.44%" -RUSTVERSION ?= "1.96.1%" +RUSTVERSION ?= "1.97.1%" PREFERRED_VERSION_gcc ?= "${GCCVERSION}" PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
meta/lib/oeqa/selftest/cases/rust.py +2 -1
@@ -82,7 +82,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): 'src/tools/suggest-tests', 'src/tools/tidy', 'tests/assembly-llvm/asm/aarch64-outline-atomics.rs', - 'tests/assembly-llvm/c-variadic-arm.rs', + 'tests/assembly-llvm/c-variadic/arm.rs', 'tests/codegen-llvm/thread-local.rs', 'tests/mir-opt/', 'tests/run-make',
@@ -92,6 +92,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): 'tests/rustdoc-js-std', 'tests/ui/abi/stack-probes-lto.rs', 'tests/ui/abi/stack-probes.rs', + 'tests/ui/codegen/huge-stacks.rs', 'tests/ui/codegen/mismatched-data-layouts.rs', 'tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs', 'tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs',
meta/recipes-devtools/rust/cargo_1.97.1.bb renamed from meta/recipes-devtools/rust/cargo_1.96.1.bb +0 -0
meta/recipes-devtools/rust/files/0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch deleted +0 -81
81 lines not on this page · raw message
meta/recipes-devtools/rust/files/0003-explicit-tail-calls-disable-two-tests.patch deleted +0 -39
@@ -1,39 +0,0 @@ -Backport two commits that disable two failing tests on LoongArch. - -Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/fb9e970c1f9377fa6c093f18aabab76204a18ea4] -Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/250beb317422dad63d9bdefee9d82c55a732ba60] - -Signed-off-by: Deepesh Varatharajan <[email protected]> - -diff --git a/tests/ui/explicit-tail-calls/support/bystack.rs b/tests/ui/explicit-tail-calls/support/bystack.rs -index ad1e082..b0ac29e 100644 ---- a/tests/ui/explicit-tail-calls/support/bystack.rs -+++ b/tests/ui/explicit-tail-calls/support/bystack.rs -@@ -36,9 +36,11 @@ - //@ revisions: loongarch32 - //@[loongarch32] compile-flags: --target loongarch32-unknown-none - //@[loongarch32] needs-llvm-components: loongarch -+//@[loongarch32] ignore-llvm-version: 22 - 23 - //@ revisions: loongarch64 - //@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu - //@[loongarch64] needs-llvm-components: loongarch -+//@[loongarch64] ignore-llvm-version: 22 - 23 - //@ revisions: bpf - //@[bpf] compile-flags: --target bpfeb-unknown-none - //@[bpf] needs-llvm-components: bpf -diff --git a/tests/ui/explicit-tail-calls/support/byval.rs b/tests/ui/explicit-tail-calls/support/byval.rs -index 965c63c..d29d0d8 100644 ---- a/tests/ui/explicit-tail-calls/support/byval.rs -+++ b/tests/ui/explicit-tail-calls/support/byval.rs -@@ -36,9 +36,11 @@ - //@ revisions: loongarch32 - //@[loongarch32] compile-flags: --target loongarch32-unknown-none - //@[loongarch32] needs-llvm-components: loongarch -+//@[loongarch32] ignore-llvm-version: 22 - 23 - //@ revisions: loongarch64 - //@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu - //@[loongarch64] needs-llvm-components: loongarch -+//@[loongarch64] ignore-llvm-version: 22 - 23 - //@ revisions: bpf - //@[bpf] compile-flags: --target bpfeb-unknown-none - //@[bpf] needs-llvm-components: bpf
meta/recipes-devtools/rust/files/0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch deleted +0 -96
96 lines not on this page · raw message
meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch deleted +0 -28
@@ -1,28 +0,0 @@ -Backport a commit that remap OUT_DIR paths to fix build script path leakage in artifacts - -Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/e743a4db62336027dcc1f1a755f4ca35f56b67df] - -Signed-off-by: Deepesh Varatharajan <[email protected]> - -diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs -index f785254..0264667 100644 ---- a/src/bootstrap/src/core/builder/cargo.rs -+++ b/src/bootstrap/src/core/builder/cargo.rs -@@ -1077,6 +1077,8 @@ impl Builder<'_> { - // rustc creates absolute paths (in part bc of the `rust-src` unremap - // and for working directory) so let's remap the build directory as well. - format!("{}={map_to}", self.build.src.display()), -+ // remap OUT_DIR so they don't leak into artifacts. -+ format!("{}={map_to}/out", self.build.out.display()), - ] - .join("\t"); - cargo.env("RUSTC_DEBUGINFO_MAP", map); -@@ -1097,6 +1099,8 @@ impl Builder<'_> { - // rustc creates absolute paths (in part bc of the `rust-src` unremap - // and for working directory) so let's remap the build directory as well. - format!("{}={map_to}", self.build.src.display()), -+ // remap OUT_DIR so they don't leak into artifacts. -+ format!("{}={map_to}/out", self.build.out.display()), - ] - .join("\t"); - cargo.env("RUSTC_DEBUGINFO_MAP", map);
meta/recipes-devtools/rust/libstd-rs_1.97.1.bb renamed from meta/recipes-devtools/rust/libstd-rs_1.96.1.bb +0 -0
meta/recipes-devtools/rust/rust-cross-canadian_1.97.1.bb renamed from meta/recipes-devtools/rust/rust-cross-canadian_1.96.1.bb +0 -0
meta/recipes-devtools/rust/rust-snapshot.inc +52 -52
110 lines not on this page · raw message
meta/recipes-devtools/rust/rust-source.inc +1 -5
@@ -5,13 +5,9 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n file://rust-oe-selftest.patch;patchdir=${RUSTSRC} \ file://repro-issue-fix-with-cc-crate-hashmap.patch;patchdir=${RUSTSRC} \ file://0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch;patchdir=${RUSTSRC} \ - file://0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch;patchdir=${RUSTSRC} \ file://0002-Fix-rust-build-failure-with-unstable-options.patch;patchdir=${RUSTSRC} \ - file://0003-explicit-tail-calls-disable-two-tests.patch;patchdir=${RUSTSRC} \ - file://0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch;patchdir=${RUSTSRC} \ - file://0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch;patchdir=${RUSTSRC} \ " -SRC_URI[rust.sha256sum] = "77a6ff3003a4ad0cb00697b043c879e3e1a15d945b1a1f63818903bfc3fa8b98" +SRC_URI[rust.sha256sum] = "0ed06fdaffd4722a7702e0b4eebfafc897ab8f513e8e1b247cdd7e5c6df6ded2" # Point UNPACKDIR into the work-shared location so rust-source.bb and all # consumers (via S/RUSTSRC) reference a single shared source tree.
meta/recipes-devtools/rust/rust-source_1.97.1.bb renamed from meta/recipes-devtools/rust/rust-source_1.96.1.bb +0 -0
meta/recipes-devtools/rust/rust_1.97.1.bb renamed from meta/recipes-devtools/rust/rust_1.96.1.bb +3 -0
@@ -286,6 +286,7 @@ rust_do_install:append:class-native() { install -d ${D}${libdir}/rustlib/src/rust cp -r ${S}/library ${D}${libdir}/rustlib/src/rust find ${D}${libdir}/rustlib/src/rust/ -name "*.sh" -type f -delete + find ${D}${libdir}/rustlib/src/rust/ -path "*/vendor/*.a" -type f -delete } rust_do_install:class-nativesdk() {
@@ -322,6 +323,7 @@ rust_do_install:class-nativesdk() { install -d ${D}${libdir}/rustlib/src/rust cp -r ${S}/library ${D}${libdir}/rustlib/src/rust find ${D}${libdir}/rustlib/src/rust/ -name "*.sh" -type f -delete + find ${D}${libdir}/rustlib/src/rust/ -path "*/vendor/*.a" -type f -delete }
@@ -346,6 +348,7 @@ rust_do_install:class-target() { install -d ${D}${libdir}/rustlib/src/rust cp -r ${S}/library ${D}${libdir}/rustlib/src/rust find ${D}${libdir}/rustlib/src/rust -name "*.sh" -type f -delete + find ${D}${libdir}/rustlib/src/rust -path "*/vendor/*.a" -type f -delete install -m 0644 ${WORKDIR}/rust-targets/${RUST_HOST_SYS}.json ${D}${libdir}/rustlib/${RUST_HOST_SYS}/${RUST_HOST_SYS}.json
Re: [OE-core] [PATCH 4/7] rust: Upgrade 1.96.1 -> 1.97.1
Quoted 8 lines · Jaipaul Cheernam
From: Deepesh Varatharajan <[email protected]>
1.97.1
Rust 1.97.1 is a point release that fixes a critical miscompilation in an LLVM optimization (rust-lang/rust#159035) that has been silently affecting generated code since at least Rust 1.87.
https://github.com/rust-lang/rust/releases/tag/1.97.1
Quoted 7 lines
1.97.0
Rust Changes:
https://github.com/rust-lang/rust/releases/tag/1.97.0Cargo Changes:
https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-197-2026-07-09
Hi Jaipaul,
You will need to update the rust-source entry in meta/conf/distro/include/maintainers.inc to the correct version.
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 5/7 serf: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 made ASN1_STRING opaque. serf directly accesses nm->d.ia5->data and nm->d.ia5->length which is no longer allowed.
Use ASN1_STRING_get0_data() and ASN1_STRING_length() accessor functions instead. These have been available since OpenSSL 1.1.0 so this is backward compatible.
The fix is already in serf trunk (r1935023) but no new release has been made.
Upstream-Status: Backport [https://svn.apache.org/repos/asf/serf/trunk r1935023]
--- ...penSSL-4.0-use-ASN1_STRING-accessors.patch | 35 +++++++++++++++++++ meta/recipes-support/serf/serf_1.3.10.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jaipaul Cheernam <[email protected]> +Date: Thu, 13 Aug 2026 11:52:00 +0000 +Subject: [PATCH] Fix build with OpenSSL 4.0: use ASN1_STRING accessors + +OpenSSL 4.0 made ASN1_STRING opaque. Direct access to struct members +(->data, ->length) is no longer possible. Use the accessor functions +ASN1_STRING_get0_data() and ASN1_STRING_length() instead. + +These accessors have been available since OpenSSL 1.1.0, so this change +is backward compatible. + +Upstream-Status: Backport [https://svn.apache.org/repos/asf/serf/trunk r1935023] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + buckets/ssl_buckets.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/buckets/ssl_buckets.c ++++ b/buckets/ssl_buckets.c +@@ -567,11 +567,11 @@ + switch (nm->type) { + case GEN_DNS: + if (copy_action == ErrorOnNul && +- strlen(nm->d.ia5->data) != nm->d.ia5->length) ++ strlen((const char *)ASN1_STRING_get0_data(nm->d.ia5)) != (size_t)ASN1_STRING_length(nm->d.ia5)) + return SERF_ERROR_SSL_CERT_FAILED; + if (san_arr && *san_arr) +- p = pstrdup_escape_nul_bytes((const char *)nm->d.ia5->data, +- nm->d.ia5->length, ++ p = pstrdup_escape_nul_bytes((const char *)ASN1_STRING_get0_data(nm->d.ia5), ++ ASN1_STRING_length(nm->d.ia5), + pool); + break; + default:
meta/recipes-support/serf/serf_1.3.10.bb +1 -0
@@ -10,6 +10,7 @@ SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ file://0002-SConstruct-Fix-path-quoting-for-.def-generator.patch \ file://0003-gen_def.patch \ file://SConstruct.stop.creating.directories.without.sandbox-install.prefix.patch \ + file://0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch \ " SRC_URI[sha256sum] = "be81ef08baa2516ecda76a77adf7def7bc3227eeb578b9a33b45f7b41dc064e6"
PATCH 6/7 u-boot-tools: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 removed the ENGINE API entirely. u-boot-tools uses ENGINE_get_id, ENGINE_load_public_key, ENGINE_finish, ENGINE_free in lib/rsa/rsa-sign.c which causes link failures.
Backport the Provider API support patch from upstream u-boot which adds OpenSSL Provider support while maintaining backward compatibility with older OpenSSL versions that still have ENGINE.
Upstream-Status: Backport [https://github.com/u-boot/u-boot/pull/918]
--- ...Add-support-for-OpenSSL-Provider-API.patch | 300 ++++++++++++++++++ .../u-boot/u-boot-tools_2026.07.bb | 4 +- 2 files changed, 303 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch
meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch new file +300 -0
@@ -0,0 +1,300 @@ +From a81cb0932dce109af44d7245d47489fe54ae390f Mon Sep 17 00:00:00 2001 +From: Eddie Kovsky <[email protected]> +Date: Mon, 23 Feb 2026 09:43:22 -0700 +Subject: [PATCH] Add support for OpenSSL Provider API + +The Engine API has been deprecated since the release of OpenSSL 3.0. End +users have been advised to migrate to the new Provider interface. +Several distributions have already removed support for engines, which is +preventing U-Boot from being compiled in those environments. + +Add support for the Provider API while continuing to support the existing +Engine API on distros shipping older releases of OpenSSL. + +This is based on similar work contributed by Jan Stancek updating Linux +to use the Provider interface. + + commit 558bdc45dfb2669e1741384a0c80be9c82fa052c + Author: Jan Stancek <[email protected]> + Date: Fri Sep 20 19:52:48 2024 +0300 + + sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 + +The changes have been tested with the FIT signature verification vboot +tests on Fedora 42 and Debian 13. All 30 tests pass with both the legacy +Engine library installed and with the Provider API. + +Signed-off-by: Eddie Kovsky <[email protected]> + +Upstream-Status: Backport [https://github.com/u-boot/u-boot/pull/918] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + lib/aes/aes-encrypt.c | 4 +- + lib/rsa/rsa-sign.c | 102 +++++++++++++++++++++++++++++++++++++++--- + 2 files changed, 100 insertions(+), 6 deletions(-) + +diff --git a/lib/aes/aes-encrypt.c b/lib/aes/aes-encrypt.c +index 90e1407b4f09..4fc4ce232478 100644 +--- a/lib/aes/aes-encrypt.c ++++ b/lib/aes/aes-encrypt.c +@@ -16,7 +16,9 @@ + #include <openssl/err.h> + #include <openssl/ssl.h> + #include <openssl/evp.h> +-#include <openssl/engine.h> ++#if !defined(OPENSSL_NO_ENGINE) && !defined(OPENSSL_NO_DEPRECATED_3_0) ++# include <openssl/engine.h> ++#endif + #include <uboot_aes.h> + + #if OPENSSL_VERSION_NUMBER >= 0x10000000L +diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c +index 0e38c9e802fd..f456f3c58e65 100644 +--- a/lib/rsa/rsa-sign.c ++++ b/lib/rsa/rsa-sign.c +@@ -19,7 +19,47 @@ + #include <openssl/err.h> + #include <openssl/ssl.h> + #include <openssl/evp.h> +-#include <openssl/engine.h> ++#if OPENSSL_VERSION_MAJOR >= 3 ++# define USE_PKCS11_PROVIDER ++# include <err.h> ++# include <openssl/provider.h> ++# include <openssl/store.h> ++#else ++# if !defined(OPENSSL_NO_ENGINE) && !defined(OPENSSL_NO_DEPRECATED_3_0) ++# define USE_PKCS11_ENGINE ++# include <openssl/engine.h> ++# endif ++#endif ++ ++#ifdef USE_PKCS11_PROVIDER ++#define ERR(cond, fmt, ...) \ ++ do { \ ++ bool __cond = (cond); \ ++ drain_openssl_errors(__LINE__, 0); \ ++ if (__cond) { \ ++ errx(1, fmt, ## __VA_ARGS__); \ ++ } \ ++ } while (0) ++ ++static void drain_openssl_errors(int l, int silent) ++{ ++ const char *file; ++ char buf[120]; ++ int e, line; ++ ++ if (ERR_peek_error() == 0) ++ return; ++ if (!silent) ++ fprintf(stderr, "At main.c:%d:\n", l); ++ ++ while ((e = ERR_peek_error_line(&file, &line))) { ++ ERR_error_string(e, buf); ++ if (!silent) ++ fprintf(stderr, "- SSL %s: %s:%d\n", buf, file, line); ++ ERR_get_error(); ++ } ++} ++#endif + + static int rsa_err(const char *msg) + { +@@ -94,10 +134,11 @@ static int rsa_pem_get_pub_key(const char *keydir, const char *name, EVP_PKEY ** + * + * @keydir: Key prefix + * @name Name of key +- * @engine Engine to use ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_get_pub_key(const char *keydir, const char *name, + ENGINE *engine, EVP_PKEY **evpp) + { +@@ -157,21 +198,24 @@ static int rsa_engine_get_pub_key(const char *keydir, const char *name, + + return 0; + } ++#endif + + /** + * rsa_get_pub_key() - read a public key + * + * @keydir: Directory containing the key (PEM file) or key prefix (engine) + * @name Name of key file (will have a .crt extension) +- * @engine Engine to use ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ + static int rsa_get_pub_key(const char *keydir, const char *name, + ENGINE *engine, EVP_PKEY **evpp) + { ++#ifdef USE_PKCS11_ENGINE + if (engine) + return rsa_engine_get_pub_key(keydir, name, engine, evpp); ++#endif + return rsa_pem_get_pub_key(keydir, name, evpp); + } + +@@ -207,13 +251,44 @@ static int rsa_pem_get_priv_key(const char *keydir, const char *name, + return -ENOENT; + } + ++#ifdef USE_PKCS11_PROVIDER ++ EVP_PKEY *private_key = NULL; ++ OSSL_STORE_CTX *store; ++ ++ if (!OSSL_PROVIDER_try_load(NULL, "pkcs11", true)) ++ ERR(1, "OSSL_PROVIDER_try_load(pkcs11)"); ++ if (!OSSL_PROVIDER_try_load(NULL, "default", true)) ++ ERR(1, "OSSL_PROVIDER_try_load(default)"); ++ ++ store = OSSL_STORE_open(path, NULL, NULL, NULL, NULL); ++ ERR(!store, "OSSL_STORE_open"); ++ ++ while (!OSSL_STORE_eof(store)) { ++ OSSL_STORE_INFO *info = OSSL_STORE_load(store); ++ ++ if (!info) { ++ drain_openssl_errors(__LINE__, 0); ++ continue; ++ } ++ if (OSSL_STORE_INFO_get_type(info) == OSSL_STORE_INFO_PKEY) { ++ private_key = OSSL_STORE_INFO_get1_PKEY(info); ++ ERR(!private_key, "OSSL_STORE_INFO_get1_PKEY"); ++ } ++ OSSL_STORE_INFO_free(info); ++ if (private_key) ++ break; ++ } ++ OSSL_STORE_close(store); ++ ++ *evpp = private_key; ++#else + if (!PEM_read_PrivateKey(f, evpp, NULL, path)) { + rsa_err("Failure reading private key"); + fclose(f); + return -EPROTO; + } + fclose(f); +- ++#endif + return 0; + } + +@@ -226,6 +301,7 @@ static int rsa_pem_get_priv_key(const char *keydir, const char *name, + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_get_priv_key(const char *keydir, const char *name, + const char *keyfile, + ENGINE *engine, EVP_PKEY **evpp) +@@ -293,22 +369,25 @@ static int rsa_engine_get_priv_key(const char *keydir, const char *name, + + return 0; + } ++#endif + + /** + * rsa_get_priv_key() - read a private key + * + * @keydir: Directory containing the key (PEM file) or key prefix (engine) + * @name Name of key +- * @engine Engine to use for signing ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ + static int rsa_get_priv_key(const char *keydir, const char *name, + const char *keyfile, ENGINE *engine, EVP_PKEY **evpp) + { ++#ifdef USE_PKCS11_ENGINE + if (engine) + return rsa_engine_get_priv_key(keydir, name, keyfile, engine, + evpp); ++#endif + return rsa_pem_get_priv_key(keydir, name, keyfile, evpp); + } + +@@ -325,6 +404,7 @@ static int rsa_init(void) + return 0; + } + ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_init(const char *engine_id, ENGINE **pe) + { + const char *key_pass; +@@ -380,6 +460,7 @@ static void rsa_engine_remove(ENGINE *e) + ENGINE_free(e); + } + } ++#endif + + static int rsa_sign_with_key(EVP_PKEY *pkey, struct padding_algo *padding_algo, + struct checksum_algo *checksum_algo, +@@ -480,11 +561,13 @@ int rsa_sign(struct image_sign_info *info, + if (ret) + return ret; + ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) { + ret = rsa_engine_init(info->engine_id, &e); + if (ret) + return ret; + } ++#endif + + ret = rsa_get_priv_key(info->keydir, info->keyname, info->keyfile, + e, &pkey); +@@ -496,16 +579,21 @@ int rsa_sign(struct image_sign_info *info, + goto err_sign; + + EVP_PKEY_free(pkey); ++ ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + + return ret; + + err_sign: + EVP_PKEY_free(pkey); + err_priv: ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + return ret; + } + +@@ -645,11 +733,13 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest) + ENGINE *e = NULL; + + debug("%s: Getting verification data\n", __func__); ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) { + ret = rsa_engine_init(info->engine_id, &e); + if (ret) + return ret; + } ++#endif + ret = rsa_get_pub_key(info->keydir, info->keyname, e, &pkey); + if (ret) + goto err_get_pub_key; +@@ -726,8 +816,10 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest) + err_get_params: + EVP_PKEY_free(pkey); + err_get_pub_key: ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + + if (ret) + return ret;
meta/recipes-bsp/u-boot/u-boot-tools_2026.07.bb +3 -1
@@ -1,4 +1,6 @@ require u-boot-common.inc require u-boot-tools.inc -SRC_URI += "file://0001-tools-mkeficapsule-Detect-GnuTLS-PKCS-11-support.patch" +SRC_URI += "file://0001-tools-mkeficapsule-Detect-GnuTLS-PKCS-11-support.patch \ + file://0001-Add-support-for-OpenSSL-Provider-API.patch \ + "
Re: [OE-core] [PATCH 6/7] u-boot-tools: fix build with OpenSSL 4.0
Quoted 1 line · Jaipaul Cheernam via lists.openembedded.org
+Upstream-Status: Backport [https://github.com/u-boot/u-boot/pull/918]
The pull request is still open and nothing has landed in master, so this is Submitted, not a Backport.
Alex
Re: [OE-core] [PATCH 6/7] u-boot-tools: fix build with OpenSSL 4.0
Quoted 8 lines · Alexander Kanavin via lists.openembedded.org
Quoted 1 line · Jaipaul Cheernam via lists.openembedded.org
+Upstream-Status: Backport [https://github.com/u-boot/u-boot/pull/918]
The pull request is still open and nothing has landed in master, so this is Submitted, not a Backport.
U-Boot also doesn't do pull requests so this likely will either never be marked as merged, or will be closed. We (ab)use the pull request mechanism in GitHub so that contributors can trigger at least *some* CI (which differs from the one in U-Boot's GitLab, but some CI better than no CI), but we don't monitor anything there.
The patch comes from https://lore.kernel.org/u-boot/[email protected]/ which is where you should monitor the status of the patch (and look for new versions).
Cheers,
Quentin
Re: [OE-core] [PATCH 6/7] u-boot-tools: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamQuoted 11 lines · Jaipaul Cheernam
OpenSSL 4.0 removed the ENGINE API entirely. u-boot-tools uses
ENGINE_get_id,ENGINE_load_public_key,ENGINE_finish,ENGINE_freeinlib/rsa/rsa-sign.cwhich causes link failures.Backport the Provider API support patch from upstream u-boot which adds OpenSSL Provider support while maintaining backward compatibility with older OpenSSL versions that still have ENGINE.
Upstream-Status: Backport [https://github.com/u-boot/u-boot/pull/918]
Signed-off-by Jaipaul Cheernam <[email protected]>---
Hi Jaipaul,
I know this is just an RFC, but I tried a build on the autobuilder: it looks like more changes are needed to fix u-boot builds. Maybe only for riscv64 platforms:
ERROR: u-boot-1_2026.07-r0 do_compile: Execution of '/srv/pokybuild/yocto-worker/qemuriscv64/build/build/tmp/work/qemuriscv64-poky-linux/u-boot/2026.07/temp/run.do_compile.3905853' failed with exit code 1
...
| rsa-sign.c:(.text+0xb): undefined reference to `ENGINE_load_builtin_engines' | /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: rsa-sign.c:(.text+0x13): undefined reference to `ENGINE_by_id' | /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: rsa-sign.c:(.text+0x27): undefined reference to `ENGINE_init' | /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: rsa-sign.c:(.text+0x33): undefined reference to `ENGINE_set_default_RSA' | /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: rsa-sign.c:(.text+0x58): undefined reference to `ENGINE_ctrl_cmd_string' | /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: rsa-sign.c:(.text+0x8f): undefined reference to `ENGINE_free' | /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: rsa-sign.c:(.text+0xbf): undefined reference to `ENGINE_finish' | /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: tools/generated/lib/rsa/rsa-sign.o: in function `rsa_engine_get_priv_key': | rsa-sign.c:(.text+0x274): undefined reference to `ENGINE_get_id'
...
| collect2: error: ld returned 1 exit status
...
https://autobuilder.yoctoproject.org/valkyrie/#/builders/45/builds/2124
https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/2173
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 7/7 kea: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 added const qualifiers to X509_get_subject_name() and X509_get_issuer_name() return types. kea assigns these to non-const pointers causing compilation errors with -fpermissive.
Add const qualifiers to X509_NAME and X509_NAME_ENTRY pointer declarations in openssl_tls.h.
Tracked upstream: https://gitlab.isc.org/isc-projects/kea/-/issues/4673
(milestone: kea3.3.2, labeled: backport-candidate)
Upstream-Status: Backport [https://gitlab.isc.org/isc-projects/kea/-/issues/4673]
--- ...-qualifiers-to-OpenSSL-X509-pointers.patch | 49 +++++++++++++++++++ meta/recipes-connectivity/kea/kea_3.2.0.bb | 1 + 2 files changed, 50 insertions(+) create mode 100644 meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch
meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch new file +49 -0
@@ -0,0 +1,49 @@ +From 82d28b1be73bbc00e73e59d0c59c51a1e76519a5 Mon Sep 17 00:00:00 2001 +From: Simo Sorce <[email protected]> +Date: Mon, 27 Apr 2026 17:49:56 -0400 +Subject: [PATCH] Add const qualifiers to OpenSSL X509 pointers + +Added const qualifiers to the X509_NAME and X509_NAME_ENTRY pointers when +retrieving subject and issuer names from TLS certificates. This ensures const- +correctness and maintains compatibility with newer OpenSSL versions, which +return const pointers from these getter functions. + +Signed-off-by: Simo Sorce <[email protected]> + +Upstream-Status: Backport [https://gitlab.isc.org/isc-projects/kea/-/issues/4673] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + src/lib/asiolink/openssl_tls.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/lib/asiolink/openssl_tls.h b/src/lib/asiolink/openssl_tls.h +index 57c3323..52a969b 100644 +--- a/src/lib/asiolink/openssl_tls.h ++++ b/src/lib/asiolink/openssl_tls.h +@@ -175,9 +175,9 @@ public: + if (!cert) { + return (""); + } +- ::X509_NAME *name = ::X509_get_subject_name(cert); ++ const ::X509_NAME *name = ::X509_get_subject_name(cert); + int loc = ::X509_NAME_get_index_by_NID(name, NID_commonName, -1); +- ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); ++ const ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); + if (!ne) { + ::X509_free(cert); + return (""); +@@ -209,9 +209,9 @@ public: + if (!cert) { + return (""); + } +- ::X509_NAME *name = ::X509_get_issuer_name(cert); ++ const ::X509_NAME *name = ::X509_get_issuer_name(cert); + int loc = ::X509_NAME_get_index_by_NID(name, NID_commonName, -1); +- ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); ++ const ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); + if (!ne) { + ::X509_free(cert); + return (""); +-- +2.53.0 +
meta/recipes-connectivity/kea/kea_3.2.0.bb +1 -0
@@ -19,6 +19,7 @@ SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.xz \ file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \ file://0001-meson-use-a-runtime-safe-interpreter-string.patch \ file://0001-mk_cfgrpt.sh-strip-prefixes.patch \ + file://0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch \ " SRC_URI[sha256sum] = "14bf695d37b65b9b1bf550fea5d0adaf9806c50e5419ef2a176a4b8e9aade3df"
Re: [OE-core] [PATCH 7/7] kea: fix build with OpenSSL 4.0
Quoted 1 line · Jaipaul Cheernam via lists.openembedded.org
+Upstream-Status: Backport [https://gitlab.isc.org/isc-projects/kea/-/issues/4673]
Same: ticket with a patch is not a backport.
Alex
v2 cover openssl: upgrade to 4.0.1 and fix dependent recipes
In reply to Jaipaul CheernamThis series upgrades OpenSSL from 3.5.7 to 4.0.1 and fixes all dependent recipes that break due to API changes in OpenSSL 4.0.
Changes since v1:
- u-boot: moved patch from u-boot-tools_2026.07.bb to u-boot-common.inc so it applies to both u-boot and u-boot-tools (fixes riscv64 build failure reported from autobuilder)
- u-boot, kea: corrected Upstream-Status from Backport to Submitted (neither has been merged upstream yet)
- Dropped rust 1.97.1 from this series (now merged in master)
- No external dependencies — wpa-supplicant 2.12 and rust 1.97.1 are both merged in master now
OpenSSL 4.0 is a major release with several breaking changes:
- ENGINE API fully removed
- SSLv3 support removed
- Per-version TLS method functions (SSLv3_method etc.) removed
- ASN1_STRING made opaque
- const qualifiers added to X509 getter functions
Patches:
1/6 openssl: upgrade 3.5.7 -> 4.0.1
2/6 python3: backport OpenSSL 4.0 support (CPython commit 3364e7e62fa2) 3/6 socat: fix ASN1_STRING opaque struct access
4/6 serf: fix ASN1_STRING opaque struct access
5/6 u-boot: backport Provider API (replaces removed ENGINE API) 6/6 kea: add const qualifiers to X509 pointers
Testing:
- bitbake world -k: passes on qemux86-64, qemuarm64, qemuarm, qemuriscv64
- openssl ptest on qemux86-64: 362 files, 4310 tests, all passed (338 passed, 24 skipped - fips/lms/rc5/tfo/compression - all expected)
Sharing this to get feedback and see if there are other recipes that break with OpenSSL 4.0 that we may have missed.
Notes on upstream status:
- python3: fix on CPython main, backport PR #146403 closed without merge
- socat: submitted to [email protected]
- serf: fix in trunk (r1935023), no release yet
- u-boot: PR #918 open since March 2026, under review
- kea: tracked as issue #4673, milestone kea3.3.2
Jaipaul Cheernam (6):
openssl: upgrade 3.5.7 -> 4.0.1
python3: backport OpenSSL 4.0 support from upstream
socat: fix build with OpenSSL 4.0
serf: fix build with OpenSSL 4.0
u-boot: fix build with OpenSSL 4.0
kea: fix build with OpenSSL 4.0
...Add-support-for-OpenSSL-Provider-API.patch | 300 ++++++++++++++
meta/recipes-bsp/u-boot/u-boot-common.inc | 1 +
...-qualifiers-to-OpenSSL-X509-pointers.patch | 49 +++
meta/recipes-connectivity/kea/kea_3.2.0.bb | 1 +
...ke-history-reporting-when-test-fails.patch | 366 ------------------
...1-Configure-do-not-tweak-mips-cflags.patch | 6 +-
...sysroot-and-debug-prefix-map-from-co.patch | 11 +-
.../0001-extend-check_cwm-test-timeout.patch | 4 +-
.../{openssl_3.5.7.bb => openssl_4.0.1.bb} | 23 +-
...penSSL-4.0-use-ASN1_STRING-accessors.patch | 31 ++
.../socat/socat_1.8.1.3.bb | 1 +
...146207-Add-support-for-OpenSSL-4.0.0.patch | 257 ++++++++++++
.../recipes-devtools/python/python3_3.14.7.bb | 1 +
...penSSL-4.0-use-ASN1_STRING-accessors.patch | 35 ++
meta/recipes-support/serf/serf_1.3.10.bb | 1 +
15 files changed, 693 insertions(+), 394 deletions(-)
create mode 100644 meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch
create mode 100644 meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch
delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch
rename meta/recipes-connectivity/openssl/{openssl_3.5.7.bb => openssl_4.0.1.bb} (88%)
create mode 100644 meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
create mode 100644 meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch
create mode 100644 meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patchRFC v2 1/6 openssl: upgrade 3.5.7 -> 4.0.1
Upgrade OpenSSL from 3.5.7 to 4.0.1. This is a major version upgrade.
Changelog: https://github.com/openssl/openssl/blob/openssl-4.0.1/CHANGES.md
New CVE fixes not already in 3.5.7:
* CVE-2026-28386: Fixed OOB read in AES-CFB-128 on x86-64 with AVX-512
* CVE-2026-35188: Fixed double-free when checking OCSP stapled response
* CVE-2026-42765: Fixed NULL deref in cert verification with OCSP
* CVE-2026-42771: Fixed OOB read in X509_VERIFY_PARAM_set1_email()
Major breaking changes in 4.0.0:
* Removed support for engines. The ENGINE API is fully removed.
* Removed support for SSLv3. SSLv3 has been deprecated since 2015.
* Removed support for the SSLv2 Client Hello.
* Removed per-version TLS method functions (SSLv3_method(),
TLSv1_method(), TLSv1_1_method(), TLSv1_2_method()).
* Removed c_rehash script tool. Use 'openssl rehash' instead.
* ASN1_STRING has been made opaque.
* Numerous API function signatures changed to include const qualifiers.
* libcrypto no longer cleans up globally allocated data via atexit().
* Added AKID verification checks when X509_V_FLAG_X509_STRICT is set.
* Support of deprecated elliptic curves in TLS disabled at compile-time by default.
Recipe changes:
* Drop 0001-Added-handshake-history-reporting-when-test-fails.patch
(merged upstream via PR #22481).
* Refresh remaining patches against the new version.
* Remove ENGINE API artifacts: engines package, dasync.so/ossltest.so ptest installation, ENGINESDIR references, OPENSSL_ENGINES wrapper variable, and cryptodev-linux PACKAGECONFIG.
Tested: ptest on qemux86-64:
Files=362, Tests=4310, Result: PASS
Passed: 338, Skipped: 24 (fips, lms, rc5, tfo, compression, sslversions, sslkeylogfile, external tests - all expected)
Failed: 0
---
...ke-history-reporting-when-test-fails.patch | 366 ------------------
...1-Configure-do-not-tweak-mips-cflags.patch | 6 +-
...sysroot-and-debug-prefix-map-from-co.patch | 11 +-
.../0001-extend-check_cwm-test-timeout.patch | 4 +-
.../{openssl_3.5.7.bb => openssl_4.0.1.bb} | 23 +-
5 files changed, 16 insertions(+), 394 deletions(-)
delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch
rename meta/recipes-connectivity/openssl/{openssl_3.5.7.bb => openssl_4.0.1.bb} (88%)meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0 -366
@@ -1,366 +0,0 @@ -From 5ba65051fea0513db0d997f0ab7cafb9826ed74a Mon Sep 17 00:00:00 2001 -From: William Lyu <[email protected]> -Date: Fri, 20 Oct 2023 16:22:37 -0400 -Subject: [PATCH] Added handshake history reporting when test fails - -Upstream-Status: Submitted [https://github.com/openssl/openssl/pull/22481] - -Signed-off-by: William Lyu <[email protected]> ---- - test/helpers/handshake.c | 136 ++++++++++++++++++++++++++++++--------- - test/helpers/handshake.h | 70 +++++++++++++++++++- - test/ssl_test.c | 44 +++++++++++++ - 3 files changed, 217 insertions(+), 33 deletions(-) - -diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c -index f611b3a..5703b48 100644 ---- a/test/helpers/handshake.c -+++ b/test/helpers/handshake.c -@@ -25,6 +25,102 @@ - #include <netinet/sctp.h> - #endif - -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+/* Maps string names to various enumeration type */ -+typedef struct { -+ const char *name; -+ int value; -+} enum_name_map; -+ -+static const enum_name_map connect_phase_names[] = { -+ {"Handshake", HANDSHAKE}, -+ {"RenegAppData", RENEG_APPLICATION_DATA}, -+ {"RenegSetup", RENEG_SETUP}, -+ {"RenegHandshake", RENEG_HANDSHAKE}, -+ {"AppData", APPLICATION_DATA}, -+ {"Shutdown", SHUTDOWN}, -+ {"ConnectionDone", CONNECTION_DONE} -+}; -+ -+static const enum_name_map peer_status_names[] = { -+ {"PeerSuccess", PEER_SUCCESS}, -+ {"PeerRetry", PEER_RETRY}, -+ {"PeerError", PEER_ERROR}, -+ {"PeerWaiting", PEER_WAITING}, -+ {"PeerTestFail", PEER_TEST_FAILURE} -+}; -+ -+static const enum_name_map handshake_status_names[] = { -+ {"HandshakeSuccess", HANDSHAKE_SUCCESS}, -+ {"ClientError", CLIENT_ERROR}, -+ {"ServerError", SERVER_ERROR}, -+ {"InternalError", INTERNAL_ERROR}, -+ {"HandshakeRetry", HANDSHAKE_RETRY} -+}; -+ -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+static const char *enum_name(const enum_name_map *enums, size_t num_enums, -+ int value) -+{ -+ size_t i; -+ for (i = 0; i < num_enums; i++) { -+ if (enums[i].value == value) { -+ return enums[i].name; -+ } -+ } -+ return "InvalidValue"; -+} -+ -+const char *handshake_connect_phase_name(connect_phase_t phase) -+{ -+ return enum_name(connect_phase_names, OSSL_NELEM(connect_phase_names), -+ (int)phase); -+} -+ -+const char *handshake_status_name(handshake_status_t handshake_status) -+{ -+ return enum_name(handshake_status_names, OSSL_NELEM(handshake_status_names), -+ (int)handshake_status); -+} -+ -+const char *handshake_peer_status_name(peer_status_t peer_status) -+{ -+ return enum_name(peer_status_names, OSSL_NELEM(peer_status_names), -+ (int)peer_status); -+} -+ -+static void save_loop_history(HANDSHAKE_HISTORY *history, -+ connect_phase_t phase, -+ handshake_status_t handshake_status, -+ peer_status_t server_status, -+ peer_status_t client_status, -+ int client_turn_count, -+ int is_client_turn) -+{ -+ HANDSHAKE_HISTORY_ENTRY *new_entry = NULL; -+ -+ /* -+ * Create a new history entry for a handshake loop with statuses given in -+ * the arguments. Potentially evicting the oldest entry when the -+ * ring buffer is full. -+ */ -+ ++(history->last_idx); -+ history->last_idx &= MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ -+ new_entry = &((history->entries)[history->last_idx]); -+ new_entry->phase = phase; -+ new_entry->handshake_status = handshake_status; -+ new_entry->server_status = server_status; -+ new_entry->client_status = client_status; -+ new_entry->client_turn_count = client_turn_count; -+ new_entry->is_client_turn = is_client_turn; -+ -+ /* Evict the oldest handshake loop entry when the ring buffer is full. */ -+ if (history->entry_count < MAX_HANDSHAKE_HISTORY_ENTRY) { -+ ++(history->entry_count); -+ } -+} -+ - HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void) - { - HANDSHAKE_RESULT *ret; -@@ -724,15 +820,6 @@ static void configure_handshake_ssl(SSL *server, SSL *client, - SSL_set_post_handshake_auth(client, 1); - } - --/* The status for each connection phase. */ --typedef enum { -- PEER_SUCCESS, -- PEER_RETRY, -- PEER_ERROR, -- PEER_WAITING, -- PEER_TEST_FAILURE --} peer_status_t; -- - /* An SSL object and associated read-write buffers. */ - typedef struct peer_st { - SSL *ssl; -@@ -1077,16 +1164,6 @@ static void do_shutdown_step(PEER *peer) - } - } - --typedef enum { -- HANDSHAKE, -- RENEG_APPLICATION_DATA, -- RENEG_SETUP, -- RENEG_HANDSHAKE, -- APPLICATION_DATA, -- SHUTDOWN, -- CONNECTION_DONE --} connect_phase_t; -- - static int renegotiate_op(const SSL_TEST_CTX *test_ctx) - { - switch (test_ctx->handshake_mode) { -@@ -1164,19 +1241,6 @@ static void do_connect_step(const SSL_TEST_CTX *test_ctx, PEER *peer, - } - } - --typedef enum { -- /* Both parties succeeded. */ -- HANDSHAKE_SUCCESS, -- /* Client errored. */ -- CLIENT_ERROR, -- /* Server errored. */ -- SERVER_ERROR, -- /* Peers are in inconsistent state. */ -- INTERNAL_ERROR, -- /* One or both peers not done. */ -- HANDSHAKE_RETRY --} handshake_status_t; -- - /* - * Determine the handshake outcome. - * last_status: the status of the peer to have acted last. -@@ -1541,6 +1605,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( - - start = time(NULL); - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - /* - * Half-duplex handshake loop. - * Client and server speak to each other synchronously in the same process. -@@ -1562,6 +1630,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( - 0 /* server went last */); - } - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - switch (status) { - case HANDSHAKE_SUCCESS: - client_turn_count = 0; -diff --git a/test/helpers/handshake.h b/test/helpers/handshake.h -index 78b03f9..b9967c2 100644 ---- a/test/helpers/handshake.h -+++ b/test/helpers/handshake.h -@@ -1,5 +1,5 @@ - /* -- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. -+ * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy -@@ -12,6 +12,11 @@ - - #include "ssl_test_ctx.h" - -+#define MAX_HANDSHAKE_HISTORY_ENTRY_BIT 4 -+#define MAX_HANDSHAKE_HISTORY_ENTRY (1 << MAX_HANDSHAKE_HISTORY_ENTRY_BIT) -+#define MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK \ -+ ((1 << MAX_HANDSHAKE_HISTORY_ENTRY_BIT) - 1) -+ - typedef struct ctx_data_st { - unsigned char *npn_protocols; - size_t npn_protocols_len; -@@ -22,6 +27,63 @@ typedef struct ctx_data_st { - char *session_ticket_app_data; - } CTX_DATA; - -+typedef enum { -+ HANDSHAKE, -+ RENEG_APPLICATION_DATA, -+ RENEG_SETUP, -+ RENEG_HANDSHAKE, -+ APPLICATION_DATA, -+ SHUTDOWN, -+ CONNECTION_DONE -+} connect_phase_t; -+ -+/* The status for each connection phase. */ -+typedef enum { -+ PEER_SUCCESS, -+ PEER_RETRY, -+ PEER_ERROR, -+ PEER_WAITING, -+ PEER_TEST_FAILURE -+} peer_status_t; -+ -+typedef enum { -+ /* Both parties succeeded. */ -+ HANDSHAKE_SUCCESS, -+ /* Client errored. */ -+ CLIENT_ERROR, -+ /* Server errored. */ -+ SERVER_ERROR, -+ /* Peers are in inconsistent state. */ -+ INTERNAL_ERROR, -+ /* One or both peers not done. */ -+ HANDSHAKE_RETRY -+} handshake_status_t; -+ -+/* Stores the various status information in a handshake loop. */ -+typedef struct handshake_history_entry_st { -+ connect_phase_t phase; -+ handshake_status_t handshake_status; -+ peer_status_t server_status; -+ peer_status_t client_status; -+ int client_turn_count; -+ int is_client_turn; -+} HANDSHAKE_HISTORY_ENTRY; -+ -+typedef struct handshake_history_st { -+ /* Implemented using ring buffer. */ -+ /* -+ * The valid entries are |entries[last_idx]|, |entries[last_idx-1]|, -+ * ..., etc., going up to |entry_count| number of entries. Note that when -+ * the index into the array |entries| becomes < 0, we wrap around to -+ * the end of |entries|. -+ */ -+ HANDSHAKE_HISTORY_ENTRY entries[MAX_HANDSHAKE_HISTORY_ENTRY]; -+ /* The number of valid entries in |entries| array. */ -+ size_t entry_count; -+ /* The index of the last valid entry in the |entries| array. */ -+ size_t last_idx; -+} HANDSHAKE_HISTORY; -+ - typedef struct handshake_result { - ssl_test_result_t result; - /* These alerts are in the 2-byte format returned by the info_callback. */ -@@ -77,6 +139,8 @@ typedef struct handshake_result { - char *cipher; - /* session ticket application data */ - char *result_session_ticket_app_data; -+ /* handshake loop history */ -+ HANDSHAKE_HISTORY history; - } HANDSHAKE_RESULT; - - HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void); -@@ -95,4 +159,8 @@ int configure_handshake_ctx_for_srp(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, - CTX_DATA *server2_ctx_data, - CTX_DATA *client_ctx_data); - -+const char *handshake_connect_phase_name(connect_phase_t phase); -+const char *handshake_status_name(handshake_status_t handshake_status); -+const char *handshake_peer_status_name(peer_status_t peer_status); -+ - #endif /* OSSL_TEST_HANDSHAKE_HELPER_H */ -diff --git a/test/ssl_test.c b/test/ssl_test.c -index ea60851..9d6b093 100644 ---- a/test/ssl_test.c -+++ b/test/ssl_test.c -@@ -26,6 +26,44 @@ static OSSL_LIB_CTX *libctx = NULL; - /* Currently the section names are of the form test-<number>, e.g. test-15. */ - #define MAX_TESTCASE_NAME_LENGTH 100 - -+static void print_handshake_history(const HANDSHAKE_HISTORY *history) -+{ -+ size_t first_idx; -+ size_t i; -+ size_t cur_idx; -+ const HANDSHAKE_HISTORY_ENTRY *cur_entry; -+ const char header_template[] = "|%14s|%16s|%16s|%16s|%17s|%14s|"; -+ const char body_template[] = "|%14s|%16s|%16s|%16s|%17d|%14s|"; -+ -+ TEST_info("The following is the server/client state " -+ "in the most recent %d handshake loops.", -+ MAX_HANDSHAKE_HISTORY_ENTRY); -+ -+ TEST_note("==================================================" -+ "=================================================="); -+ TEST_note(header_template, -+ "phase", "handshake status", "server status", -+ "client status", "client turn count", "is client turn"); -+ TEST_note("+--------------+----------------+----------------" -+ "+----------------+-----------------+--------------+"); -+ -+ first_idx = (history->last_idx - history->entry_count + 1) & -+ MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ for (i = 0; i < history->entry_count; ++i) { -+ cur_idx = (first_idx + i) & MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ cur_entry = &(history->entries)[cur_idx]; -+ TEST_note(body_template, -+ handshake_connect_phase_name(cur_entry->phase), -+ handshake_status_name(cur_entry->handshake_status), -+ handshake_peer_status_name(cur_entry->server_status), -+ handshake_peer_status_name(cur_entry->client_status), -+ cur_entry->client_turn_count, -+ cur_entry->is_client_turn ? "true" : "false"); -+ } -+ TEST_note("==================================================" -+ "=================================================="); -+} -+ - static const char *print_alert(int alert) - { - return alert ? SSL_alert_desc_string_long(alert) : "no alert"; -@@ -388,6 +426,12 @@ static int check_test(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) - ret &= check_client_sign_type(result, test_ctx); - ret &= check_client_ca_names(result, test_ctx); - } -+ -+ /* Print handshake loop history if any check fails. */ -+ if (!ret) { -+ print_handshake_history(&(result->history)); -+ } -+ - return ret; - } - --- -2.25.1 -
meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch +3 -3
@@ -1,4 +1,4 @@ -From 0377f0d5b5c1079e3b9a80881f4dcc891cbe9f9a Mon Sep 17 00:00:00 2001 +From b5cee0cb0f14a78056ef7722a34b361491f1fdda Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <[email protected]> Date: Tue, 30 May 2023 09:11:27 -0700 Subject: [PATCH] Configure: do not tweak mips cflags
@@ -17,10 +17,10 @@ Signed-off-by: Tim Orling <[email protected]> 1 file changed, 10 deletions(-) diff --git a/Configure b/Configure -index fff97bd..5ee54c1 100755 +index c05a30b..db8adee 100755 --- a/Configure +++ b/Configure -@@ -1557,16 +1557,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) +@@ -1575,16 +1575,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) push @{$config{shared_ldflag}}, "-mno-cygwin"; }
meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +5 -6
@@ -1,4 +1,4 @@ -From 5985253f2c9025d7c127443a3a9938946f80c2a1 Mon Sep 17 00:00:00 2001 +From 6df53bfebcf8ca65910a18220a6576fb110918a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <[email protected]> Date: Tue, 6 Nov 2018 14:50:47 +0100 Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map from compiler
@@ -28,17 +28,16 @@ Signed-off-by: Kai Kang <[email protected]> Update to fix buildpaths qa issue for '-ffile-prefix-map'. Signed-off-by: Khem Raj <[email protected]> - --- Configurations/unix-Makefile.tmpl | 16 +++++++++++++++- crypto/build.info | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl -index 09303c4..011bda1 100644 +index eff66e5..bc48f51 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl -@@ -514,13 +514,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), +@@ -503,13 +503,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
@@ -68,10 +67,10 @@ index 09303c4..011bda1 100644 # For x86 assembler: Set PROCESSOR to 386 if you want to support diff --git a/crypto/build.info b/crypto/build.info -index aee5c46..95c9577 100644 +index 8e4a885..95b0902 100644 --- a/crypto/build.info +++ b/crypto/build.info -@@ -115,7 +115,7 @@ DEFINE[../libcrypto]=$UPLINKDEF +@@ -114,7 +114,7 @@ DEFINE[../libcrypto]=$UPLINKDEF DEPEND[info.o]=buildinf.h DEPEND[cversion.o]=buildinf.h
meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patch +2 -2
@@ -1,4 +1,4 @@ -From c7000672296f4c367341aa3415f26c4d9f5e4749 Mon Sep 17 00:00:00 2001 +From 14856dbd767621ce6f162680c00557b54af0effb Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari <[email protected]> Date: Thu, 23 Oct 2025 11:24:36 +0200 Subject: [PATCH] extend check_cwm test timeout
@@ -15,7 +15,7 @@ Signed-off-by: Gyorgy Sarvari <[email protected]> 1 file changed, 5 insertions(+) diff --git a/test/radix/main.c b/test/radix/main.c -index 4a1e886a71..39f8c61ef9 100644 +index 0f3dc11..d925639 100644 --- a/test/radix/main.c +++ b/test/radix/main.c @@ -25,6 +25,11 @@ static int test_script(int idx)
meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +6 -17
@@ -11,7 +11,6 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ file://run-ptest \ file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ file://0001-Configure-do-not-tweak-mips-cflags.patch \ - file://0001-Added-handshake-history-reporting-when-test-fails.patch \ file://0001-extend-check_cwm-test-timeout.patch \ "
@@ -19,7 +18,7 @@ SRC_URI:append:class-nativesdk = " \ file://environment.d-openssl.sh \ " -SRC_URI[sha256sum] = "a8c0d28a529ca480f9f36cf5792e2cd21984552a3c8e4aa11a24aa31aeac98e8" +SRC_URI[sha256sum] = "2db3f3a0d6ea4b59e1f094ace2c8cd536dffb87cdc39084c5afa1e6f7f37dd09" inherit lib_package multilib_header multilib_script ptest perlnative manpages MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
@@ -33,7 +32,6 @@ PACKAGECONFIG ?= "" PACKAGECONFIG:class-native = "" PACKAGECONFIG:class-nativesdk = "" -PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module" PACKAGECONFIG[legacy] = ",no-legacy" PACKAGECONFIG[tls1] = ",no-tls1" PACKAGECONFIG[tls1_1] = ",no-tls1_1"
@@ -57,8 +55,8 @@ EXTRA_OECONF:append:class-native = " --with-rand-seed=os,devrandom" EXTRA_OECONF:append:class-nativesdk = " --with-rand-seed=os,devrandom" # Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate. -EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' -EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"' #| threads_pthread.c:(.text+0x372): undefined reference to `__atomic_is_lock_free' EXTRA_OECONF:append:toolchain-clang:x86 = " -latomic"
@@ -204,12 +202,10 @@ do_install:append:class-native () { OPENSSL_CONF=\${OPENSSL_CONF:-${libdir}/ssl-3/openssl.cnf} \ SSL_CERT_DIR=\${SSL_CERT_DIR:-${libdir}/ssl-3/certs} \ SSL_CERT_FILE=\${SSL_CERT_FILE:-${libdir}/ssl-3/cert.pem} \ - OPENSSL_ENGINES=\${OPENSSL_ENGINES:-${libdir}/engines-3} \ OPENSSL_MODULES=\${OPENSSL_MODULES:-${libdir}/ossl-modules} - # Setting ENGINESDIR and MODULESDIR to invalid paths prevents host contamination, + # Setting MODULESDIR to invalid paths prevents host contamination, # but also breaks the generated libcrypto.pc file. Post-Fix it manually here. - sed -i 's|^enginesdir=\($.libdir.\)/.*|enginesdir=\1/engines-3|' ${D}${libdir}/pkgconfig/libcrypto.pc sed -i 's|^modulesdir=\($.libdir.\)/.*|modulesdir=\1/ossl-modules|' ${D}${libdir}/pkgconfig/libcrypto.pc }
@@ -252,10 +248,6 @@ do_install_ptest() { sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm ${D}${PTEST_PATH}/util/wrap.pl - install -d ${D}${PTEST_PATH}/engines - install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines/ - install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines/ - ln -s ${libdir}/engines-3/loader_attic.so ${D}${PTEST_PATH}/engines/ ln -s ${libdir}/ossl-modules/ ${D}${PTEST_PATH}/providers }
@@ -270,16 +262,13 @@ pkg_postinst_ontarget:${PN}-ossl-module-fips () { # file to be installed for both the openssl-bin package and the libcrypto # package since the openssl-bin package depends on the libcrypto package. -PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips" +PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips" FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}" FILES:libssl = "${libdir}/libssl${SOLIBS}" FILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf* \ ${libdir}/ssl-3/openssl.cnf* \ " -FILES:${PN}-engines = "${libdir}/engines-3" -# ${prefix} comes from what we pass into --prefix at configure time (which is used for INSTALLTOP) -FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3" FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash" FILES:${PN}-ossl-module-legacy = "${libdir}/ossl-modules/legacy.so" FILES:${PN}-ossl-module-fips = "${libdir}/ossl-modules/fips.so"
@@ -290,7 +279,7 @@ CONFFILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf" RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy" RDEPENDS:${PN}-misc = "perl" -RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed openssl-engines" +RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed" RRECOMMENDS:${PN}-ptest += "${PN}-ossl-module-legacy" RDEPENDS:${PN}-bin += "openssl-conf"
Re: [OE-core] [RFC v2 1/6] openssl: upgrade 3.5.7 -> 4.0.1
what do we do with the packages that depend on openssl-engines package ? e.g. freediameter in meta-networking ?
Quoted 682 lines · Jaipaul Cheernam via lists.openembedded.org
Upgrade OpenSSL from 3.5.7 to 4.0.1. This is a major version upgrade.
Changelog:
https://github.com/openssl/openssl/blob/openssl-4.0.1/CHANGES.mdNew CVE fixes not already in 3.5.7:
* CVE-2026-28386: Fixed OOB read in AES-CFB-128 on x86-64 with AVX-512
* CVE-2026-35188: Fixed double-free when checking OCSP stapled response
* CVE-2026-42765: Fixed NULL deref in cert verification with OCSP
* CVE-2026-42771: Fixed OOB read inX509_VERIFY_PARAM_set1_email()Major breaking changes in 4.0.0:
* Removed support for engines. The ENGINE API is fully removed.
* Removed support for SSLv3. SSLv3 has been deprecated since 2015.
* Removed support for the SSLv2 Client Hello.
* Removed per-version TLS method functions (SSLv3_method(),TLSv1_method(), TLSv1_1_method(), TLSv1_2_method()).* Removed
c_rehashscript tool. Use 'openssl rehash' instead.
*ASN1_STRINGhas been made opaque.
* Numerous API function signatures changed to include const qualifiers.
* libcrypto no longer cleans up globally allocated data viaatexit().
* Added AKID verification checks whenX509_V_FLAG_X509_STRICTis set.
* Support of deprecated elliptic curves in TLS disabled at compile-time by default.Recipe changes:
* Drop 0001-Added-handshake-history-reporting-when-test-fails.patch(merged upstream via PR #22481).* Refresh remaining patches against the new version.
* Remove ENGINE API artifacts: engines package, dasync.so/ossltest.so ptest installation, ENGINESDIR references,OPENSSL_ENGINESwrapper variable, and cryptodev-linux PACKAGECONFIG.Tested: ptest on qemux86-64:
Files=362, Tests=4310, Result: PASS
Passed: 338, Skipped: 24 (fips, lms, rc5, tfo, compression, sslversions, sslkeylogfile, external tests - all expected)
Failed: 0Signed-off-by Jaipaul Cheernam <[email protected]>--- ...ke-history-reporting-when-test-fails.patch | 366 ------------------ ...1-Configure-do-not-tweak-mips-cflags.patch | 6 +- ...sysroot-and-debug-prefix-map-from-co.patch | 11 +- .../0001-extend-check_cwm-test-timeout.patch | 4 +- .../{openssl_3.5.7.bb => openssl_4.0.1.bb} | 23 +- 5 files changed, 16 insertions(+), 394 deletions(-) delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch rename meta/recipes-connectivity/openssl/{openssl_3.5.7.bb =>openssl_4.0.1.bb} (88%)
diff --git
a/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patchb/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patchdeleted file mode 100644
index a74c79303f..0000000000
---a/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch+++/dev/nullmeta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-6@@ -1,366 +0,0 @@ -From 5ba65051fea0513db0d997f0ab7cafb9826ed74a Mon Sep 17 00:00:00 2001 -From: William Lyu <[email protected]> -Date: Fri, 20 Oct 2023 16:22:37 -0400 -Subject: [PATCH] Added handshake history reporting when test fails - -Upstream-Status: Submitted [https://github.com/openssl/openssl/pull/22481]
meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-51- -Signed-off-by: William Lyu <[email protected]> ---- - test/helpers/handshake.c | 136 ++++++++++++++++++++++++++++++--------- - test/helpers/handshake.h | 70 +++++++++++++++++++- - test/ssl_test.c | 44 +++++++++++++ - 3 files changed, 217 insertions(+), 33 deletions(-) - -diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c -index f611b3a..5703b48 100644 ---- a/test/helpers/handshake.c -+++ b/test/helpers/handshake.c -@@ -25,6 +25,102 @@ - #include <netinet/sctp.h> - #endif - -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+/* Maps string names to various enumeration type */ -+typedef struct { -+ const char *name; -+ int value; -+} enum_name_map; -+ -+static const enum_name_map connect_phase_names[] = { -+ {"Handshake", HANDSHAKE}, -+ {"RenegAppData", RENEG_APPLICATION_DATA}, -+ {"RenegSetup", RENEG_SETUP}, -+ {"RenegHandshake", RENEG_HANDSHAKE}, -+ {"AppData", APPLICATION_DATA}, -+ {"Shutdown", SHUTDOWN}, -+ {"ConnectionDone", CONNECTION_DONE} -+}; -+ -+static const enum_name_map peer_status_names[] = { -+ {"PeerSuccess", PEER_SUCCESS}, -+ {"PeerRetry", PEER_RETRY}, -+ {"PeerError", PEER_ERROR}, -+ {"PeerWaiting", PEER_WAITING}, -+ {"PeerTestFail", PEER_TEST_FAILURE} -+}; -+ -+static const enum_name_map handshake_status_names[] = { -+ {"HandshakeSuccess", HANDSHAKE_SUCCESS}, -+ {"ClientError", CLIENT_ERROR}, -+ {"ServerError", SERVER_ERROR}, -+ {"InternalError", INTERNAL_ERROR}, -+ {"HandshakeRetry", HANDSHAKE_RETRY} -+}; -+ -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+static const char *enum_name(const enum_name_map *enums, size_t
num_enums,
-+ int value)
-+{
-+size_ti;
-+ for (i = 0; i <num_enums; i++) {
-+ if (enums[i].value == value) {
-+ return enums[i].name;
-+ }
-+ }
-+ return "InvalidValue";
-+}
-+
-+const char *handshake_connect_phase_name(connect_phase_t phase) -+{
-+ return enum_name(connect_phase_names,OSSL_NELEM(connect_phase_names),
-+ (int)phase);
-+}
-+
-+const char *handshake_status_name(handshake_status_thandshake_status) -+{
-+ return enum_name(handshake_status_names,OSSL_NELEM(handshake_status_names),
-+ (int)handshake_status);
-+}
-+
-+const char *handshake_peer_status_name(peer_status_tpeer_status) -+{
-+ return enum_name(peer_status_names,OSSL_NELEM(peer_status_names),
-+ (int)peer_status);
-+}
-+
-+static void save_loop_history(HANDSHAKE_HISTORY *history,-+ connect_phase_t phase, -+ handshake_status_t handshake_status, -+ peer_status_t server_status, -+ peer_status_t client_status, -+ int client_turn_count, -+ int is_client_turn)-+{
-+HANDSHAKE_HISTORY_ENTRY*new_entry= NULL;
-+
-+ /*
-+ * Create a new history entry for a handshake loop with statuses
given in-+ * the arguments. Potentially evicting the oldest entry when the -+ * ring buffer is full. -+ */ -+ ++(history->last_idx); -+ history->last_idx &= MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ -+ new_entry = &((history->entries)[history->last_idx]); -+ new_entry->phase = phase; -+ new_entry->handshake_status = handshake_status; -+ new_entry->server_status = server_status; -+ new_entry->client_status = client_status; -+ new_entry->client_turn_count = client_turn_count; -+ new_entry->is_client_turn = is_client_turn;-+
-+ /* Evict the oldest handshake loop entry when the ring buffer is
full. */
-+ if (history->entry_count<MAX_HANDSHAKE_HISTORY_ENTRY) {
-+ ++(history->entry_count);
-+ }
-+}
-+
-HANDSHAKE_RESULT*HANDSHAKE_RESULT_new(void)
- {
-HANDSHAKE_RESULT*ret;
-@@ -724,15 +820,6 @@ static void configure_handshake_ssl(SSL *server, SSL *client,meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-33- SSL_set_post_handshake_auth(client, 1); - } - --/* The status for each connection phase. */ --typedef enum { -- PEER_SUCCESS, -- PEER_RETRY, -- PEER_ERROR, -- PEER_WAITING, -- PEER_TEST_FAILURE --} peer_status_t; -- - /* An SSL object and associated read-write buffers. */ - typedef struct peer_st { - SSL *ssl; -@@ -1077,16 +1164,6 @@ static void do_shutdown_step(PEER *peer) - } - } - --typedef enum { -- HANDSHAKE, -- RENEG_APPLICATION_DATA, -- RENEG_SETUP, -- RENEG_HANDSHAKE, -- APPLICATION_DATA, -- SHUTDOWN, -- CONNECTION_DONE --} connect_phase_t; -- - static int renegotiate_op(const SSL_TEST_CTX *test_ctx) - { - switch (test_ctx->handshake_mode) { -@@ -1164,19 +1241,6 @@ static void do_connect_step(const SSL_TEST_CTX
*test_ctx, PEER *peer,meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-30- } - } - --typedef enum { -- /* Both parties succeeded. */ -- HANDSHAKE_SUCCESS, -- /* Client errored. */ -- CLIENT_ERROR, -- /* Server errored. */ -- SERVER_ERROR, -- /* Peers are in inconsistent state. */ -- INTERNAL_ERROR, -- /* One or both peers not done. */ -- HANDSHAKE_RETRY --} handshake_status_t; -- - /* - * Determine the handshake outcome. - * last_status: the status of the peer to have acted last. -@@ -1541,6 +1605,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( - - start = time(NULL); - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - /* - * Half-duplex handshake loop. - * Client and server speak to each other synchronously in the sameprocess.
-@@ -1562,6 +1630,10 @@ staticHANDSHAKE_RESULT*do_handshake_internal(meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-20- 0 /* server went last */); - } - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - switch (status) { - case HANDSHAKE_SUCCESS: - client_turn_count = 0; -diff --git a/test/helpers/handshake.h b/test/helpers/handshake.h -index 78b03f9..b9967c2 100644 ---- a/test/helpers/handshake.h -+++ b/test/helpers/handshake.h -@@ -1,5 +1,5 @@ - /* -- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. -+ * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may notuse
- * this file except in compliance with the License. You can obtain a copy
-@@ -12,6 +12,11 @@meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-5- - #include "ssl_test_ctx.h" - -+#define MAX_HANDSHAKE_HISTORY_ENTRY_BIT 4 -+#define MAX_HANDSHAKE_HISTORY_ENTRY (1 <<
MAX_HANDSHAKE_HISTORY_ENTRY_BIT)
-+#defineMAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK\
-+ ((1 <<MAX_HANDSHAKE_HISTORY_ENTRY_BIT) - 1)
-+
- typedef structctx_data_st{meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-53- unsigned char *npn_protocols; - size_t npn_protocols_len; -@@ -22,6 +27,63 @@ typedef struct ctx_data_st { - char *session_ticket_app_data; - } CTX_DATA; - -+typedef enum { -+ HANDSHAKE, -+ RENEG_APPLICATION_DATA, -+ RENEG_SETUP, -+ RENEG_HANDSHAKE, -+ APPLICATION_DATA, -+ SHUTDOWN, -+ CONNECTION_DONE -+} connect_phase_t; -+ -+/* The status for each connection phase. */ -+typedef enum { -+ PEER_SUCCESS, -+ PEER_RETRY, -+ PEER_ERROR, -+ PEER_WAITING, -+ PEER_TEST_FAILURE -+} peer_status_t; -+ -+typedef enum { -+ /* Both parties succeeded. */ -+ HANDSHAKE_SUCCESS, -+ /* Client errored. */ -+ CLIENT_ERROR, -+ /* Server errored. */ -+ SERVER_ERROR, -+ /* Peers are in inconsistent state. */ -+ INTERNAL_ERROR, -+ /* One or both peers not done. */ -+ HANDSHAKE_RETRY -+} handshake_status_t; -+ -+/* Stores the various status information in a handshake loop. */ -+typedef struct handshake_history_entry_st { -+ connect_phase_t phase; -+ handshake_status_t handshake_status; -+ peer_status_t server_status; -+ peer_status_t client_status; -+ int client_turn_count; -+ int is_client_turn; -+} HANDSHAKE_HISTORY_ENTRY; -+ -+typedef struct handshake_history_st { -+ /* Implemented using ring buffer. */ -+ /* -+ * The valid entries are |entries[last_idx]|, |entries[last_idx-1]|, -+ * ..., etc., going up to |entry_count| number of entries. Note thatwhen
-+ * the index into the array |entries| becomes < 0, we wrap around to -+ * the end of |entries|. -+ */ -+ HANDSHAKE_HISTORY_ENTRY entries[MAX_HANDSHAKE_HISTORY_ENTRY]; -+ /* The number of valid entries in |entries| array. */ -+ size_t entry_count; -+ /* The index of the last valid entry in the |entries| array. */ -+ size_t last_idx;-+}
HANDSHAKE_HISTORY;
-+
- typedef structhandshake_result{(quoted diff) +0
-2- ssl_test_result_t result; - /* These alerts are in the 2-byte format returned by the
info_callback. */
-@@ -77,6 +139,8 @@ typedef structhandshake_result{meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-9- char *cipher; - /* session ticket application data */ - char *result_session_ticket_app_data; -+ /* handshake loop history */ -+ HANDSHAKE_HISTORY history; - } HANDSHAKE_RESULT; - - HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void); -@@ -95,4 +159,8 @@ int configure_handshake_ctx_for_srp(SSL_CTX
*server_ctx,SSL_CTX*server2_ctx,meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-14- CTX_DATA *server2_ctx_data, - CTX_DATA *client_ctx_data); - -+const char *handshake_connect_phase_name(connect_phase_t phase); -+const char *handshake_status_name(handshake_status_t handshake_status); -+const char *handshake_peer_status_name(peer_status_t peer_status); -+ - #endif /* OSSL_TEST_HANDSHAKE_HELPER_H */ -diff --git a/test/ssl_test.c b/test/ssl_test.c -index ea60851..9d6b093 100644 ---- a/test/ssl_test.c -+++ b/test/ssl_test.c -@@ -26,6 +26,44 @@ static OSSL_LIB_CTX *libctx = NULL; - /* Currently the section names are of the form test-<number>, e.g.test-15. */
- #defineMAX_TESTCASE_NAME_LENGTH100meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-43- -+static void print_handshake_history(const HANDSHAKE_HISTORY *history) -+{ -+ size_t first_idx; -+ size_t i; -+ size_t cur_idx; -+ const HANDSHAKE_HISTORY_ENTRY *cur_entry; -+ const char header_template[] = "|%14s|%16s|%16s|%16s|%17s|%14s|"; -+ const char body_template[] = "|%14s|%16s|%16s|%16s|%17d|%14s|"; -+ -+ TEST_info("The following is the server/client state " -+ "in the most recent %d handshake loops.", -+ MAX_HANDSHAKE_HISTORY_ENTRY); -+ -+ TEST_note("==================================================" -+ "=================================================="); -+ TEST_note(header_template, -+ "phase", "handshake status", "server status", -+ "client status", "client turn count", "is client turn"); -+ TEST_note("+--------------+----------------+----------------" -+ "+----------------+-----------------+--------------+"); -+ -+ first_idx = (history->last_idx - history->entry_count + 1) & -+ MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ for (i = 0; i < history->entry_count; ++i) { -+ cur_idx = (first_idx + i) & MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ cur_entry = &(history->entries)[cur_idx]; -+ TEST_note(body_template, -+ handshake_connect_phase_name(cur_entry->phase), -+ handshake_status_name(cur_entry->handshake_status), -+ handshake_peer_status_name(cur_entry->server_status), -+ handshake_peer_status_name(cur_entry->client_status), -+ cur_entry->client_turn_count, -+ cur_entry->is_client_turn ? "true" : "false"); -+ } -+ TEST_note("==================================================" -+ "=================================================="); -+} -+ - static const char *print_alert(int alert) - { - return alert ? SSL_alert_desc_string_long(alert) : "no alert"; -@@ -388,6 +426,12 @@ static int check_test(HANDSHAKE_RESULT *result,
SSL_TEST_CTX*test_ctx)meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-15- ret &= check_client_sign_type(result, test_ctx); - ret &= check_client_ca_names(result, test_ctx); - } -+ -+ /* Print handshake loop history if any check fails. */ -+ if (!ret) { -+ print_handshake_history(&(result->history)); -+ } -+ - return ret; - } - --- -2.25.1 -diff --git
a/meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patchb/meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patchindexcd8906df67..77bfe4e4e5100644
---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.patchmeta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch +3
-5@@ -1,4 +1,4 @@ -From 0377f0d5b5c1079e3b9a80881f4dcc891cbe9f9a Mon Sep 17 00:00:00 2001 +From b5cee0cb0f14a78056ef7722a34b361491f1fdda Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <[email protected]> Date: Tue, 30 May 2023 09:11:27 -0700 Subject: [PATCH] Configure: do not tweak mips cflags@@ -17,10 +17,10 @@ Signed-off-by: Tim Orling <[email protected]> 1 file changed, 10 deletions(-) diff --git a/Configure b/Configure -index fff97bd..5ee54c1 100755 +index c05a30b..db8adee 100755 --- a/Configure +++ b/Configure -@@ -1557,16 +1557,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) +@@ -1575,16 +1575,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) push @{$config{shared_ldflag}}, "-mno-cygwin"; }diff --git
a/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patchb/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patchindexbfbfedbd67..1d9e7539f6100644
---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.patchmeta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +1
-1@@ -1,4 +1,4 @@ -From 5985253f2c9025d7c127443a3a9938946f80c2a1 Mon Sep 17 00:00:00 2001 +From 6df53bfebcf8ca65910a18220a6576fb110918a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <[email protected]> Date: Tue, 6 Nov 2018 14:50:47 +0100 Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map fromcompiler
meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +0
-1@@ -28,17 +28,16 @@ Signed-off-by: Kai Kang <[email protected]> Update to fix buildpaths qa issue for '-ffile-prefix-map'. Signed-off-by: Khem Raj <[email protected]> - --- Configurations/unix-Makefile.tmpl | 16 +++++++++++++++- crypto/build.info | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Configurations/unix-Makefile.tmplb/Configurations/unix-Makefile.tmpl
meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +4
-4-index 09303c4..011bda1 100644 +index eff66e5..bc48f51 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl -@@ -514,13 +514,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), +@@ -503,13 +503,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)@@ -68,10 +67,10 @@ index 09303c4..011bda1 100644 # For x86 assembler: Set PROCESSOR to 386 if you want to support diff --git a/crypto/build.info b/crypto/build.info -index aee5c46..95c9577 100644 +index 8e4a885..95b0902 100644 --- a/crypto/build.info +++ b/crypto/build.info -@@ -115,7 +115,7 @@ DEFINE[../libcrypto]=$UPLINKDEF +@@ -114,7 +114,7 @@ DEFINE[../libcrypto]=$UPLINKDEF DEPEND[info.o]=buildinf.h DEPEND[cversion.o]=buildinf.hdiff --git
a/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patchb/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patchindexf6eb28069a..76bc05d5f9100644
---a/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patch
+++b/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patchmeta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patch +2
-2@@ -1,4 +1,4 @@ -From c7000672296f4c367341aa3415f26c4d9f5e4749 Mon Sep 17 00:00:00 2001 +From 14856dbd767621ce6f162680c00557b54af0effb Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari <[email protected]> Date: Thu, 23 Oct 2025 11:24:36 +0200 Subject: [PATCH] extend check_cwm test timeout@@ -15,7 +15,7 @@ Signed-off-by: Gyorgy Sarvari <[email protected]> 1 file changed, 5 insertions(+) diff --git a/test/radix/main.c b/test/radix/main.c -index 4a1e886a71..39f8c61ef9 100644 +index 0f3dc11..d925639 100644 --- a/test/radix/main.c +++ b/test/radix/main.c @@ -25,6 +25,11 @@ static int test_script(int idx)meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -11,7 +11,6 @@ SRC_URI = " http://www.openssl.org/source/openssl-${PV}.tar.gz \ file://run-ptest \ file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ file://0001-Configure-do-not-tweak-mips-cflags.patch \ - file://0001-Added-handshake-history-reporting-when-test-fails.patch \file://0001-extend-check_cwm-test-timeout.patch \ "meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -19,7 +18,7 @@ SRC_URI:append:class-nativesdk = " \ file://environment.d-openssl.sh \ " -SRC_URI[sha256sum] ="
a8c0d28a529ca480f9f36cf5792e2cd21984552a3c8e4aa11a24aa31aeac98e8" +SRC_URI[sha256sum] = "2db3f3a0d6ea4b59e1f094ace2c8cd536dffb87cdc39084c5afa1e6f7f37dd09"inherit
lib_packagemultilib_headermultilib_scriptptest perlnative
manpages
MULTILIB_SCRIPTS= "${PN}-bin:${bindir}/c_rehash"meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -33,7 +32,6 @@ PACKAGECONFIG ?= "" PACKAGECONFIG:class-native = "" PACKAGECONFIG:class-nativesdk = "" -PACKAGECONFIG[cryptodev-linux] ="enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module"
PACKAGECONFIG[legacy] = ",no-legacy"
PACKAGECONFIG[tls1] = ",no-tls1"
PACKAGECONFIG[tls1_1] = ",no-tls1_1"meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -57,8 +55,8 @@ EXTRA_OECONF:append:class-native = " --with-rand-seed=os,devrandom" EXTRA_OECONF:append:class-nativesdk = " --with-rand-seed=os,devrandom" # Relying on hardcoded built-in paths causes openssl-native to not berelocateable from sstate. -EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' -EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"'
#| threads_pthread.c:(.text+0x372): undefined reference to
`__atomic_is_lock_free'
EXTRA_OECONF:append:toolchain-clang:x86 = " -latomic"meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +1
-2@@ -204,12 +202,10 @@ do_install:append:class-native () { OPENSSL_CONF=\${OPENSSL_CONF:-${libdir}/ssl-3/openssl.cnf} \ SSL_CERT_DIR=\${SSL_CERT_DIR:-${libdir}/ssl-3/certs} \ SSL_CERT_FILE=\${SSL_CERT_FILE:-${libdir}/ssl-3/cert.pem} \ - OPENSSL_ENGINES=\${OPENSSL_ENGINES:-${libdir}/engines-3} \ OPENSSL_MODULES=\${OPENSSL_MODULES:-${libdir}/ossl-modules} - # Setting ENGINESDIR and MODULESDIR to invalid paths prevents host contamination, + # Setting MODULESDIR to invalid paths prevents host contamination, # but also breaks the generated libcrypto.pc file. Post-Fix itmanually here.
- sed -i 's|^enginesdir=\($.libdir.\)/.*|enginesdir=\1/engines-3|'
${D}${libdir}/pkgconfig/libcrypto.pc
sed -i
's|^modulesdir=\($.libdir.\)/.*|modulesdir=\1/ossl-modules|' ${D}${libdir}/pkgconfig/libcrypto.pc
}meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-0@@ -252,10 +248,6 @@ do_install_ptest() { sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm
${D}${PTEST_PATH}/util/wrap.plmeta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-4- install -d ${D}${PTEST_PATH}/engines - install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines/ - install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines/ - ln -s ${libdir}/engines-3/loader_attic.so${D}${PTEST_PATH}/engines/
ln -s ${libdir}/ossl-modules/ ${D}${PTEST_PATH}/providers}
meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -270,16 +262,13 @@ pkg_postinst_ontarget:${PN}-ossl-module-fips () { # file to be installed for both the openssl-bin package and the libcrypto # package since the openssl-bin package depends on the libcrypto package. -PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc${PN}-ossl-module-legacy ${PN}-ossl-module-fips" +PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips"
FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}"
FILES:libssl = "${libdir}/libssl${SOLIBS}"FILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf* \ ${libdir}/ssl-3/openssl.cnf* \ "meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-2-FILES:${PN}-engines = "${libdir}/engines-3" -# ${prefix} comes from what we pass into --prefix at configure time(which is used for INSTALLTOP) -FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3"
FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash" FILES:${PN}-ossl-module-legacy = "${libdir}/ossl-modules/legacy.so" FILES:${PN}-ossl-module-fips = "${libdir}/ossl-modules/fips.so"meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-0@@ -290,7 +279,7 @@ CONFFILES:openssl-conf ="${sysconfdir}/ssl/openssl.cnf"
RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy" RDEPENDS:${PN}-misc = "perl"
-RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed openssl-engines"
+RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed"
RRECOMMENDS:${PN}-ptest += "${PN}-ossl-module-legacy"RDEPENDS:${PN}-bin += "openssl-conf"
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#243875):
https://lists.openembedded.org/g/openembedded-core/message/243875
Mute This Topic: https://lists.openembedded.org/mt/120850402/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
RFC v2 2/6 python3: backport OpenSSL 4.0 support from upstream
In reply to Jaipaul CheernamBackport CPython commit 3364e7e62fa24d0e19133fb0f90b1c24ef1110c5:
gh-146207: Add support for OpenSSL 4.0.0 alpha1 (#146217)
OpenSSL 4.0.0 alpha1 removed these functions:
* SSLv3_method()
* TLSv1_method()
* TLSv1_1_method()
* TLSv1_2_method()
Other changes:
* Update test_openssl_version().
* Update multissltests.py for OpenSSL 4.
* Add const qualifier to fix compiler warnings.
Upstream-Status: Backport [https://github.com/python/cpython/commit/3364e7e62fa24d0e19133fb0f90b1c24ef1110c5]
--- ...146207-Add-support-for-OpenSSL-4.0.0.patch | 257 ++++++++++++++++++ .../recipes-devtools/python/python3_3.14.7.bb | 1 + 2 files changed, 258 insertions(+) create mode 100644 meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch
meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch new file +257 -0
@@ -0,0 +1,257 @@ +From 3364e7e62fa24d0e19133fb0f90b1c24ef1110c5 Mon Sep 17 00:00:00 2001 +From: Victor Stinner <[email protected]> +Date: Wed, 25 Mar 2026 07:44:47 +0100 +Subject: [PATCH] gh-146207: Add support for OpenSSL 4.0.0 alpha1 (#146217) + +OpenSSL 4.0.0 alpha1 removed these functions: + +* SSLv3_method() +* TLSv1_method() +* TLSv1_1_method() +* TLSv1_2_method() + +Other changes: + +* Update test_openssl_version(). +* Update multissltests.py for OpenSSL 4. +* Add const qualifier to fix compiler warnings. + +Co-authored-by: Bénédikt Tran <[email protected]> +Signed-off-by: Victor Stinner <[email protected]> + +Upstream-Status: Backport [https://github.com/python/cpython/commit/3364e7e62fa24d0e19133fb0f90b1c24ef1110c5] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + Lib/test/test_ssl.py | 52 ++++++++++++++++++++------------------ + Modules/_ssl.c | 27 ++++++++++++++++---- + Modules/_ssl/cert.c | 3 ++- + Tools/ssl/multissltests.py | 7 ++++- + 4 files changed, 58 insertions(+), 31 deletions(-) + +diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py +index dc795c6bd8a..61355927296 100644 +--- a/Lib/test/test_ssl.py ++++ b/Lib/test/test_ssl.py +@@ -395,7 +395,7 @@ def test_constants(self): + ssl.OP_NO_COMPRESSION + self.assertEqual(ssl.HAS_SNI, True) + self.assertEqual(ssl.HAS_ECDH, True) +- self.assertEqual(ssl.HAS_TLSv1_2, True) ++ self.assertIsInstance(ssl.HAS_TLSv1_2, bool) + self.assertEqual(ssl.HAS_TLSv1_3, True) + ssl.OP_NO_SSLv2 + ssl.OP_NO_SSLv3 +@@ -586,11 +586,11 @@ def test_openssl_version(self): + # Some sanity checks follow + # >= 1.1.1 + self.assertGreaterEqual(n, 0x10101000) +- # < 4.0 +- self.assertLess(n, 0x40000000) ++ # < 5.0 ++ self.assertLess(n, 0x50000000) + major, minor, fix, patch, status = t + self.assertGreaterEqual(major, 1) +- self.assertLess(major, 4) ++ self.assertLess(major, 5) + self.assertGreaterEqual(minor, 0) + self.assertLess(minor, 256) + self.assertGreaterEqual(fix, 0) +@@ -656,12 +656,14 @@ def test_openssl111_deprecations(self): + ssl.OP_NO_TLSv1_2, + ssl.OP_NO_TLSv1_3 + ] +- protocols = [ +- ssl.PROTOCOL_TLSv1, +- ssl.PROTOCOL_TLSv1_1, +- ssl.PROTOCOL_TLSv1_2, +- ssl.PROTOCOL_TLS +- ] ++ protocols = [] ++ if hasattr(ssl, 'PROTOCOL_TLSv1'): ++ protocols.append(ssl.PROTOCOL_TLSv1) ++ if hasattr(ssl, 'PROTOCOL_TLSv1_1'): ++ protocols.append(ssl.PROTOCOL_TLSv1_1) ++ if hasattr(ssl, 'PROTOCOL_TLSv1_2'): ++ protocols.append(ssl.PROTOCOL_TLSv1_2) ++ protocols.append(ssl.PROTOCOL_TLS) + versions = [ + ssl.TLSVersion.SSLv3, + ssl.TLSVersion.TLSv1, +@@ -1205,6 +1207,7 @@ def test_min_max_version(self): + ssl.TLSVersion.TLSv1, + ssl.TLSVersion.TLSv1_1, + ssl.TLSVersion.TLSv1_2, ++ ssl.TLSVersion.TLSv1_3, + ssl.TLSVersion.SSLv3, + } + ) +@@ -1218,7 +1221,7 @@ def test_min_max_version(self): + with self.assertRaises(ValueError): + ctx.minimum_version = 42 + +- if has_tls_protocol(ssl.PROTOCOL_TLSv1_1): ++ if has_tls_protocol('PROTOCOL_TLSv1_1'): + ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_1) + + self.assertIn( +@@ -1675,23 +1678,24 @@ def test__create_stdlib_context(self): + self.assertFalse(ctx.check_hostname) + self._assert_context_options(ctx) + +- if has_tls_protocol(ssl.PROTOCOL_TLSv1): ++ if has_tls_protocol('PROTOCOL_TLSv1'): + with warnings_helper.check_warnings(): + ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1) + self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1) + self.assertEqual(ctx.verify_mode, ssl.CERT_NONE) + self._assert_context_options(ctx) + +- with warnings_helper.check_warnings(): +- ctx = ssl._create_stdlib_context( +- ssl.PROTOCOL_TLSv1_2, +- cert_reqs=ssl.CERT_REQUIRED, +- check_hostname=True +- ) +- self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1_2) +- self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED) +- self.assertTrue(ctx.check_hostname) +- self._assert_context_options(ctx) ++ if has_tls_protocol('PROTOCOL_TLSv1_2'): ++ with warnings_helper.check_warnings(): ++ ctx = ssl._create_stdlib_context( ++ ssl.PROTOCOL_TLSv1_2, ++ cert_reqs=ssl.CERT_REQUIRED, ++ check_hostname=True ++ ) ++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1_2) ++ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED) ++ self.assertTrue(ctx.check_hostname) ++ self._assert_context_options(ctx) + + ctx = ssl._create_stdlib_context(purpose=ssl.Purpose.CLIENT_AUTH) + self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLS_SERVER) +@@ -3654,10 +3658,10 @@ def test_protocol_tlsv1_2(self): + client_options=ssl.OP_NO_TLSv1_2) + + try_protocol_combo(ssl.PROTOCOL_TLS, ssl.PROTOCOL_TLSv1_2, 'TLSv1.2') +- if has_tls_protocol(ssl.PROTOCOL_TLSv1): ++ if has_tls_protocol('PROTOCOL_TLSv1'): + try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1, False) + try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1_2, False) +- if has_tls_protocol(ssl.PROTOCOL_TLSv1_1): ++ if has_tls_protocol('PROTOCOL_TLSv1_1'): + try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1_1, False) + try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1_2, False) + +diff --git a/Modules/_ssl.c b/Modules/_ssl.c +index b45295b4c0c..6f75af86113 100644 +--- a/Modules/_ssl.c ++++ b/Modules/_ssl.c +@@ -164,6 +164,17 @@ static void _PySSLFixErrno(void) { + #error Unsupported OpenSSL version + #endif + ++#if (OPENSSL_VERSION_NUMBER >= 0x40000000L) ++# define OPENSSL_NO_SSL3 ++# define OPENSSL_NO_TLS1 ++# define OPENSSL_NO_TLS1_1 ++# define OPENSSL_NO_TLS1_2 ++# define OPENSSL_NO_SSL3_METHOD ++# define OPENSSL_NO_TLS1_METHOD ++# define OPENSSL_NO_TLS1_1_METHOD ++# define OPENSSL_NO_TLS1_2_METHOD ++#endif ++ + /* OpenSSL API 1.1.0+ does not include version methods */ + #ifndef OPENSSL_NO_SSL3_METHOD + extern const SSL_METHOD *SSLv3_method(void); +@@ -1151,7 +1162,7 @@ _asn1obj2py(_sslmodulestate *state, const ASN1_OBJECT *name, int no_name) + + static PyObject * + _create_tuple_for_attribute(_sslmodulestate *state, +- ASN1_OBJECT *name, ASN1_STRING *value) ++ const ASN1_OBJECT *name, const ASN1_STRING *value) + { + Py_ssize_t buflen; + PyObject *pyattr; +@@ -1180,16 +1191,16 @@ _create_tuple_for_attribute(_sslmodulestate *state, + } + + static PyObject * +-_create_tuple_for_X509_NAME (_sslmodulestate *state, X509_NAME *xname) ++_create_tuple_for_X509_NAME(_sslmodulestate *state, const X509_NAME *xname) + { + PyObject *dn = NULL; /* tuple which represents the "distinguished name" */ + PyObject *rdn = NULL; /* tuple to hold a "relative distinguished name" */ + PyObject *rdnt; + PyObject *attr = NULL; /* tuple to hold an attribute */ + int entry_count = X509_NAME_entry_count(xname); +- X509_NAME_ENTRY *entry; +- ASN1_OBJECT *name; +- ASN1_STRING *value; ++ const X509_NAME_ENTRY *entry; ++ const ASN1_OBJECT *name; ++ const ASN1_STRING *value; + int index_counter; + int rdn_level = -1; + int retcode; +@@ -6967,9 +6978,15 @@ sslmodule_init_constants(PyObject *m) + ADD_INT_CONST("PROTOCOL_TLS", PY_SSL_VERSION_TLS); + ADD_INT_CONST("PROTOCOL_TLS_CLIENT", PY_SSL_VERSION_TLS_CLIENT); + ADD_INT_CONST("PROTOCOL_TLS_SERVER", PY_SSL_VERSION_TLS_SERVER); ++#ifndef OPENSSL_NO_TLS1 + ADD_INT_CONST("PROTOCOL_TLSv1", PY_SSL_VERSION_TLS1); ++#endif ++#ifndef OPENSSL_NO_TLS1_1 + ADD_INT_CONST("PROTOCOL_TLSv1_1", PY_SSL_VERSION_TLS1_1); ++#endif ++#ifndef OPENSSL_NO_TLS1_2 + ADD_INT_CONST("PROTOCOL_TLSv1_2", PY_SSL_VERSION_TLS1_2); ++#endif + + #define ADD_OPTION(NAME, VALUE) if (sslmodule_add_option(m, NAME, (VALUE)) < 0) return -1 + +diff --git a/Modules/_ssl/cert.c b/Modules/_ssl/cert.c +index f2e7be89668..061b0fb3171 100644 +--- a/Modules/_ssl/cert.c ++++ b/Modules/_ssl/cert.c +@@ -128,7 +128,8 @@ _ssl_Certificate_get_info_impl(PySSLCertificate *self) + } + + static PyObject* +-_x509name_print(_sslmodulestate *state, X509_NAME *name, int indent, unsigned long flags) ++_x509name_print(_sslmodulestate *state, const X509_NAME *name, ++ int indent, unsigned long flags) + { + PyObject *res; + BIO *biobuf; +diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py +index 3b4507c6771..48207e5330f 100755 +--- a/Tools/ssl/multissltests.py ++++ b/Tools/ssl/multissltests.py +@@ -429,9 +429,11 @@ def _post_install(self): + def _post_install(self): + if self.version.startswith("3."): + self._post_install_3xx() ++ elif self.version.startswith("4."): ++ self._post_install_4xx() + + def _build_src(self, config_args=()): +- if self.version.startswith("3."): ++ if self.version.startswith(("3.", "4.")): + config_args += ("enable-fips",) + super()._build_src(config_args) + +@@ -447,6 +449,9 @@ def _post_install_3xx(self): + lib64 = self.lib_dir + "64" + os.symlink(lib64, self.lib_dir) + ++ def _post_install_4xx(self): ++ self._post_install_3xx() ++ + @property + def short_version(self): + """Short version for OpenSSL download URL""" +-- +2.25.1 +
meta/recipes-devtools/python/python3_3.14.7.bb +1 -0
@@ -22,6 +22,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-Avoid-shebang-overflow-on-python-config.py.patch \ file://0001-Update-test_sysconfig-for-posix_user-purelib.patch \ file://0001-prefer-valid-entrypoints.patch \ + file://0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch \ " SRC_URI:append:class-native = " \ file://0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch \
RFC v2 3/6 socat: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 made ASN1_STRING opaque. socat directly accesses pName->d.iPAddress->data and pName->d.iPAddress->length which is no longer allowed.
Use ASN1_STRING_get0_data() and ASN1_STRING_length() accessor functions instead. These have been available since OpenSSL 1.1.0 so this is backward compatible.
Upstream-Status: Submitted [[email protected]]
--- ...penSSL-4.0-use-ASN1_STRING-accessors.patch | 31 +++++++++++++++++++ .../socat/socat_1.8.1.3.bb | 1 + 2 files changed, 32 insertions(+) create mode 100644 meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jaipaul Cheernam <[email protected]> +Date: Thu, 13 Aug 2026 07:00:00 +0000 +Subject: [PATCH] Fix build with OpenSSL 4.0: use ASN1_STRING accessors + +OpenSSL 4.0 made ASN1_STRING opaque. Direct access to struct members +(->data, ->length) is no longer possible. Use the accessor functions +ASN1_STRING_get0_data() and ASN1_STRING_length() instead. + +These accessors have been available since OpenSSL 1.1.0, so this change +is backward compatible. + +Upstream-Status: Submitted [[email protected]] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + xio-openssl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/xio-openssl.c ++++ b/xio-openssl.c +@@ -1898,8 +1898,8 @@ + case GEN_IPADD: + { + /* binary address format */ +- const unsigned char *data = pName->d.iPAddress->data; +- size_t len = pName->d.iPAddress->length; ++ const unsigned char *data = ASN1_STRING_get0_data(pName->d.iPAddress); ++ size_t len = ASN1_STRING_length(pName->d.iPAddress); + char aBuffer[INET6_ADDRSTRLEN]; /* canonical peername */ + struct in6_addr ip6bin; +
meta/recipes-connectivity/socat/socat_1.8.1.3.bb +1 -0
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \ file://0001-fix-compile-procan.c-failed.patch \ + file://0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch \ " SRC_URI[sha256sum] = "25bc6476292b2e614220989c77b0b6fca87bb2525d9747b31a6639b1fb602418"
RFC v2 4/6 serf: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 made ASN1_STRING opaque. serf directly accesses nm->d.ia5->data and nm->d.ia5->length which is no longer allowed.
Use ASN1_STRING_get0_data() and ASN1_STRING_length() accessor functions instead. These have been available since OpenSSL 1.1.0 so this is backward compatible.
The fix is already in serf trunk (r1935023) but no new release has been made.
Upstream-Status: Backport [https://svn.apache.org/repos/asf/serf/trunk r1935023]
--- ...penSSL-4.0-use-ASN1_STRING-accessors.patch | 35 +++++++++++++++++++ meta/recipes-support/serf/serf_1.3.10.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jaipaul Cheernam <[email protected]> +Date: Thu, 13 Aug 2026 11:52:00 +0000 +Subject: [PATCH] Fix build with OpenSSL 4.0: use ASN1_STRING accessors + +OpenSSL 4.0 made ASN1_STRING opaque. Direct access to struct members +(->data, ->length) is no longer possible. Use the accessor functions +ASN1_STRING_get0_data() and ASN1_STRING_length() instead. + +These accessors have been available since OpenSSL 1.1.0, so this change +is backward compatible. + +Upstream-Status: Backport [https://svn.apache.org/repos/asf/serf/trunk r1935023] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + buckets/ssl_buckets.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/buckets/ssl_buckets.c ++++ b/buckets/ssl_buckets.c +@@ -567,11 +567,11 @@ + switch (nm->type) { + case GEN_DNS: + if (copy_action == ErrorOnNul && +- strlen(nm->d.ia5->data) != nm->d.ia5->length) ++ strlen((const char *)ASN1_STRING_get0_data(nm->d.ia5)) != (size_t)ASN1_STRING_length(nm->d.ia5)) + return SERF_ERROR_SSL_CERT_FAILED; + if (san_arr && *san_arr) +- p = pstrdup_escape_nul_bytes((const char *)nm->d.ia5->data, +- nm->d.ia5->length, ++ p = pstrdup_escape_nul_bytes((const char *)ASN1_STRING_get0_data(nm->d.ia5), ++ ASN1_STRING_length(nm->d.ia5), + pool); + break; + default:
meta/recipes-support/serf/serf_1.3.10.bb +1 -0
@@ -10,6 +10,7 @@ SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ file://0002-SConstruct-Fix-path-quoting-for-.def-generator.patch \ file://0003-gen_def.patch \ file://SConstruct.stop.creating.directories.without.sandbox-install.prefix.patch \ + file://0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch \ " SRC_URI[sha256sum] = "be81ef08baa2516ecda76a77adf7def7bc3227eeb578b9a33b45f7b41dc064e6"
RFC v2 5/6 u-boot: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 removed the ENGINE API entirely. u-boot uses ENGINE_get_id, ENGINE_load_public_key, ENGINE_finish, ENGINE_free in lib/rsa/rsa-sign.c which causes link failures on all platforms that build u-boot (including riscv64).
Backport the Provider API support patch from upstream u-boot which adds OpenSSL Provider support while maintaining backward compatibility with older OpenSSL versions that still have ENGINE.
Add the patch to u-boot-common.inc so it applies to both u-boot and u-boot-tools recipes.
Upstream-Status: Submitted [https://github.com/u-boot/u-boot/pull/918]
--- ...Add-support-for-OpenSSL-Provider-API.patch | 300 ++++++++++++++++++ meta/recipes-bsp/u-boot/u-boot-common.inc | 1 + 2 files changed, 301 insertions(+) create mode 100644 meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch
meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch new file +300 -0
@@ -0,0 +1,300 @@ +From a81cb0932dce109af44d7245d47489fe54ae390f Mon Sep 17 00:00:00 2001 +From: Eddie Kovsky <[email protected]> +Date: Mon, 23 Feb 2026 09:43:22 -0700 +Subject: [PATCH] Add support for OpenSSL Provider API + +The Engine API has been deprecated since the release of OpenSSL 3.0. End +users have been advised to migrate to the new Provider interface. +Several distributions have already removed support for engines, which is +preventing U-Boot from being compiled in those environments. + +Add support for the Provider API while continuing to support the existing +Engine API on distros shipping older releases of OpenSSL. + +This is based on similar work contributed by Jan Stancek updating Linux +to use the Provider interface. + + commit 558bdc45dfb2669e1741384a0c80be9c82fa052c + Author: Jan Stancek <[email protected]> + Date: Fri Sep 20 19:52:48 2024 +0300 + + sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 + +The changes have been tested with the FIT signature verification vboot +tests on Fedora 42 and Debian 13. All 30 tests pass with both the legacy +Engine library installed and with the Provider API. + +Signed-off-by: Eddie Kovsky <[email protected]> + +Upstream-Status: Submitted [https://github.com/u-boot/u-boot/pull/918] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + lib/aes/aes-encrypt.c | 4 +- + lib/rsa/rsa-sign.c | 102 +++++++++++++++++++++++++++++++++++++++--- + 2 files changed, 100 insertions(+), 6 deletions(-) + +diff --git a/lib/aes/aes-encrypt.c b/lib/aes/aes-encrypt.c +index 90e1407b4f09..4fc4ce232478 100644 +--- a/lib/aes/aes-encrypt.c ++++ b/lib/aes/aes-encrypt.c +@@ -16,7 +16,9 @@ + #include <openssl/err.h> + #include <openssl/ssl.h> + #include <openssl/evp.h> +-#include <openssl/engine.h> ++#if !defined(OPENSSL_NO_ENGINE) && !defined(OPENSSL_NO_DEPRECATED_3_0) ++# include <openssl/engine.h> ++#endif + #include <uboot_aes.h> + + #if OPENSSL_VERSION_NUMBER >= 0x10000000L +diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c +index 0e38c9e802fd..f456f3c58e65 100644 +--- a/lib/rsa/rsa-sign.c ++++ b/lib/rsa/rsa-sign.c +@@ -19,7 +19,47 @@ + #include <openssl/err.h> + #include <openssl/ssl.h> + #include <openssl/evp.h> +-#include <openssl/engine.h> ++#if OPENSSL_VERSION_MAJOR >= 3 ++# define USE_PKCS11_PROVIDER ++# include <err.h> ++# include <openssl/provider.h> ++# include <openssl/store.h> ++#else ++# if !defined(OPENSSL_NO_ENGINE) && !defined(OPENSSL_NO_DEPRECATED_3_0) ++# define USE_PKCS11_ENGINE ++# include <openssl/engine.h> ++# endif ++#endif ++ ++#ifdef USE_PKCS11_PROVIDER ++#define ERR(cond, fmt, ...) \ ++ do { \ ++ bool __cond = (cond); \ ++ drain_openssl_errors(__LINE__, 0); \ ++ if (__cond) { \ ++ errx(1, fmt, ## __VA_ARGS__); \ ++ } \ ++ } while (0) ++ ++static void drain_openssl_errors(int l, int silent) ++{ ++ const char *file; ++ char buf[120]; ++ int e, line; ++ ++ if (ERR_peek_error() == 0) ++ return; ++ if (!silent) ++ fprintf(stderr, "At main.c:%d:\n", l); ++ ++ while ((e = ERR_peek_error_line(&file, &line))) { ++ ERR_error_string(e, buf); ++ if (!silent) ++ fprintf(stderr, "- SSL %s: %s:%d\n", buf, file, line); ++ ERR_get_error(); ++ } ++} ++#endif + + static int rsa_err(const char *msg) + { +@@ -94,10 +134,11 @@ static int rsa_pem_get_pub_key(const char *keydir, const char *name, EVP_PKEY ** + * + * @keydir: Key prefix + * @name Name of key +- * @engine Engine to use ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_get_pub_key(const char *keydir, const char *name, + ENGINE *engine, EVP_PKEY **evpp) + { +@@ -157,21 +198,24 @@ static int rsa_engine_get_pub_key(const char *keydir, const char *name, + + return 0; + } ++#endif + + /** + * rsa_get_pub_key() - read a public key + * + * @keydir: Directory containing the key (PEM file) or key prefix (engine) + * @name Name of key file (will have a .crt extension) +- * @engine Engine to use ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ + static int rsa_get_pub_key(const char *keydir, const char *name, + ENGINE *engine, EVP_PKEY **evpp) + { ++#ifdef USE_PKCS11_ENGINE + if (engine) + return rsa_engine_get_pub_key(keydir, name, engine, evpp); ++#endif + return rsa_pem_get_pub_key(keydir, name, evpp); + } + +@@ -207,13 +251,44 @@ static int rsa_pem_get_priv_key(const char *keydir, const char *name, + return -ENOENT; + } + ++#ifdef USE_PKCS11_PROVIDER ++ EVP_PKEY *private_key = NULL; ++ OSSL_STORE_CTX *store; ++ ++ if (!OSSL_PROVIDER_try_load(NULL, "pkcs11", true)) ++ ERR(1, "OSSL_PROVIDER_try_load(pkcs11)"); ++ if (!OSSL_PROVIDER_try_load(NULL, "default", true)) ++ ERR(1, "OSSL_PROVIDER_try_load(default)"); ++ ++ store = OSSL_STORE_open(path, NULL, NULL, NULL, NULL); ++ ERR(!store, "OSSL_STORE_open"); ++ ++ while (!OSSL_STORE_eof(store)) { ++ OSSL_STORE_INFO *info = OSSL_STORE_load(store); ++ ++ if (!info) { ++ drain_openssl_errors(__LINE__, 0); ++ continue; ++ } ++ if (OSSL_STORE_INFO_get_type(info) == OSSL_STORE_INFO_PKEY) { ++ private_key = OSSL_STORE_INFO_get1_PKEY(info); ++ ERR(!private_key, "OSSL_STORE_INFO_get1_PKEY"); ++ } ++ OSSL_STORE_INFO_free(info); ++ if (private_key) ++ break; ++ } ++ OSSL_STORE_close(store); ++ ++ *evpp = private_key; ++#else + if (!PEM_read_PrivateKey(f, evpp, NULL, path)) { + rsa_err("Failure reading private key"); + fclose(f); + return -EPROTO; + } + fclose(f); +- ++#endif + return 0; + } + +@@ -226,6 +301,7 @@ static int rsa_pem_get_priv_key(const char *keydir, const char *name, + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_get_priv_key(const char *keydir, const char *name, + const char *keyfile, + ENGINE *engine, EVP_PKEY **evpp) +@@ -293,22 +369,25 @@ static int rsa_engine_get_priv_key(const char *keydir, const char *name, + + return 0; + } ++#endif + + /** + * rsa_get_priv_key() - read a private key + * + * @keydir: Directory containing the key (PEM file) or key prefix (engine) + * @name Name of key +- * @engine Engine to use for signing ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ + static int rsa_get_priv_key(const char *keydir, const char *name, + const char *keyfile, ENGINE *engine, EVP_PKEY **evpp) + { ++#ifdef USE_PKCS11_ENGINE + if (engine) + return rsa_engine_get_priv_key(keydir, name, keyfile, engine, + evpp); ++#endif + return rsa_pem_get_priv_key(keydir, name, keyfile, evpp); + } + +@@ -325,6 +404,7 @@ static int rsa_init(void) + return 0; + } + ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_init(const char *engine_id, ENGINE **pe) + { + const char *key_pass; +@@ -380,6 +460,7 @@ static void rsa_engine_remove(ENGINE *e) + ENGINE_free(e); + } + } ++#endif + + static int rsa_sign_with_key(EVP_PKEY *pkey, struct padding_algo *padding_algo, + struct checksum_algo *checksum_algo, +@@ -480,11 +561,13 @@ int rsa_sign(struct image_sign_info *info, + if (ret) + return ret; + ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) { + ret = rsa_engine_init(info->engine_id, &e); + if (ret) + return ret; + } ++#endif + + ret = rsa_get_priv_key(info->keydir, info->keyname, info->keyfile, + e, &pkey); +@@ -496,16 +579,21 @@ int rsa_sign(struct image_sign_info *info, + goto err_sign; + + EVP_PKEY_free(pkey); ++ ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + + return ret; + + err_sign: + EVP_PKEY_free(pkey); + err_priv: ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + return ret; + } + +@@ -645,11 +733,13 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest) + ENGINE *e = NULL; + + debug("%s: Getting verification data\n", __func__); ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) { + ret = rsa_engine_init(info->engine_id, &e); + if (ret) + return ret; + } ++#endif + ret = rsa_get_pub_key(info->keydir, info->keyname, e, &pkey); + if (ret) + goto err_get_pub_key; +@@ -726,8 +816,10 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest) + err_get_params: + EVP_PKEY_free(pkey); + err_get_pub_key: ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + + if (ret) + return ret;
meta/recipes-bsp/u-boot/u-boot-common.inc +1 -0
@@ -16,6 +16,7 @@ SRCREV = "ece349ade2973e220f524ce59e59711cc919263f" SRC_URI = "git://git.u-boot-project.org/u-boot/u-boot.git;protocol=https;branch=main;tag=v${PV} \ file://0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch \ + file://0001-Add-support-for-OpenSSL-Provider-API.patch \ " B = "${WORKDIR}/build"
Re: [OE-core] [RFC v2 5/6] u-boot: fix build with OpenSSL 4.0
Quoted 5 lines · Jaipaul Cheernam via lists.openembedded.org
OpenSSL 4.0 removed the ENGINE API entirely. u-boot uses
ENGINE_get_id,ENGINE_load_public_key,ENGINE_finish,ENGINE_freeinlib/rsa/rsa-sign.cwhich causes link failures on all platforms that build u-boot (including riscv64).
Quoted 8 lines
Backport the Provider API support patch from upstream u-boot which adds OpenSSL Provider support while maintaining backward compatibility with older OpenSSL versions that still have ENGINE.
Add the patch to u-boot-common.inc so it applies to both u-boot and u-boot-tools recipes.
Upstream-Status: Submitted [https://github.com/u-boot/u-boot/pull/918]
https://lore.kernel.org/u-boot/[email protected]/ is the proper link (please update the one in the patch as well).
From vague recollection, the backward-compatibility shortcomings of the patch should not impact OE-Core as we know for sure it's OpenSSL 4.0 that will be used (which we don't in U-Boot). I think it's still hit by the inablity to use pkcs11 (or other providers) due to trying to find the URI in the local filesystem first.
Fedora 45 will also ship OpenSSL 4.0 as far as I know (hence why we've got a patch from someone at Red Hat).
Feel free to comment on the thread there that this is becoming an issue for OE-Core as well, so that it adds pressure on us fixing it. I was planning on restarting efforts on OpenSSL providers (3.x+) next week though I'm unsure whether I'll manage to send something to the ML in time before I'm out of office the two weeks after.
Cheers,
Quentin
Re: [OE-core] [RFC v2 5/6] u-boot: fix build with OpenSSL 4.0
Hi Quentin,
Thanks for pointing out to correct patch link.
Yes — the upstream patch unconditionally loads the pkcs11 provider and atally errors if it's not installed.
Fixed by making the load non-fatal: default provider loads first (mandatory), pkcs11 is attempted but ERR_clear_error() on failure so file-based signing works without it.
Sent a reply to the u-boot ML thread noting this is needed for OE-Core and sharing our workaround, though it's currently held for moderator approval (!!).
“We're currently working on upgrading OpenEmbedded-Core (Yocto Project) to OpenSSL 4.0.1 and hit this exact issue — mkimage fails at FIT image signing because it unconditionally tries to load the pkcs11 provider, which isn't available in our build environment.
For our purposes, file-based key signing with just the default provider works fine. We're carrying this patch with a local modification that makes the pkcs11 provider load non-fatal:
if (!OSSL_PROVIDER_try_load(NULL, "default", true))
ERR(1, "OSSL_PROVIDER_try_load(default)");
/* pkcs11 provider is optional; only needed for pkcs11: URIs */
if (!OSSL_PROVIDER_try_load(NULL, "pkcs11", true))
ERR_clear_error();This allows signing to work without pkcs11-provider installed while still loading it when available (for pkcs11: URI keys).
Is there a v5 in the works? Happy to test if it would help move this forward. "
Regards,
Jaipaul Cheernam
🔗 EST Website<https://www.est.tech/>
🔗 EST LinkedIn<https://www.linkedin.com/company/ericsson-software-technology/>
From: Quentin Schulz <[email protected]>
Date: Friday, 21 August 2026 at 12:52
To: Jaipaul Cheernam <[email protected]>; [email protected] <[email protected]>
Subject: Re: [OE-core] [RFC v2 5/6] u-boot: fix build with OpenSSL 4.0
Quoted 5 lines · Jaipaul Cheernam via lists.openembedded.org
OpenSSL 4.0 removed the ENGINE API entirely. u-boot uses
ENGINE_get_id,ENGINE_load_public_key,ENGINE_finish,ENGINE_freeinlib/rsa/rsa-sign.cwhich causes link failures on all platforms that build u-boot (including riscv64).
Quoted 8 lines
Backport the Provider API support patch from upstream u-boot which adds OpenSSL Provider support while maintaining backward compatibility with older OpenSSL versions that still have ENGINE.
Add the patch to u-boot-common.inc so it applies to both u-boot and u-boot-tools recipes.
Upstream-Status: Submitted [https://github.com/u-boot/u-boot/pull/918]
https://lore.kernel.org/u-boot/[email protected]/
is the proper link (please update the one in the patch as well).
From vague recollection, the backward-compatibility shortcomings of the
patch should not impact OE-Core as we know for sure it's OpenSSL 4.0 that will be used (which we don't in U-Boot). I think it's still hit by the inablity to use pkcs11 (or other providers) due to trying to find the URI in the local filesystem first.
Fedora 45 will also ship OpenSSL 4.0 as far as I know (hence why we've got a patch from someone at Red Hat).
Feel free to comment on the thread there that this is becoming an issue for OE-Core as well, so that it adds pressure on us fixing it. I was planning on restarting efforts on OpenSSL providers (3.x+) next week though I'm unsure whether I'll manage to send something to the ML in time before I'm out of office the two weeks after.
Cheers,
Quentin
Re: [OE-core] [RFC v2 5/6] u-boot: fix build with OpenSSL 4.0
Hi Jaipaul,
Please avoid top-posting, this is not appropriate etiquette for interacting on mailing lists, c.f. https://www.kernel.org/doc/html/latest/process/submitting-patches.html#use-trimmed-interleaved-replies-in-email-discussions
Quoted 7 lines · Jaipaul Cheernam
Hi Quentin,
Thanks for pointing out to correct patch link.
Yes — the upstream patch unconditionally loads the pkcs11 provider and atally errors if it's not installed.
Fixed by making the load non-fatal: default provider loads first (mandatory), pkcs11 is attempted butERR_clear_error()on failure so file-based signing works without it.
I actually meant something else, but this too apparently was an issue as highlighted by Richard in https://lore.kernel.org/openembedded-core/9a98b9099e927565c0ed867b7598ccea9afdbfe4.camel@linuxfoundation.org/.
What I was worried about is what I reported here (https://lore.kernel.org/u-boot/[email protected]/) in the paragraph starting with "This is sneaky here"). I don't think pkcs11 URI are supported at all because we currently (well, in v4 of the patch) always check if the key exists on the local filesystem, which cannot happen for PKCS11 URI (and if it does, it means nothing anyway as it won't be used). I don't know if anyone's using PKCS11 signing for U-Boot in Yocto but it'd be broken for them then I believe.
Quoted 2 lines
Sent a reply to the u-boot ML thread noting this is needed for OE-Core and sharing our workaround, though it's currently held for moderator approval (!!).
It'll eventually make it to the mailing list once moderators have approved it (can take a few days/weeks). Alternatively, you can subscribe to the mailing list and resend.
Cheers,
Quentin
RFC v2 6/6 kea: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 added const qualifiers to X509_get_subject_name() and X509_get_issuer_name() return types. kea assigns these to non-const pointers causing compilation errors with -fpermissive.
Add const qualifiers to X509_NAME and X509_NAME_ENTRY pointer declarations in openssl_tls.h.
Tracked upstream: https://gitlab.isc.org/isc-projects/kea/-/issues/4673
(milestone: kea3.3.2, labeled: backport-candidate)
Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/issues/4673]
--- ...-qualifiers-to-OpenSSL-X509-pointers.patch | 49 +++++++++++++++++++ meta/recipes-connectivity/kea/kea_3.2.0.bb | 1 + 2 files changed, 50 insertions(+) create mode 100644 meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch
meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch new file +49 -0
@@ -0,0 +1,49 @@ +From 82d28b1be73bbc00e73e59d0c59c51a1e76519a5 Mon Sep 17 00:00:00 2001 +From: Simo Sorce <[email protected]> +Date: Mon, 27 Apr 2026 17:49:56 -0400 +Subject: [PATCH] Add const qualifiers to OpenSSL X509 pointers + +Added const qualifiers to the X509_NAME and X509_NAME_ENTRY pointers when +retrieving subject and issuer names from TLS certificates. This ensures const- +correctness and maintains compatibility with newer OpenSSL versions, which +return const pointers from these getter functions. + +Signed-off-by: Simo Sorce <[email protected]> + +Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/issues/4673] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + src/lib/asiolink/openssl_tls.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/lib/asiolink/openssl_tls.h b/src/lib/asiolink/openssl_tls.h +index 57c3323..52a969b 100644 +--- a/src/lib/asiolink/openssl_tls.h ++++ b/src/lib/asiolink/openssl_tls.h +@@ -175,9 +175,9 @@ public: + if (!cert) { + return (""); + } +- ::X509_NAME *name = ::X509_get_subject_name(cert); ++ const ::X509_NAME *name = ::X509_get_subject_name(cert); + int loc = ::X509_NAME_get_index_by_NID(name, NID_commonName, -1); +- ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); ++ const ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); + if (!ne) { + ::X509_free(cert); + return (""); +@@ -209,9 +209,9 @@ public: + if (!cert) { + return (""); + } +- ::X509_NAME *name = ::X509_get_issuer_name(cert); ++ const ::X509_NAME *name = ::X509_get_issuer_name(cert); + int loc = ::X509_NAME_get_index_by_NID(name, NID_commonName, -1); +- ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); ++ const ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); + if (!ne) { + ::X509_free(cert); + return (""); +-- +2.53.0 +
meta/recipes-connectivity/kea/kea_3.2.0.bb +1 -0
@@ -19,6 +19,7 @@ SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.xz \ file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \ file://0001-meson-use-a-runtime-safe-interpreter-string.patch \ file://0001-mk_cfgrpt.sh-strip-prefixes.patch \ + file://0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch \ " SRC_URI[sha256sum] = "14bf695d37b65b9b1bf550fea5d0adaf9806c50e5419ef2a176a4b8e9aade3df"
Quoted 43 lines · Jaipaul Cheernam via lists.openembedded.org
This series upgrades OpenSSL from 3.5.7 to 4.0.1 and fixes all dependent recipes that break due to API changes in OpenSSL 4.0.
Changes since v1:
- u-boot: moved patch from u-boot-tools_2026.07.bb to u-boot-common.inc so it applies to both u-boot and u-boot-tools (fixes riscv64 build failure reported from autobuilder)
- u-boot, kea: corrected Upstream-Status from Backport to Submitted (neither has been merged upstream yet)
- Dropped rust 1.97.1 from this series (now merged in master)
- No external dependencies — wpa-supplicant 2.12 and rust 1.97.1 are both merged in master nowOpenSSL 4.0 is a major release with several breaking changes:
- ENGINE API fully removed
- SSLv3 support removed
- Per-version TLS method functions (SSLv3_methodetc.) removed
-ASN1_STRINGmade opaque
- const qualifiers added to X509 getter functionsPatches:
1/6 openssl: upgrade 3.5.7 -> 4.0.1
2/6 python3: backport OpenSSL 4.0 support (CPython commit3364e7e62fa2) 3/6 socat: fixASN1_STRINGopaque struct access
4/6 serf: fixASN1_STRINGopaque struct access
5/6 u-boot: backport Provider API (replaces removed ENGINE API) 6/6 kea: add const qualifiers to X509 pointersTesting:
- bitbake world -k: passes on qemux86-64, qemuarm64, qemuarm, qemuriscv64
- openssl ptest on qemux86-64: 362 files, 4310 tests, all passed (338 passed, 24 skipped - fips/lms/rc5/tfo/compression - all expected)Sharing this to get feedback and see if there are other recipes that break with OpenSSL 4.0 that we may have missed.
Notes on upstream status:
- python3: fix on CPython main, backport PR #146403 closed without merge
- socat: submitted to [email protected]
- serf: fix in trunk (r1935023), no release yet
- u-boot: PR #918 open since March 2026, under review
- kea: tracked as issue #4673, milestone kea3.3.2
Quoted 7 lines
Jaipaul Cheernam (6):
openssl: upgrade 3.5.7 -> 4.0.1
python3: backport OpenSSL 4.0 support from upstream
socat: fix build with OpenSSL 4.0
serf: fix build with OpenSSL 4.0
u-boot: fix build with OpenSSL 4.0
kea: fix build with OpenSSL 4.0
Thanks for putting this together. It is definitely getting there but there were some issues.
There are some failing selftests:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/4629
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/4449
and python ptest doesn't look happy:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/73/builds/4352
https://autobuilder.yoctoproject.org/valkyrie/#/builders/110/builds/1004
and multilib looks broken:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/92/builds/4423
https://autobuilder.yoctoproject.org/valkyrie/#/builders/59/builds/4476
Nothing too unexpected with a change that invasive though!
Cheers,
Richard
v3 cover openssl: upgrade 3.5.7 -> 4.0.1
In reply to Jaipaul CheernamUpgrade OpenSSL from 3.5.7 to 4.0.1 and fix all dependent recipe breakages in oe-core.
OpenSSL 4.0 is a major version bump that removes the ENGINE API, removes the c_rehash script, makes ASN1_STRING fully opaque, adds const qualifiers to X509 accessor return types, and removes per-version TLS method functions.
This series fixes python3, socat, serf, u-boot, and kea to build against OpenSSL 4.0.
Changes since v2:
- openssl: remove c_rehash from MULTILIB_SCRIPTS and FILES (fixes multilib do_package failure)
- python3: add backports from CPython PR #149783 for the got_eof_error fix (fixes test_https/test_https_sni ptest failures caused by OpenSSL 4.0 changing EOF signaling behavior)
- u-boot: update Upstream-Status to lore link per reviewer feedback, include doc/Dockerfile hunks from upstream v4, make pkcs11 provider loading optional (fixes fitimage signing failure when pkcs11-provider is not installed)
Changes since v1:
- u-boot: move patch from u-boot-tools to u-boot-common.inc (fixes riscv64 build failure)
- serf/socat: fix Upstream-Status tags
Testing:
- lib32-openssl do_package: passes (multilib fix verified)
- python3 test_https/test_https_sni: passes locally with got_eof_error backport
- u-boot fitimage signing: passes locally with pkcs11-optional fix
Notes on upstream status:
- python3: CPython PR #149783 (3.14 backport) closed by maintainer, deferred until after Python 3.15.1. Pyenv carries it downstream.
- socat: submitted to [email protected]
- serf: fix in trunk (r1935023), no release yet
- u-boot: v4 on ML under review (changes-requested), lore link:
https://lore.kernel.org/u-boot/[email protected]/
- kea: tracked as issue #4673, milestone kea3.3.2
Jaipaul Cheernam (6):
openssl: upgrade 3.5.7 -> 4.0.1
python3: backport OpenSSL 4.0 support from upstream
socat: fix build with OpenSSL 4.0
serf: fix build with OpenSSL 4.0
u-boot: fix build with OpenSSL 4.0
kea: fix build with OpenSSL 4.0
...Add-support-for-OpenSSL-Provider-API.patch | 340 ++++++++++++++++
meta/recipes-bsp/u-boot/u-boot-common.inc | 1 +
...-qualifiers-to-OpenSSL-X509-pointers.patch | 49 +++
meta/recipes-connectivity/kea/kea_3.2.0.bb | 1 +
...ke-history-reporting-when-test-fails.patch | 366 ------------------
...1-Configure-do-not-tweak-mips-cflags.patch | 6 +-
...sysroot-and-debug-prefix-map-from-co.patch | 11 +-
.../0001-extend-check_cwm-test-timeout.patch | 4 +-
.../{openssl_3.5.7.bb => openssl_4.0.1.bb} | 28 +-
...penSSL-4.0-use-ASN1_STRING-accessors.patch | 31 ++
.../socat/socat_1.8.1.3.bb | 1 +
...146207-Add-support-for-OpenSSL-4.0.0.patch | 257 ++++++++++++
...Update-_ssl._SSLSocket-for-OpenSSL-4.patch | 234 +++++++++++
...utdown-test-in-test_ssl.test_got_eof.patch | 41 ++
.../recipes-devtools/python/python3_3.14.7.bb | 3 +
...penSSL-4.0-use-ASN1_STRING-accessors.patch | 35 ++
meta/recipes-support/serf/serf_1.3.10.bb | 1 +
17 files changed, 1012 insertions(+), 397 deletions(-)
create mode 100644 meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch
create mode 100644 meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch
delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch
rename meta/recipes-connectivity/openssl/{openssl_3.5.7.bb => openssl_4.0.1.bb} (87%)
create mode 100644 meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
create mode 100644 meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch
create mode 100644 meta/recipes-devtools/python/python3/0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch
create mode 100644 meta/recipes-devtools/python/python3/0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch
create mode 100644 meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patchRFC v3 1/6 openssl: upgrade 3.5.7 -> 4.0.1
Upgrade OpenSSL from 3.5.7 to 4.0.1. This is a major version upgrade.
Changelog: https://github.com/openssl/openssl/blob/openssl-4.0.1/CHANGES.md
New CVE fixes not already in 3.5.7:
* CVE-2026-28386: Fixed OOB read in AES-CFB-128 on x86-64 with AVX-512
* CVE-2026-35188: Fixed double-free when checking OCSP stapled response
* CVE-2026-42765: Fixed NULL deref in cert verification with OCSP
* CVE-2026-42771: Fixed OOB read in X509_VERIFY_PARAM_set1_email()
Major breaking changes in 4.0.0:
* Removed support for engines. The ENGINE API is fully removed.
* Removed support for SSLv3. SSLv3 has been deprecated since 2015.
* Removed support for the SSLv2 Client Hello.
* Removed per-version TLS method functions (SSLv3_method(),
TLSv1_method(), TLSv1_1_method(), TLSv1_2_method()).
* Removed c_rehash script tool. Use 'openssl rehash' instead.
* ASN1_STRING has been made opaque.
* Numerous API function signatures changed to include const qualifiers.
* libcrypto no longer cleans up globally allocated data via atexit().
* Added AKID verification checks when X509_V_FLAG_X509_STRICT is set.
* Support of deprecated elliptic curves in TLS disabled at compile-time by default.
Recipe changes:
* Drop 0001-Added-handshake-history-reporting-when-test-fails.patch
(merged upstream via PR #22481).
* Refresh remaining patches against the new version.
* Remove ENGINE API artifacts: engines package, dasync.so/ossltest.so ptest installation, ENGINESDIR references, OPENSSL_ENGINES wrapper variable, and cryptodev-linux PACKAGECONFIG.
Tested: ptest on qemux86-64:
Files=362, Tests=4310, Result: PASS
Passed: 338, Skipped: 24 (fips, lms, rc5, tfo, compression, sslversions, sslkeylogfile, external tests - all expected)
Failed: 0
---
...ke-history-reporting-when-test-fails.patch | 366 ------------------
...1-Configure-do-not-tweak-mips-cflags.patch | 6 +-
...sysroot-and-debug-prefix-map-from-co.patch | 11 +-
.../0001-extend-check_cwm-test-timeout.patch | 4 +-
.../{openssl_3.5.7.bb => openssl_4.0.1.bb} | 28 +-
5 files changed, 18 insertions(+), 397 deletions(-)
delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch
rename meta/recipes-connectivity/openssl/{openssl_3.5.7.bb => openssl_4.0.1.bb} (87%)meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0 -366
@@ -1,366 +0,0 @@ -From 5ba65051fea0513db0d997f0ab7cafb9826ed74a Mon Sep 17 00:00:00 2001 -From: William Lyu <[email protected]> -Date: Fri, 20 Oct 2023 16:22:37 -0400 -Subject: [PATCH] Added handshake history reporting when test fails - -Upstream-Status: Submitted [https://github.com/openssl/openssl/pull/22481] - -Signed-off-by: William Lyu <[email protected]> ---- - test/helpers/handshake.c | 136 ++++++++++++++++++++++++++++++--------- - test/helpers/handshake.h | 70 +++++++++++++++++++- - test/ssl_test.c | 44 +++++++++++++ - 3 files changed, 217 insertions(+), 33 deletions(-) - -diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c -index f611b3a..5703b48 100644 ---- a/test/helpers/handshake.c -+++ b/test/helpers/handshake.c -@@ -25,6 +25,102 @@ - #include <netinet/sctp.h> - #endif - -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+/* Maps string names to various enumeration type */ -+typedef struct { -+ const char *name; -+ int value; -+} enum_name_map; -+ -+static const enum_name_map connect_phase_names[] = { -+ {"Handshake", HANDSHAKE}, -+ {"RenegAppData", RENEG_APPLICATION_DATA}, -+ {"RenegSetup", RENEG_SETUP}, -+ {"RenegHandshake", RENEG_HANDSHAKE}, -+ {"AppData", APPLICATION_DATA}, -+ {"Shutdown", SHUTDOWN}, -+ {"ConnectionDone", CONNECTION_DONE} -+}; -+ -+static const enum_name_map peer_status_names[] = { -+ {"PeerSuccess", PEER_SUCCESS}, -+ {"PeerRetry", PEER_RETRY}, -+ {"PeerError", PEER_ERROR}, -+ {"PeerWaiting", PEER_WAITING}, -+ {"PeerTestFail", PEER_TEST_FAILURE} -+}; -+ -+static const enum_name_map handshake_status_names[] = { -+ {"HandshakeSuccess", HANDSHAKE_SUCCESS}, -+ {"ClientError", CLIENT_ERROR}, -+ {"ServerError", SERVER_ERROR}, -+ {"InternalError", INTERNAL_ERROR}, -+ {"HandshakeRetry", HANDSHAKE_RETRY} -+}; -+ -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+static const char *enum_name(const enum_name_map *enums, size_t num_enums, -+ int value) -+{ -+ size_t i; -+ for (i = 0; i < num_enums; i++) { -+ if (enums[i].value == value) { -+ return enums[i].name; -+ } -+ } -+ return "InvalidValue"; -+} -+ -+const char *handshake_connect_phase_name(connect_phase_t phase) -+{ -+ return enum_name(connect_phase_names, OSSL_NELEM(connect_phase_names), -+ (int)phase); -+} -+ -+const char *handshake_status_name(handshake_status_t handshake_status) -+{ -+ return enum_name(handshake_status_names, OSSL_NELEM(handshake_status_names), -+ (int)handshake_status); -+} -+ -+const char *handshake_peer_status_name(peer_status_t peer_status) -+{ -+ return enum_name(peer_status_names, OSSL_NELEM(peer_status_names), -+ (int)peer_status); -+} -+ -+static void save_loop_history(HANDSHAKE_HISTORY *history, -+ connect_phase_t phase, -+ handshake_status_t handshake_status, -+ peer_status_t server_status, -+ peer_status_t client_status, -+ int client_turn_count, -+ int is_client_turn) -+{ -+ HANDSHAKE_HISTORY_ENTRY *new_entry = NULL; -+ -+ /* -+ * Create a new history entry for a handshake loop with statuses given in -+ * the arguments. Potentially evicting the oldest entry when the -+ * ring buffer is full. -+ */ -+ ++(history->last_idx); -+ history->last_idx &= MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ -+ new_entry = &((history->entries)[history->last_idx]); -+ new_entry->phase = phase; -+ new_entry->handshake_status = handshake_status; -+ new_entry->server_status = server_status; -+ new_entry->client_status = client_status; -+ new_entry->client_turn_count = client_turn_count; -+ new_entry->is_client_turn = is_client_turn; -+ -+ /* Evict the oldest handshake loop entry when the ring buffer is full. */ -+ if (history->entry_count < MAX_HANDSHAKE_HISTORY_ENTRY) { -+ ++(history->entry_count); -+ } -+} -+ - HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void) - { - HANDSHAKE_RESULT *ret; -@@ -724,15 +820,6 @@ static void configure_handshake_ssl(SSL *server, SSL *client, - SSL_set_post_handshake_auth(client, 1); - } - --/* The status for each connection phase. */ --typedef enum { -- PEER_SUCCESS, -- PEER_RETRY, -- PEER_ERROR, -- PEER_WAITING, -- PEER_TEST_FAILURE --} peer_status_t; -- - /* An SSL object and associated read-write buffers. */ - typedef struct peer_st { - SSL *ssl; -@@ -1077,16 +1164,6 @@ static void do_shutdown_step(PEER *peer) - } - } - --typedef enum { -- HANDSHAKE, -- RENEG_APPLICATION_DATA, -- RENEG_SETUP, -- RENEG_HANDSHAKE, -- APPLICATION_DATA, -- SHUTDOWN, -- CONNECTION_DONE --} connect_phase_t; -- - static int renegotiate_op(const SSL_TEST_CTX *test_ctx) - { - switch (test_ctx->handshake_mode) { -@@ -1164,19 +1241,6 @@ static void do_connect_step(const SSL_TEST_CTX *test_ctx, PEER *peer, - } - } - --typedef enum { -- /* Both parties succeeded. */ -- HANDSHAKE_SUCCESS, -- /* Client errored. */ -- CLIENT_ERROR, -- /* Server errored. */ -- SERVER_ERROR, -- /* Peers are in inconsistent state. */ -- INTERNAL_ERROR, -- /* One or both peers not done. */ -- HANDSHAKE_RETRY --} handshake_status_t; -- - /* - * Determine the handshake outcome. - * last_status: the status of the peer to have acted last. -@@ -1541,6 +1605,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( - - start = time(NULL); - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - /* - * Half-duplex handshake loop. - * Client and server speak to each other synchronously in the same process. -@@ -1562,6 +1630,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( - 0 /* server went last */); - } - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - switch (status) { - case HANDSHAKE_SUCCESS: - client_turn_count = 0; -diff --git a/test/helpers/handshake.h b/test/helpers/handshake.h -index 78b03f9..b9967c2 100644 ---- a/test/helpers/handshake.h -+++ b/test/helpers/handshake.h -@@ -1,5 +1,5 @@ - /* -- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. -+ * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy -@@ -12,6 +12,11 @@ - - #include "ssl_test_ctx.h" - -+#define MAX_HANDSHAKE_HISTORY_ENTRY_BIT 4 -+#define MAX_HANDSHAKE_HISTORY_ENTRY (1 << MAX_HANDSHAKE_HISTORY_ENTRY_BIT) -+#define MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK \ -+ ((1 << MAX_HANDSHAKE_HISTORY_ENTRY_BIT) - 1) -+ - typedef struct ctx_data_st { - unsigned char *npn_protocols; - size_t npn_protocols_len; -@@ -22,6 +27,63 @@ typedef struct ctx_data_st { - char *session_ticket_app_data; - } CTX_DATA; - -+typedef enum { -+ HANDSHAKE, -+ RENEG_APPLICATION_DATA, -+ RENEG_SETUP, -+ RENEG_HANDSHAKE, -+ APPLICATION_DATA, -+ SHUTDOWN, -+ CONNECTION_DONE -+} connect_phase_t; -+ -+/* The status for each connection phase. */ -+typedef enum { -+ PEER_SUCCESS, -+ PEER_RETRY, -+ PEER_ERROR, -+ PEER_WAITING, -+ PEER_TEST_FAILURE -+} peer_status_t; -+ -+typedef enum { -+ /* Both parties succeeded. */ -+ HANDSHAKE_SUCCESS, -+ /* Client errored. */ -+ CLIENT_ERROR, -+ /* Server errored. */ -+ SERVER_ERROR, -+ /* Peers are in inconsistent state. */ -+ INTERNAL_ERROR, -+ /* One or both peers not done. */ -+ HANDSHAKE_RETRY -+} handshake_status_t; -+ -+/* Stores the various status information in a handshake loop. */ -+typedef struct handshake_history_entry_st { -+ connect_phase_t phase; -+ handshake_status_t handshake_status; -+ peer_status_t server_status; -+ peer_status_t client_status; -+ int client_turn_count; -+ int is_client_turn; -+} HANDSHAKE_HISTORY_ENTRY; -+ -+typedef struct handshake_history_st { -+ /* Implemented using ring buffer. */ -+ /* -+ * The valid entries are |entries[last_idx]|, |entries[last_idx-1]|, -+ * ..., etc., going up to |entry_count| number of entries. Note that when -+ * the index into the array |entries| becomes < 0, we wrap around to -+ * the end of |entries|. -+ */ -+ HANDSHAKE_HISTORY_ENTRY entries[MAX_HANDSHAKE_HISTORY_ENTRY]; -+ /* The number of valid entries in |entries| array. */ -+ size_t entry_count; -+ /* The index of the last valid entry in the |entries| array. */ -+ size_t last_idx; -+} HANDSHAKE_HISTORY; -+ - typedef struct handshake_result { - ssl_test_result_t result; - /* These alerts are in the 2-byte format returned by the info_callback. */ -@@ -77,6 +139,8 @@ typedef struct handshake_result { - char *cipher; - /* session ticket application data */ - char *result_session_ticket_app_data; -+ /* handshake loop history */ -+ HANDSHAKE_HISTORY history; - } HANDSHAKE_RESULT; - - HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void); -@@ -95,4 +159,8 @@ int configure_handshake_ctx_for_srp(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, - CTX_DATA *server2_ctx_data, - CTX_DATA *client_ctx_data); - -+const char *handshake_connect_phase_name(connect_phase_t phase); -+const char *handshake_status_name(handshake_status_t handshake_status); -+const char *handshake_peer_status_name(peer_status_t peer_status); -+ - #endif /* OSSL_TEST_HANDSHAKE_HELPER_H */ -diff --git a/test/ssl_test.c b/test/ssl_test.c -index ea60851..9d6b093 100644 ---- a/test/ssl_test.c -+++ b/test/ssl_test.c -@@ -26,6 +26,44 @@ static OSSL_LIB_CTX *libctx = NULL; - /* Currently the section names are of the form test-<number>, e.g. test-15. */ - #define MAX_TESTCASE_NAME_LENGTH 100 - -+static void print_handshake_history(const HANDSHAKE_HISTORY *history) -+{ -+ size_t first_idx; -+ size_t i; -+ size_t cur_idx; -+ const HANDSHAKE_HISTORY_ENTRY *cur_entry; -+ const char header_template[] = "|%14s|%16s|%16s|%16s|%17s|%14s|"; -+ const char body_template[] = "|%14s|%16s|%16s|%16s|%17d|%14s|"; -+ -+ TEST_info("The following is the server/client state " -+ "in the most recent %d handshake loops.", -+ MAX_HANDSHAKE_HISTORY_ENTRY); -+ -+ TEST_note("==================================================" -+ "=================================================="); -+ TEST_note(header_template, -+ "phase", "handshake status", "server status", -+ "client status", "client turn count", "is client turn"); -+ TEST_note("+--------------+----------------+----------------" -+ "+----------------+-----------------+--------------+"); -+ -+ first_idx = (history->last_idx - history->entry_count + 1) & -+ MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ for (i = 0; i < history->entry_count; ++i) { -+ cur_idx = (first_idx + i) & MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ cur_entry = &(history->entries)[cur_idx]; -+ TEST_note(body_template, -+ handshake_connect_phase_name(cur_entry->phase), -+ handshake_status_name(cur_entry->handshake_status), -+ handshake_peer_status_name(cur_entry->server_status), -+ handshake_peer_status_name(cur_entry->client_status), -+ cur_entry->client_turn_count, -+ cur_entry->is_client_turn ? "true" : "false"); -+ } -+ TEST_note("==================================================" -+ "=================================================="); -+} -+ - static const char *print_alert(int alert) - { - return alert ? SSL_alert_desc_string_long(alert) : "no alert"; -@@ -388,6 +426,12 @@ static int check_test(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) - ret &= check_client_sign_type(result, test_ctx); - ret &= check_client_ca_names(result, test_ctx); - } -+ -+ /* Print handshake loop history if any check fails. */ -+ if (!ret) { -+ print_handshake_history(&(result->history)); -+ } -+ - return ret; - } - --- -2.25.1 -
meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch +3 -3
@@ -1,4 +1,4 @@ -From 0377f0d5b5c1079e3b9a80881f4dcc891cbe9f9a Mon Sep 17 00:00:00 2001 +From b5cee0cb0f14a78056ef7722a34b361491f1fdda Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <[email protected]> Date: Tue, 30 May 2023 09:11:27 -0700 Subject: [PATCH] Configure: do not tweak mips cflags
@@ -17,10 +17,10 @@ Signed-off-by: Tim Orling <[email protected]> 1 file changed, 10 deletions(-) diff --git a/Configure b/Configure -index fff97bd..5ee54c1 100755 +index c05a30b..db8adee 100755 --- a/Configure +++ b/Configure -@@ -1557,16 +1557,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) +@@ -1575,16 +1575,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) push @{$config{shared_ldflag}}, "-mno-cygwin"; }
meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +5 -6
@@ -1,4 +1,4 @@ -From 5985253f2c9025d7c127443a3a9938946f80c2a1 Mon Sep 17 00:00:00 2001 +From 6df53bfebcf8ca65910a18220a6576fb110918a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <[email protected]> Date: Tue, 6 Nov 2018 14:50:47 +0100 Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map from compiler
@@ -28,17 +28,16 @@ Signed-off-by: Kai Kang <[email protected]> Update to fix buildpaths qa issue for '-ffile-prefix-map'. Signed-off-by: Khem Raj <[email protected]> - --- Configurations/unix-Makefile.tmpl | 16 +++++++++++++++- crypto/build.info | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl -index 09303c4..011bda1 100644 +index eff66e5..bc48f51 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl -@@ -514,13 +514,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), +@@ -503,13 +503,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
@@ -68,10 +67,10 @@ index 09303c4..011bda1 100644 # For x86 assembler: Set PROCESSOR to 386 if you want to support diff --git a/crypto/build.info b/crypto/build.info -index aee5c46..95c9577 100644 +index 8e4a885..95b0902 100644 --- a/crypto/build.info +++ b/crypto/build.info -@@ -115,7 +115,7 @@ DEFINE[../libcrypto]=$UPLINKDEF +@@ -114,7 +114,7 @@ DEFINE[../libcrypto]=$UPLINKDEF DEPEND[info.o]=buildinf.h DEPEND[cversion.o]=buildinf.h
meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patch +2 -2
@@ -1,4 +1,4 @@ -From c7000672296f4c367341aa3415f26c4d9f5e4749 Mon Sep 17 00:00:00 2001 +From 14856dbd767621ce6f162680c00557b54af0effb Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari <[email protected]> Date: Thu, 23 Oct 2025 11:24:36 +0200 Subject: [PATCH] extend check_cwm test timeout
@@ -15,7 +15,7 @@ Signed-off-by: Gyorgy Sarvari <[email protected]> 1 file changed, 5 insertions(+) diff --git a/test/radix/main.c b/test/radix/main.c -index 4a1e886a71..39f8c61ef9 100644 +index 0f3dc11..d925639 100644 --- a/test/radix/main.c +++ b/test/radix/main.c @@ -25,6 +25,11 @@ static int test_script(int idx)
meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +8 -20
@@ -11,7 +11,6 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ file://run-ptest \ file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ file://0001-Configure-do-not-tweak-mips-cflags.patch \ - file://0001-Added-handshake-history-reporting-when-test-fails.patch \ file://0001-extend-check_cwm-test-timeout.patch \ "
@@ -19,10 +18,9 @@ SRC_URI:append:class-nativesdk = " \ file://environment.d-openssl.sh \ " -SRC_URI[sha256sum] = "a8c0d28a529ca480f9f36cf5792e2cd21984552a3c8e4aa11a24aa31aeac98e8" +SRC_URI[sha256sum] = "2db3f3a0d6ea4b59e1f094ace2c8cd536dffb87cdc39084c5afa1e6f7f37dd09" -inherit lib_package multilib_header multilib_script ptest perlnative manpages -MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" +inherit lib_package multilib_header ptest perlnative manpages # OpenSSL publishes bugfix/security-only releases on its per-minor branches. # When the tracked series reaches EOL, bump the regex manually to the next
@@ -33,7 +31,6 @@ PACKAGECONFIG ?= "" PACKAGECONFIG:class-native = "" PACKAGECONFIG:class-nativesdk = "" -PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module" PACKAGECONFIG[legacy] = ",no-legacy" PACKAGECONFIG[tls1] = ",no-tls1" PACKAGECONFIG[tls1_1] = ",no-tls1_1"
@@ -57,8 +54,8 @@ EXTRA_OECONF:append:class-native = " --with-rand-seed=os,devrandom" EXTRA_OECONF:append:class-nativesdk = " --with-rand-seed=os,devrandom" # Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate. -EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' -EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"' #| threads_pthread.c:(.text+0x372): undefined reference to `__atomic_is_lock_free' EXTRA_OECONF:append:toolchain-clang:x86 = " -latomic"
@@ -204,12 +201,10 @@ do_install:append:class-native () { OPENSSL_CONF=\${OPENSSL_CONF:-${libdir}/ssl-3/openssl.cnf} \ SSL_CERT_DIR=\${SSL_CERT_DIR:-${libdir}/ssl-3/certs} \ SSL_CERT_FILE=\${SSL_CERT_FILE:-${libdir}/ssl-3/cert.pem} \ - OPENSSL_ENGINES=\${OPENSSL_ENGINES:-${libdir}/engines-3} \ OPENSSL_MODULES=\${OPENSSL_MODULES:-${libdir}/ossl-modules} - # Setting ENGINESDIR and MODULESDIR to invalid paths prevents host contamination, + # Setting MODULESDIR to invalid paths prevents host contamination, # but also breaks the generated libcrypto.pc file. Post-Fix it manually here. - sed -i 's|^enginesdir=\($.libdir.\)/.*|enginesdir=\1/engines-3|' ${D}${libdir}/pkgconfig/libcrypto.pc sed -i 's|^modulesdir=\($.libdir.\)/.*|modulesdir=\1/ossl-modules|' ${D}${libdir}/pkgconfig/libcrypto.pc }
@@ -252,10 +247,6 @@ do_install_ptest() { sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm ${D}${PTEST_PATH}/util/wrap.pl - install -d ${D}${PTEST_PATH}/engines - install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines/ - install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines/ - ln -s ${libdir}/engines-3/loader_attic.so ${D}${PTEST_PATH}/engines/ ln -s ${libdir}/ossl-modules/ ${D}${PTEST_PATH}/providers }
@@ -270,17 +261,14 @@ pkg_postinst_ontarget:${PN}-ossl-module-fips () { # file to be installed for both the openssl-bin package and the libcrypto # package since the openssl-bin package depends on the libcrypto package. -PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips" +PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips" FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}" FILES:libssl = "${libdir}/libssl${SOLIBS}" FILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf* \ ${libdir}/ssl-3/openssl.cnf* \ " -FILES:${PN}-engines = "${libdir}/engines-3" -# ${prefix} comes from what we pass into --prefix at configure time (which is used for INSTALLTOP) -FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3" -FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash" +FILES:${PN}-misc = "${libdir}/ssl-3/misc" FILES:${PN}-ossl-module-legacy = "${libdir}/ossl-modules/legacy.so" FILES:${PN}-ossl-module-fips = "${libdir}/ossl-modules/fips.so" FILES:${PN} =+ "${libdir}/ssl-3/* ${libdir}/ossl-modules/"
@@ -290,7 +278,7 @@ CONFFILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf" RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy" RDEPENDS:${PN}-misc = "perl" -RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed openssl-engines" +RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed" RRECOMMENDS:${PN}-ptest += "${PN}-ossl-module-legacy" RDEPENDS:${PN}-bin += "openssl-conf"
RFC v3 2/6 python3: backport OpenSSL 4.0 support from upstream
In reply to Jaipaul CheernamBackport CPython commit 3364e7e62fa24d0e19133fb0f90b1c24ef1110c5:
gh-146207: Add support for OpenSSL 4.0.0 alpha1 (#146217)
OpenSSL 4.0.0 alpha1 removed these functions:
* SSLv3_method()
* TLSv1_method()
* TLSv1_1_method()
* TLSv1_2_method()
Other changes:
* Update test_openssl_version().
* Update multissltests.py for OpenSSL 4.
* Add const qualifier to fix compiler warnings.
Upstream-Status: Backport [https://github.com/python/cpython/commit/3364e7e62fa24d0e19133fb0f90b1c24ef1110c5]
--- ...146207-Add-support-for-OpenSSL-4.0.0.patch | 257 ++++++++++++++++++ ...Update-_ssl._SSLSocket-for-OpenSSL-4.patch | 234 ++++++++++++++++ ...utdown-test-in-test_ssl.test_got_eof.patch | 41 +++ .../recipes-devtools/python/python3_3.14.7.bb | 3 + 4 files changed, 535 insertions(+) create mode 100644 meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch create mode 100644 meta/recipes-devtools/python/python3/0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch create mode 100644 meta/recipes-devtools/python/python3/0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch
meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch new file +257 -0
@@ -0,0 +1,257 @@ +From 3364e7e62fa24d0e19133fb0f90b1c24ef1110c5 Mon Sep 17 00:00:00 2001 +From: Victor Stinner <[email protected]> +Date: Wed, 25 Mar 2026 07:44:47 +0100 +Subject: [PATCH] gh-146207: Add support for OpenSSL 4.0.0 alpha1 (#146217) + +OpenSSL 4.0.0 alpha1 removed these functions: + +* SSLv3_method() +* TLSv1_method() +* TLSv1_1_method() +* TLSv1_2_method() + +Other changes: + +* Update test_openssl_version(). +* Update multissltests.py for OpenSSL 4. +* Add const qualifier to fix compiler warnings. + +Co-authored-by: Bénédikt Tran <[email protected]> +Signed-off-by: Victor Stinner <[email protected]> + +Upstream-Status: Backport [https://github.com/python/cpython/commit/3364e7e62fa24d0e19133fb0f90b1c24ef1110c5] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + Lib/test/test_ssl.py | 52 ++++++++++++++++++++------------------ + Modules/_ssl.c | 27 ++++++++++++++++---- + Modules/_ssl/cert.c | 3 ++- + Tools/ssl/multissltests.py | 7 ++++- + 4 files changed, 58 insertions(+), 31 deletions(-) + +diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py +index dc795c6bd8a..61355927296 100644 +--- a/Lib/test/test_ssl.py ++++ b/Lib/test/test_ssl.py +@@ -395,7 +395,7 @@ def test_constants(self): + ssl.OP_NO_COMPRESSION + self.assertEqual(ssl.HAS_SNI, True) + self.assertEqual(ssl.HAS_ECDH, True) +- self.assertEqual(ssl.HAS_TLSv1_2, True) ++ self.assertIsInstance(ssl.HAS_TLSv1_2, bool) + self.assertEqual(ssl.HAS_TLSv1_3, True) + ssl.OP_NO_SSLv2 + ssl.OP_NO_SSLv3 +@@ -586,11 +586,11 @@ def test_openssl_version(self): + # Some sanity checks follow + # >= 1.1.1 + self.assertGreaterEqual(n, 0x10101000) +- # < 4.0 +- self.assertLess(n, 0x40000000) ++ # < 5.0 ++ self.assertLess(n, 0x50000000) + major, minor, fix, patch, status = t + self.assertGreaterEqual(major, 1) +- self.assertLess(major, 4) ++ self.assertLess(major, 5) + self.assertGreaterEqual(minor, 0) + self.assertLess(minor, 256) + self.assertGreaterEqual(fix, 0) +@@ -656,12 +656,14 @@ def test_openssl111_deprecations(self): + ssl.OP_NO_TLSv1_2, + ssl.OP_NO_TLSv1_3 + ] +- protocols = [ +- ssl.PROTOCOL_TLSv1, +- ssl.PROTOCOL_TLSv1_1, +- ssl.PROTOCOL_TLSv1_2, +- ssl.PROTOCOL_TLS +- ] ++ protocols = [] ++ if hasattr(ssl, 'PROTOCOL_TLSv1'): ++ protocols.append(ssl.PROTOCOL_TLSv1) ++ if hasattr(ssl, 'PROTOCOL_TLSv1_1'): ++ protocols.append(ssl.PROTOCOL_TLSv1_1) ++ if hasattr(ssl, 'PROTOCOL_TLSv1_2'): ++ protocols.append(ssl.PROTOCOL_TLSv1_2) ++ protocols.append(ssl.PROTOCOL_TLS) + versions = [ + ssl.TLSVersion.SSLv3, + ssl.TLSVersion.TLSv1, +@@ -1205,6 +1207,7 @@ def test_min_max_version(self): + ssl.TLSVersion.TLSv1, + ssl.TLSVersion.TLSv1_1, + ssl.TLSVersion.TLSv1_2, ++ ssl.TLSVersion.TLSv1_3, + ssl.TLSVersion.SSLv3, + } + ) +@@ -1218,7 +1221,7 @@ def test_min_max_version(self): + with self.assertRaises(ValueError): + ctx.minimum_version = 42 + +- if has_tls_protocol(ssl.PROTOCOL_TLSv1_1): ++ if has_tls_protocol('PROTOCOL_TLSv1_1'): + ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_1) + + self.assertIn( +@@ -1675,23 +1678,24 @@ def test__create_stdlib_context(self): + self.assertFalse(ctx.check_hostname) + self._assert_context_options(ctx) + +- if has_tls_protocol(ssl.PROTOCOL_TLSv1): ++ if has_tls_protocol('PROTOCOL_TLSv1'): + with warnings_helper.check_warnings(): + ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1) + self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1) + self.assertEqual(ctx.verify_mode, ssl.CERT_NONE) + self._assert_context_options(ctx) + +- with warnings_helper.check_warnings(): +- ctx = ssl._create_stdlib_context( +- ssl.PROTOCOL_TLSv1_2, +- cert_reqs=ssl.CERT_REQUIRED, +- check_hostname=True +- ) +- self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1_2) +- self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED) +- self.assertTrue(ctx.check_hostname) +- self._assert_context_options(ctx) ++ if has_tls_protocol('PROTOCOL_TLSv1_2'): ++ with warnings_helper.check_warnings(): ++ ctx = ssl._create_stdlib_context( ++ ssl.PROTOCOL_TLSv1_2, ++ cert_reqs=ssl.CERT_REQUIRED, ++ check_hostname=True ++ ) ++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1_2) ++ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED) ++ self.assertTrue(ctx.check_hostname) ++ self._assert_context_options(ctx) + + ctx = ssl._create_stdlib_context(purpose=ssl.Purpose.CLIENT_AUTH) + self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLS_SERVER) +@@ -3654,10 +3658,10 @@ def test_protocol_tlsv1_2(self): + client_options=ssl.OP_NO_TLSv1_2) + + try_protocol_combo(ssl.PROTOCOL_TLS, ssl.PROTOCOL_TLSv1_2, 'TLSv1.2') +- if has_tls_protocol(ssl.PROTOCOL_TLSv1): ++ if has_tls_protocol('PROTOCOL_TLSv1'): + try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1, False) + try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1_2, False) +- if has_tls_protocol(ssl.PROTOCOL_TLSv1_1): ++ if has_tls_protocol('PROTOCOL_TLSv1_1'): + try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1_1, False) + try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1_2, False) + +diff --git a/Modules/_ssl.c b/Modules/_ssl.c +index b45295b4c0c..6f75af86113 100644 +--- a/Modules/_ssl.c ++++ b/Modules/_ssl.c +@@ -164,6 +164,17 @@ static void _PySSLFixErrno(void) { + #error Unsupported OpenSSL version + #endif + ++#if (OPENSSL_VERSION_NUMBER >= 0x40000000L) ++# define OPENSSL_NO_SSL3 ++# define OPENSSL_NO_TLS1 ++# define OPENSSL_NO_TLS1_1 ++# define OPENSSL_NO_TLS1_2 ++# define OPENSSL_NO_SSL3_METHOD ++# define OPENSSL_NO_TLS1_METHOD ++# define OPENSSL_NO_TLS1_1_METHOD ++# define OPENSSL_NO_TLS1_2_METHOD ++#endif ++ + /* OpenSSL API 1.1.0+ does not include version methods */ + #ifndef OPENSSL_NO_SSL3_METHOD + extern const SSL_METHOD *SSLv3_method(void); +@@ -1151,7 +1162,7 @@ _asn1obj2py(_sslmodulestate *state, const ASN1_OBJECT *name, int no_name) + + static PyObject * + _create_tuple_for_attribute(_sslmodulestate *state, +- ASN1_OBJECT *name, ASN1_STRING *value) ++ const ASN1_OBJECT *name, const ASN1_STRING *value) + { + Py_ssize_t buflen; + PyObject *pyattr; +@@ -1180,16 +1191,16 @@ _create_tuple_for_attribute(_sslmodulestate *state, + } + + static PyObject * +-_create_tuple_for_X509_NAME (_sslmodulestate *state, X509_NAME *xname) ++_create_tuple_for_X509_NAME(_sslmodulestate *state, const X509_NAME *xname) + { + PyObject *dn = NULL; /* tuple which represents the "distinguished name" */ + PyObject *rdn = NULL; /* tuple to hold a "relative distinguished name" */ + PyObject *rdnt; + PyObject *attr = NULL; /* tuple to hold an attribute */ + int entry_count = X509_NAME_entry_count(xname); +- X509_NAME_ENTRY *entry; +- ASN1_OBJECT *name; +- ASN1_STRING *value; ++ const X509_NAME_ENTRY *entry; ++ const ASN1_OBJECT *name; ++ const ASN1_STRING *value; + int index_counter; + int rdn_level = -1; + int retcode; +@@ -6967,9 +6978,15 @@ sslmodule_init_constants(PyObject *m) + ADD_INT_CONST("PROTOCOL_TLS", PY_SSL_VERSION_TLS); + ADD_INT_CONST("PROTOCOL_TLS_CLIENT", PY_SSL_VERSION_TLS_CLIENT); + ADD_INT_CONST("PROTOCOL_TLS_SERVER", PY_SSL_VERSION_TLS_SERVER); ++#ifndef OPENSSL_NO_TLS1 + ADD_INT_CONST("PROTOCOL_TLSv1", PY_SSL_VERSION_TLS1); ++#endif ++#ifndef OPENSSL_NO_TLS1_1 + ADD_INT_CONST("PROTOCOL_TLSv1_1", PY_SSL_VERSION_TLS1_1); ++#endif ++#ifndef OPENSSL_NO_TLS1_2 + ADD_INT_CONST("PROTOCOL_TLSv1_2", PY_SSL_VERSION_TLS1_2); ++#endif + + #define ADD_OPTION(NAME, VALUE) if (sslmodule_add_option(m, NAME, (VALUE)) < 0) return -1 + +diff --git a/Modules/_ssl/cert.c b/Modules/_ssl/cert.c +index f2e7be89668..061b0fb3171 100644 +--- a/Modules/_ssl/cert.c ++++ b/Modules/_ssl/cert.c +@@ -128,7 +128,8 @@ _ssl_Certificate_get_info_impl(PySSLCertificate *self) + } + + static PyObject* +-_x509name_print(_sslmodulestate *state, X509_NAME *name, int indent, unsigned long flags) ++_x509name_print(_sslmodulestate *state, const X509_NAME *name, ++ int indent, unsigned long flags) + { + PyObject *res; + BIO *biobuf; +diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py +index 3b4507c6771..48207e5330f 100755 +--- a/Tools/ssl/multissltests.py ++++ b/Tools/ssl/multissltests.py +@@ -429,9 +429,11 @@ def _post_install(self): + def _post_install(self): + if self.version.startswith("3."): + self._post_install_3xx() ++ elif self.version.startswith("4."): ++ self._post_install_4xx() + + def _build_src(self, config_args=()): +- if self.version.startswith("3."): ++ if self.version.startswith(("3.", "4.")): + config_args += ("enable-fips",) + super()._build_src(config_args) + +@@ -447,6 +449,9 @@ def _post_install_3xx(self): + lib64 = self.lib_dir + "64" + os.symlink(lib64, self.lib_dir) + ++ def _post_install_4xx(self): ++ self._post_install_3xx() ++ + @property + def short_version(self): + """Short version for OpenSSL download URL""" +-- +2.25.1 +
meta/recipes-devtools/python/python3/0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch new file +234 -0
234 lines not on this page · raw message
meta/recipes-devtools/python/python3/0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch new file +41 -0
41 lines not on this page · raw message
meta/recipes-devtools/python/python3_3.14.7.bb +3 -0
@@ -22,6 +22,9 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-Avoid-shebang-overflow-on-python-config.py.patch \ file://0001-Update-test_sysconfig-for-posix_user-purelib.patch \ file://0001-prefer-valid-entrypoints.patch \ + file://0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch \ + file://0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch \ + file://0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch \ " SRC_URI:append:class-native = " \ file://0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch \
RFC v3 3/6 socat: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 made ASN1_STRING opaque. socat directly accesses pName->d.iPAddress->data and pName->d.iPAddress->length which is no longer allowed.
Use ASN1_STRING_get0_data() and ASN1_STRING_length() accessor functions instead. These have been available since OpenSSL 1.1.0 so this is backward compatible.
Upstream-Status: Submitted [[email protected]]
--- ...penSSL-4.0-use-ASN1_STRING-accessors.patch | 31 +++++++++++++++++++ .../socat/socat_1.8.1.3.bb | 1 + 2 files changed, 32 insertions(+) create mode 100644 meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jaipaul Cheernam <[email protected]> +Date: Thu, 13 Aug 2026 07:00:00 +0000 +Subject: [PATCH] Fix build with OpenSSL 4.0: use ASN1_STRING accessors + +OpenSSL 4.0 made ASN1_STRING opaque. Direct access to struct members +(->data, ->length) is no longer possible. Use the accessor functions +ASN1_STRING_get0_data() and ASN1_STRING_length() instead. + +These accessors have been available since OpenSSL 1.1.0, so this change +is backward compatible. + +Upstream-Status: Submitted [[email protected]] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + xio-openssl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/xio-openssl.c ++++ b/xio-openssl.c +@@ -1898,8 +1898,8 @@ + case GEN_IPADD: + { + /* binary address format */ +- const unsigned char *data = pName->d.iPAddress->data; +- size_t len = pName->d.iPAddress->length; ++ const unsigned char *data = ASN1_STRING_get0_data(pName->d.iPAddress); ++ size_t len = ASN1_STRING_length(pName->d.iPAddress); + char aBuffer[INET6_ADDRSTRLEN]; /* canonical peername */ + struct in6_addr ip6bin; +
meta/recipes-connectivity/socat/socat_1.8.1.3.bb +1 -0
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \ file://0001-fix-compile-procan.c-failed.patch \ + file://0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch \ " SRC_URI[sha256sum] = "25bc6476292b2e614220989c77b0b6fca87bb2525d9747b31a6639b1fb602418"
RFC v3 4/6 serf: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 made ASN1_STRING opaque. serf directly accesses nm->d.ia5->data and nm->d.ia5->length which is no longer allowed.
Use ASN1_STRING_get0_data() and ASN1_STRING_length() accessor functions instead. These have been available since OpenSSL 1.1.0 so this is backward compatible.
The fix is already in serf trunk (r1935023) but no new release has been made.
Upstream-Status: Backport [https://svn.apache.org/repos/asf/serf/trunk r1935023]
--- ...penSSL-4.0-use-ASN1_STRING-accessors.patch | 35 +++++++++++++++++++ meta/recipes-support/serf/serf_1.3.10.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jaipaul Cheernam <[email protected]> +Date: Thu, 13 Aug 2026 11:52:00 +0000 +Subject: [PATCH] Fix build with OpenSSL 4.0: use ASN1_STRING accessors + +OpenSSL 4.0 made ASN1_STRING opaque. Direct access to struct members +(->data, ->length) is no longer possible. Use the accessor functions +ASN1_STRING_get0_data() and ASN1_STRING_length() instead. + +These accessors have been available since OpenSSL 1.1.0, so this change +is backward compatible. + +Upstream-Status: Backport [https://svn.apache.org/repos/asf/serf/trunk r1935023] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + buckets/ssl_buckets.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/buckets/ssl_buckets.c ++++ b/buckets/ssl_buckets.c +@@ -567,11 +567,11 @@ + switch (nm->type) { + case GEN_DNS: + if (copy_action == ErrorOnNul && +- strlen(nm->d.ia5->data) != nm->d.ia5->length) ++ strlen((const char *)ASN1_STRING_get0_data(nm->d.ia5)) != (size_t)ASN1_STRING_length(nm->d.ia5)) + return SERF_ERROR_SSL_CERT_FAILED; + if (san_arr && *san_arr) +- p = pstrdup_escape_nul_bytes((const char *)nm->d.ia5->data, +- nm->d.ia5->length, ++ p = pstrdup_escape_nul_bytes((const char *)ASN1_STRING_get0_data(nm->d.ia5), ++ ASN1_STRING_length(nm->d.ia5), + pool); + break; + default:
meta/recipes-support/serf/serf_1.3.10.bb +1 -0
@@ -10,6 +10,7 @@ SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ file://0002-SConstruct-Fix-path-quoting-for-.def-generator.patch \ file://0003-gen_def.patch \ file://SConstruct.stop.creating.directories.without.sandbox-install.prefix.patch \ + file://0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch \ " SRC_URI[sha256sum] = "be81ef08baa2516ecda76a77adf7def7bc3227eeb578b9a33b45f7b41dc064e6"
RFC v3 5/6 u-boot: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 removed the ENGINE API entirely. u-boot uses ENGINE_get_id, ENGINE_load_public_key, ENGINE_finish, ENGINE_free in lib/rsa/rsa-sign.c which causes link failures on all platforms that build u-boot (including riscv64).
Backport the Provider API support patch from upstream u-boot which adds OpenSSL Provider support while maintaining backward compatibility with older OpenSSL versions that still have ENGINE.
Add the patch to u-boot-common.inc so it applies to both u-boot and u-boot-tools recipes.
Upstream-Status: Submitted [https://lore.kernel.org/u-boot/[email protected]/]
--- ...Add-support-for-OpenSSL-Provider-API.patch | 340 ++++++++++++++++++ meta/recipes-bsp/u-boot/u-boot-common.inc | 1 + 2 files changed, 341 insertions(+) create mode 100644 meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch
meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch new file +340 -0
@@ -0,0 +1,340 @@ +From a81cb0932dce109af44d7245d47489fe54ae390f Mon Sep 17 00:00:00 2001 +From: Eddie Kovsky <[email protected]> +Date: Mon, 23 Feb 2026 09:43:22 -0700 +Subject: [PATCH] Add support for OpenSSL Provider API + +The Engine API has been deprecated since the release of OpenSSL 3.0. End +users have been advised to migrate to the new Provider interface. +Several distributions have already removed support for engines, which is +preventing U-Boot from being compiled in those environments. + +Add support for the Provider API while continuing to support the existing +Engine API on distros shipping older releases of OpenSSL. + +This is based on similar work contributed by Jan Stancek updating Linux +to use the Provider interface. + + commit 558bdc45dfb2669e1741384a0c80be9c82fa052c + Author: Jan Stancek <[email protected]> + Date: Fri Sep 20 19:52:48 2024 +0300 + + sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 + +The changes have been tested with the FIT signature verification vboot +tests on Fedora 42 and Debian 13. All 30 tests pass with both the legacy +Engine library installed and with the Provider API. + +Signed-off-by: Eddie Kovsky <[email protected]> + +Upstream-Status: Submitted [https://lore.kernel.org/u-boot/[email protected]/] + +Note: Modified to make pkcs11 provider loading optional. The upstream +patch unconditionally requires the pkcs11 provider, which is not +available in the OE build environment. File-based key signing only needs +the default provider; pkcs11 is only required for pkcs11: URI keys. +Changes from upstream: + - Load default provider first (was pkcs11 first) + - Make pkcs11 provider load failure non-fatal (ERR_clear_error instead + of ERR(1, ...) which calls errx/abort) + +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + doc/build/gcc.rst | 4 +- + lib/aes/aes-encrypt.c | 4 +- + lib/rsa/rsa-sign.c | 102 +++++++++++++++++++++++++++++++++++++++--- + tools/docker/Dockerfile | 1 + + 4 files changed, 103 insertions(+), 8 deletions(-) + +diff --git a/doc/build/gcc.rst b/doc/build/gcc.rst +index 1fef718ceecb..29a6a632e7e3 100644 +--- a/doc/build/gcc.rst ++++ b/doc/build/gcc.rst +@@ -25,8 +25,8 @@ Depending on the build targets further packages maybe needed + + sudo apt-get install bc bison build-essential coccinelle \ + device-tree-compiler dfu-util efitools flex gdisk graphviz imagemagick \ +- libgnutls28-dev libguestfs-tools libncurses-dev \ +- libpython3-dev libsdl2-dev libssl-dev lz4 lzma lzma-alone openssl \ ++ libgnutls28-dev libguestfs-tools libncurses-dev libpython3-dev \ ++ libsdl2-dev libssl-dev lz4 lzma lzma-alone openssl pkcs11-provider \ + pkg-config python3 python3-asteval python3-coverage python3-filelock \ + python3-pkg-resources python3-pycryptodome python3-pyelftools \ + python3-pytest python3-pytest-xdist python3-sphinxcontrib.apidoc \ +diff --git a/lib/aes/aes-encrypt.c b/lib/aes/aes-encrypt.c +index 90e1407b4f09..4fc4ce232478 100644 +--- a/lib/aes/aes-encrypt.c ++++ b/lib/aes/aes-encrypt.c +@@ -16,7 +16,9 @@ + #include <openssl/err.h> + #include <openssl/ssl.h> + #include <openssl/evp.h> +-#include <openssl/engine.h> ++#if !defined(OPENSSL_NO_ENGINE) && !defined(OPENSSL_NO_DEPRECATED_3_0) ++# include <openssl/engine.h> ++#endif + #include <uboot_aes.h> + + #if OPENSSL_VERSION_NUMBER >= 0x10000000L +diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c +index 0e38c9e802fd..f456f3c58e65 100644 +--- a/lib/rsa/rsa-sign.c ++++ b/lib/rsa/rsa-sign.c +@@ -19,7 +19,47 @@ + #include <openssl/err.h> + #include <openssl/ssl.h> + #include <openssl/evp.h> +-#include <openssl/engine.h> ++#if OPENSSL_VERSION_MAJOR >= 3 ++# define USE_PKCS11_PROVIDER ++# include <err.h> ++# include <openssl/provider.h> ++# include <openssl/store.h> ++#else ++# if !defined(OPENSSL_NO_ENGINE) && !defined(OPENSSL_NO_DEPRECATED_3_0) ++# define USE_PKCS11_ENGINE ++# include <openssl/engine.h> ++# endif ++#endif ++ ++#ifdef USE_PKCS11_PROVIDER ++#define ERR(cond, fmt, ...) \ ++ do { \ ++ bool __cond = (cond); \ ++ drain_openssl_errors(__LINE__, 0); \ ++ if (__cond) { \ ++ errx(1, fmt, ## __VA_ARGS__); \ ++ } \ ++ } while (0) ++ ++static void drain_openssl_errors(int l, int silent) ++{ ++ const char *file; ++ char buf[120]; ++ int e, line; ++ ++ if (ERR_peek_error() == 0) ++ return; ++ if (!silent) ++ fprintf(stderr, "At main.c:%d:\n", l); ++ ++ while ((e = ERR_peek_error_line(&file, &line))) { ++ ERR_error_string(e, buf); ++ if (!silent) ++ fprintf(stderr, "- SSL %s: %s:%d\n", buf, file, line); ++ ERR_get_error(); ++ } ++} ++#endif + + static int rsa_err(const char *msg) + { +@@ -94,10 +134,11 @@ static int rsa_pem_get_pub_key(const char *keydir, const char *name, EVP_PKEY ** + * + * @keydir: Key prefix + * @name Name of key +- * @engine Engine to use ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_get_pub_key(const char *keydir, const char *name, + ENGINE *engine, EVP_PKEY **evpp) + { +@@ -157,21 +198,24 @@ static int rsa_engine_get_pub_key(const char *keydir, const char *name, + + return 0; + } ++#endif + + /** + * rsa_get_pub_key() - read a public key + * + * @keydir: Directory containing the key (PEM file) or key prefix (engine) + * @name Name of key file (will have a .crt extension) +- * @engine Engine to use ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ + static int rsa_get_pub_key(const char *keydir, const char *name, + ENGINE *engine, EVP_PKEY **evpp) + { ++#ifdef USE_PKCS11_ENGINE + if (engine) + return rsa_engine_get_pub_key(keydir, name, engine, evpp); ++#endif + return rsa_pem_get_pub_key(keydir, name, evpp); + } + +@@ -207,13 +251,44 @@ static int rsa_pem_get_priv_key(const char *keydir, const char *name, + return -ENOENT; + } + ++#ifdef USE_PKCS11_PROVIDER ++ EVP_PKEY *private_key = NULL; ++ OSSL_STORE_CTX *store; ++ ++ if (!OSSL_PROVIDER_try_load(NULL, "default", true)) ++ ERR(1, "OSSL_PROVIDER_try_load(default)"); ++ /* pkcs11 provider is optional; only needed for pkcs11: URIs */ ++ if (!OSSL_PROVIDER_try_load(NULL, "pkcs11", true)) ++ ERR_clear_error(); ++ ++ store = OSSL_STORE_open(path, NULL, NULL, NULL, NULL); ++ ERR(!store, "OSSL_STORE_open"); ++ ++ while (!OSSL_STORE_eof(store)) { ++ OSSL_STORE_INFO *info = OSSL_STORE_load(store); ++ ++ if (!info) { ++ drain_openssl_errors(__LINE__, 0); ++ continue; ++ } ++ if (OSSL_STORE_INFO_get_type(info) == OSSL_STORE_INFO_PKEY) { ++ private_key = OSSL_STORE_INFO_get1_PKEY(info); ++ ERR(!private_key, "OSSL_STORE_INFO_get1_PKEY"); ++ } ++ OSSL_STORE_INFO_free(info); ++ if (private_key) ++ break; ++ } ++ OSSL_STORE_close(store); ++ ++ *evpp = private_key; ++#else + if (!PEM_read_PrivateKey(f, evpp, NULL, path)) { + rsa_err("Failure reading private key"); + fclose(f); + return -EPROTO; + } + fclose(f); +- ++#endif + return 0; + } + +@@ -226,6 +301,7 @@ static int rsa_pem_get_priv_key(const char *keydir, const char *name, + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_get_priv_key(const char *keydir, const char *name, + const char *keyfile, + ENGINE *engine, EVP_PKEY **evpp) +@@ -293,22 +369,25 @@ static int rsa_engine_get_priv_key(const char *keydir, const char *name, + + return 0; + } ++#endif + + /** + * rsa_get_priv_key() - read a private key + * + * @keydir: Directory containing the key (PEM file) or key prefix (engine) + * @name Name of key +- * @engine Engine to use for signing ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ + static int rsa_get_priv_key(const char *keydir, const char *name, + const char *keyfile, ENGINE *engine, EVP_PKEY **evpp) + { ++#ifdef USE_PKCS11_ENGINE + if (engine) + return rsa_engine_get_priv_key(keydir, name, keyfile, engine, + evpp); ++#endif + return rsa_pem_get_priv_key(keydir, name, keyfile, evpp); + } + +@@ -325,6 +404,7 @@ static int rsa_init(void) + return 0; + } + ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_init(const char *engine_id, ENGINE **pe) + { + const char *key_pass; +@@ -380,6 +460,7 @@ static void rsa_engine_remove(ENGINE *e) + ENGINE_free(e); + } + } ++#endif + + static int rsa_sign_with_key(EVP_PKEY *pkey, struct padding_algo *padding_algo, + struct checksum_algo *checksum_algo, +@@ -480,11 +561,13 @@ int rsa_sign(struct image_sign_info *info, + if (ret) + return ret; + ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) { + ret = rsa_engine_init(info->engine_id, &e); + if (ret) + return ret; + } ++#endif + + ret = rsa_get_priv_key(info->keydir, info->keyname, info->keyfile, + e, &pkey); +@@ -496,16 +579,21 @@ int rsa_sign(struct image_sign_info *info, + goto err_sign; + + EVP_PKEY_free(pkey); ++ ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + + return ret; + + err_sign: + EVP_PKEY_free(pkey); + err_priv: ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + return ret; + } + +@@ -645,11 +733,13 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest) + ENGINE *e = NULL; + + debug("%s: Getting verification data\n", __func__); ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) { + ret = rsa_engine_init(info->engine_id, &e); + if (ret) + return ret; + } ++#endif + ret = rsa_get_pub_key(info->keydir, info->keyname, e, &pkey); + if (ret) + goto err_get_pub_key; +@@ -726,8 +816,10 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest) + err_get_params: + EVP_PKEY_free(pkey); + err_get_pub_key: ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + + if (ret) + return ret; +diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile +index 73bf6cdd2c52..50e98e83dc20 100644 +--- a/tools/docker/Dockerfile ++++ b/tools/docker/Dockerfile +@@ -122,6 +122,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + openssl \ + picocom \ + parted \ ++ pkcs11-provider \ + pkg-config \ + python-is-python3 \ + python3 \
meta/recipes-bsp/u-boot/u-boot-common.inc +1 -0
@@ -16,6 +16,7 @@ SRCREV = "ece349ade2973e220f524ce59e59711cc919263f" SRC_URI = "git://git.u-boot-project.org/u-boot/u-boot.git;protocol=https;branch=main;tag=v${PV} \ file://0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch \ + file://0001-Add-support-for-OpenSSL-Provider-API.patch \ " B = "${WORKDIR}/build"
RFC v3 6/6 kea: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 adds const qualifiers to the return type of X509_get_issuer_name() and X509_get_subject_name(). This causes compilation failures in Kea's TLS code which assigns these to non-const pointers.
Add patch to use const-qualified pointers matching the new OpenSSL 4.0 API.
Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/issues/4673]
--- ...-qualifiers-to-OpenSSL-X509-pointers.patch | 49 +++++++++++++++++++ meta/recipes-connectivity/kea/kea_3.2.0.bb | 1 + 2 files changed, 50 insertions(+) create mode 100644 meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch
meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch new file +49 -0
@@ -0,0 +1,49 @@ +From 82d28b1be73bbc00e73e59d0c59c51a1e76519a5 Mon Sep 17 00:00:00 2001 +From: Simo Sorce <[email protected]> +Date: Mon, 27 Apr 2026 17:49:56 -0400 +Subject: [PATCH] Add const qualifiers to OpenSSL X509 pointers + +Added const qualifiers to the X509_NAME and X509_NAME_ENTRY pointers when +retrieving subject and issuer names from TLS certificates. This ensures const- +correctness and maintains compatibility with newer OpenSSL versions, which +return const pointers from these getter functions. + +Signed-off-by: Simo Sorce <[email protected]> + +Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/issues/4673] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + src/lib/asiolink/openssl_tls.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/lib/asiolink/openssl_tls.h b/src/lib/asiolink/openssl_tls.h +index 57c3323..52a969b 100644 +--- a/src/lib/asiolink/openssl_tls.h ++++ b/src/lib/asiolink/openssl_tls.h +@@ -175,9 +175,9 @@ public: + if (!cert) { + return (""); + } +- ::X509_NAME *name = ::X509_get_subject_name(cert); ++ const ::X509_NAME *name = ::X509_get_subject_name(cert); + int loc = ::X509_NAME_get_index_by_NID(name, NID_commonName, -1); +- ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); ++ const ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); + if (!ne) { + ::X509_free(cert); + return (""); +@@ -209,9 +209,9 @@ public: + if (!cert) { + return (""); + } +- ::X509_NAME *name = ::X509_get_issuer_name(cert); ++ const ::X509_NAME *name = ::X509_get_issuer_name(cert); + int loc = ::X509_NAME_get_index_by_NID(name, NID_commonName, -1); +- ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); ++ const ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); + if (!ne) { + ::X509_free(cert); + return (""); +-- +2.53.0 +
meta/recipes-connectivity/kea/kea_3.2.0.bb +1 -0
@@ -19,6 +19,7 @@ SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.xz \ file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \ file://0001-meson-use-a-runtime-safe-interpreter-string.patch \ file://0001-mk_cfgrpt.sh-strip-prefixes.patch \ + file://0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch \ " SRC_URI[sha256sum] = "14bf695d37b65b9b1bf550fea5d0adaf9806c50e5419ef2a176a4b8e9aade3df"
v4 cover openssl: upgrade 3.5.7 -> 4.0.1
In reply to Jaipaul CheernamUpgrade OpenSSL from 3.5.7 to 4.0.1 and fix all dependent recipe breakages in oe-core.
OpenSSL 4.0 is a major version bump that removes the ENGINE API, removes the c_rehash script, makes ASN1_STRING fully opaque, adds const qualifiers to X509 accessor return types, and removes per-version TLS method functions.
This series fixes python3, socat, serf, u-boot, and kea to build against OpenSSL 4.0.
Changes since v3:
- u-boot: fix malformed patch (hunk line count mismatch from pkcs11 modification). Regenerated patch properly.
Changes since v2:
- openssl: remove c_rehash from MULTILIB_SCRIPTS and FILES (fixes multilib do_package failure)
- python3: add backports from CPython PR #149783 for the got_eof_error fix (fixes test_https/test_https_sni ptest failures caused by OpenSSL 4.0 changing EOF signaling behavior)
- u-boot: update Upstream-Status to lore link per reviewer feedback, include doc/Dockerfile hunks from upstream v4, make pkcs11 provider loading optional (fixes fitimage signing failure when pkcs11-provider is not installed)
Changes since v1:
- u-boot: move patch from u-boot-tools to u-boot-common.inc (fixes riscv64 build failure)
- serf/socat: fix Upstream-Status tags
Testing:
- lib32-openssl do_package: passes (multilib fix verified)
- python3 test_https/test_https_sni: passes locally
- u-boot fitimage signing: passes locally
- bitbake world -k with meta-oe/meta-networking/meta-python/meta-perl:
oe-core recipes all build. meta-oe breakages are in their layer.
Known breakages in meta-openembedded (not addressed here):
- freediameter: RDEPENDS on removed openssl-engines package
- pkcs11-helper, krb5, libcoap, grpc, libnet-ssleay-perl, libesmtp, unbound, wvstreams: various OpenSSL 4.0 API incompatibilities
Notes on upstream status:
- python3: CPython PR #149783 deferred until after Python 3.15.1
- socat: submitted to [email protected]
- serf: fix in trunk (r1935023), no release yet
- u-boot: v4 on ML under review
- kea: tracked as issue #4673
Jaipaul Cheernam (6):
openssl: upgrade 3.5.7 -> 4.0.1
python3: backport OpenSSL 4.0 support from upstream
socat: fix build with OpenSSL 4.0
serf: fix build with OpenSSL 4.0
u-boot: fix build with OpenSSL 4.0
kea: fix build with OpenSSL 4.0
...Add-support-for-OpenSSL-Provider-API.patch | 340 ++++++++++++++++
meta/recipes-bsp/u-boot/u-boot-common.inc | 1 +
...-qualifiers-to-OpenSSL-X509-pointers.patch | 49 +++
meta/recipes-connectivity/kea/kea_3.2.0.bb | 1 +
...ke-history-reporting-when-test-fails.patch | 366 ------------------
...1-Configure-do-not-tweak-mips-cflags.patch | 6 +-
...sysroot-and-debug-prefix-map-from-co.patch | 11 +-
.../0001-extend-check_cwm-test-timeout.patch | 4 +-
.../{openssl_3.5.7.bb => openssl_4.0.1.bb} | 28 +-
...penSSL-4.0-use-ASN1_STRING-accessors.patch | 31 ++
.../socat/socat_1.8.1.3.bb | 1 +
...146207-Add-support-for-OpenSSL-4.0.0.patch | 257 ++++++++++++
...Update-_ssl._SSLSocket-for-OpenSSL-4.patch | 234 +++++++++++
...utdown-test-in-test_ssl.test_got_eof.patch | 41 ++
.../recipes-devtools/python/python3_3.14.7.bb | 3 +
...penSSL-4.0-use-ASN1_STRING-accessors.patch | 35 ++
meta/recipes-support/serf/serf_1.3.10.bb | 1 +
17 files changed, 1012 insertions(+), 397 deletions(-)
create mode 100644 meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch
create mode 100644 meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch
delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch
rename meta/recipes-connectivity/openssl/{openssl_3.5.7.bb => openssl_4.0.1.bb} (87%)
create mode 100644 meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
create mode 100644 meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch
create mode 100644 meta/recipes-devtools/python/python3/0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch
create mode 100644 meta/recipes-devtools/python/python3/0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch
create mode 100644 meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patchRFC v4 1/6 openssl: upgrade 3.5.7 -> 4.0.1
Upgrade OpenSSL from 3.5.7 to 4.0.1. This is a major version upgrade.
Changelog: https://github.com/openssl/openssl/blob/openssl-4.0.1/CHANGES.md
New CVE fixes not already in 3.5.7:
* CVE-2026-28386: Fixed OOB read in AES-CFB-128 on x86-64 with AVX-512
* CVE-2026-35188: Fixed double-free when checking OCSP stapled response
* CVE-2026-42765: Fixed NULL deref in cert verification with OCSP
* CVE-2026-42771: Fixed OOB read in X509_VERIFY_PARAM_set1_email()
Major breaking changes in 4.0.0:
* Removed support for engines. The ENGINE API is fully removed.
* Removed support for SSLv3. SSLv3 has been deprecated since 2015.
* Removed support for the SSLv2 Client Hello.
* Removed per-version TLS method functions (SSLv3_method(),
TLSv1_method(), TLSv1_1_method(), TLSv1_2_method()).
* Removed c_rehash script tool. Use 'openssl rehash' instead.
* ASN1_STRING has been made opaque.
* Numerous API function signatures changed to include const qualifiers.
* libcrypto no longer cleans up globally allocated data via atexit().
* Added AKID verification checks when X509_V_FLAG_X509_STRICT is set.
* Support of deprecated elliptic curves in TLS disabled at compile-time by default.
Recipe changes:
* Drop 0001-Added-handshake-history-reporting-when-test-fails.patch
(merged upstream via PR #22481).
* Refresh remaining patches against the new version.
* Remove ENGINE API artifacts: engines package, dasync.so/ossltest.so ptest installation, ENGINESDIR references, OPENSSL_ENGINES wrapper variable, and cryptodev-linux PACKAGECONFIG.
Tested: ptest on qemux86-64:
Files=362, Tests=4310, Result: PASS
Passed: 338, Skipped: 24 (fips, lms, rc5, tfo, compression, sslversions, sslkeylogfile, external tests - all expected)
Failed: 0
---
...ke-history-reporting-when-test-fails.patch | 366 ------------------
...1-Configure-do-not-tweak-mips-cflags.patch | 6 +-
...sysroot-and-debug-prefix-map-from-co.patch | 11 +-
.../0001-extend-check_cwm-test-timeout.patch | 4 +-
.../{openssl_3.5.7.bb => openssl_4.0.1.bb} | 28 +-
5 files changed, 18 insertions(+), 397 deletions(-)
delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch
rename meta/recipes-connectivity/openssl/{openssl_3.5.7.bb => openssl_4.0.1.bb} (87%)meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0 -366
@@ -1,366 +0,0 @@ -From 5ba65051fea0513db0d997f0ab7cafb9826ed74a Mon Sep 17 00:00:00 2001 -From: William Lyu <[email protected]> -Date: Fri, 20 Oct 2023 16:22:37 -0400 -Subject: [PATCH] Added handshake history reporting when test fails - -Upstream-Status: Submitted [https://github.com/openssl/openssl/pull/22481] - -Signed-off-by: William Lyu <[email protected]> ---- - test/helpers/handshake.c | 136 ++++++++++++++++++++++++++++++--------- - test/helpers/handshake.h | 70 +++++++++++++++++++- - test/ssl_test.c | 44 +++++++++++++ - 3 files changed, 217 insertions(+), 33 deletions(-) - -diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c -index f611b3a..5703b48 100644 ---- a/test/helpers/handshake.c -+++ b/test/helpers/handshake.c -@@ -25,6 +25,102 @@ - #include <netinet/sctp.h> - #endif - -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+/* Maps string names to various enumeration type */ -+typedef struct { -+ const char *name; -+ int value; -+} enum_name_map; -+ -+static const enum_name_map connect_phase_names[] = { -+ {"Handshake", HANDSHAKE}, -+ {"RenegAppData", RENEG_APPLICATION_DATA}, -+ {"RenegSetup", RENEG_SETUP}, -+ {"RenegHandshake", RENEG_HANDSHAKE}, -+ {"AppData", APPLICATION_DATA}, -+ {"Shutdown", SHUTDOWN}, -+ {"ConnectionDone", CONNECTION_DONE} -+}; -+ -+static const enum_name_map peer_status_names[] = { -+ {"PeerSuccess", PEER_SUCCESS}, -+ {"PeerRetry", PEER_RETRY}, -+ {"PeerError", PEER_ERROR}, -+ {"PeerWaiting", PEER_WAITING}, -+ {"PeerTestFail", PEER_TEST_FAILURE} -+}; -+ -+static const enum_name_map handshake_status_names[] = { -+ {"HandshakeSuccess", HANDSHAKE_SUCCESS}, -+ {"ClientError", CLIENT_ERROR}, -+ {"ServerError", SERVER_ERROR}, -+ {"InternalError", INTERNAL_ERROR}, -+ {"HandshakeRetry", HANDSHAKE_RETRY} -+}; -+ -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+static const char *enum_name(const enum_name_map *enums, size_t num_enums, -+ int value) -+{ -+ size_t i; -+ for (i = 0; i < num_enums; i++) { -+ if (enums[i].value == value) { -+ return enums[i].name; -+ } -+ } -+ return "InvalidValue"; -+} -+ -+const char *handshake_connect_phase_name(connect_phase_t phase) -+{ -+ return enum_name(connect_phase_names, OSSL_NELEM(connect_phase_names), -+ (int)phase); -+} -+ -+const char *handshake_status_name(handshake_status_t handshake_status) -+{ -+ return enum_name(handshake_status_names, OSSL_NELEM(handshake_status_names), -+ (int)handshake_status); -+} -+ -+const char *handshake_peer_status_name(peer_status_t peer_status) -+{ -+ return enum_name(peer_status_names, OSSL_NELEM(peer_status_names), -+ (int)peer_status); -+} -+ -+static void save_loop_history(HANDSHAKE_HISTORY *history, -+ connect_phase_t phase, -+ handshake_status_t handshake_status, -+ peer_status_t server_status, -+ peer_status_t client_status, -+ int client_turn_count, -+ int is_client_turn) -+{ -+ HANDSHAKE_HISTORY_ENTRY *new_entry = NULL; -+ -+ /* -+ * Create a new history entry for a handshake loop with statuses given in -+ * the arguments. Potentially evicting the oldest entry when the -+ * ring buffer is full. -+ */ -+ ++(history->last_idx); -+ history->last_idx &= MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ -+ new_entry = &((history->entries)[history->last_idx]); -+ new_entry->phase = phase; -+ new_entry->handshake_status = handshake_status; -+ new_entry->server_status = server_status; -+ new_entry->client_status = client_status; -+ new_entry->client_turn_count = client_turn_count; -+ new_entry->is_client_turn = is_client_turn; -+ -+ /* Evict the oldest handshake loop entry when the ring buffer is full. */ -+ if (history->entry_count < MAX_HANDSHAKE_HISTORY_ENTRY) { -+ ++(history->entry_count); -+ } -+} -+ - HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void) - { - HANDSHAKE_RESULT *ret; -@@ -724,15 +820,6 @@ static void configure_handshake_ssl(SSL *server, SSL *client, - SSL_set_post_handshake_auth(client, 1); - } - --/* The status for each connection phase. */ --typedef enum { -- PEER_SUCCESS, -- PEER_RETRY, -- PEER_ERROR, -- PEER_WAITING, -- PEER_TEST_FAILURE --} peer_status_t; -- - /* An SSL object and associated read-write buffers. */ - typedef struct peer_st { - SSL *ssl; -@@ -1077,16 +1164,6 @@ static void do_shutdown_step(PEER *peer) - } - } - --typedef enum { -- HANDSHAKE, -- RENEG_APPLICATION_DATA, -- RENEG_SETUP, -- RENEG_HANDSHAKE, -- APPLICATION_DATA, -- SHUTDOWN, -- CONNECTION_DONE --} connect_phase_t; -- - static int renegotiate_op(const SSL_TEST_CTX *test_ctx) - { - switch (test_ctx->handshake_mode) { -@@ -1164,19 +1241,6 @@ static void do_connect_step(const SSL_TEST_CTX *test_ctx, PEER *peer, - } - } - --typedef enum { -- /* Both parties succeeded. */ -- HANDSHAKE_SUCCESS, -- /* Client errored. */ -- CLIENT_ERROR, -- /* Server errored. */ -- SERVER_ERROR, -- /* Peers are in inconsistent state. */ -- INTERNAL_ERROR, -- /* One or both peers not done. */ -- HANDSHAKE_RETRY --} handshake_status_t; -- - /* - * Determine the handshake outcome. - * last_status: the status of the peer to have acted last. -@@ -1541,6 +1605,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( - - start = time(NULL); - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - /* - * Half-duplex handshake loop. - * Client and server speak to each other synchronously in the same process. -@@ -1562,6 +1630,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( - 0 /* server went last */); - } - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - switch (status) { - case HANDSHAKE_SUCCESS: - client_turn_count = 0; -diff --git a/test/helpers/handshake.h b/test/helpers/handshake.h -index 78b03f9..b9967c2 100644 ---- a/test/helpers/handshake.h -+++ b/test/helpers/handshake.h -@@ -1,5 +1,5 @@ - /* -- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. -+ * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy -@@ -12,6 +12,11 @@ - - #include "ssl_test_ctx.h" - -+#define MAX_HANDSHAKE_HISTORY_ENTRY_BIT 4 -+#define MAX_HANDSHAKE_HISTORY_ENTRY (1 << MAX_HANDSHAKE_HISTORY_ENTRY_BIT) -+#define MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK \ -+ ((1 << MAX_HANDSHAKE_HISTORY_ENTRY_BIT) - 1) -+ - typedef struct ctx_data_st { - unsigned char *npn_protocols; - size_t npn_protocols_len; -@@ -22,6 +27,63 @@ typedef struct ctx_data_st { - char *session_ticket_app_data; - } CTX_DATA; - -+typedef enum { -+ HANDSHAKE, -+ RENEG_APPLICATION_DATA, -+ RENEG_SETUP, -+ RENEG_HANDSHAKE, -+ APPLICATION_DATA, -+ SHUTDOWN, -+ CONNECTION_DONE -+} connect_phase_t; -+ -+/* The status for each connection phase. */ -+typedef enum { -+ PEER_SUCCESS, -+ PEER_RETRY, -+ PEER_ERROR, -+ PEER_WAITING, -+ PEER_TEST_FAILURE -+} peer_status_t; -+ -+typedef enum { -+ /* Both parties succeeded. */ -+ HANDSHAKE_SUCCESS, -+ /* Client errored. */ -+ CLIENT_ERROR, -+ /* Server errored. */ -+ SERVER_ERROR, -+ /* Peers are in inconsistent state. */ -+ INTERNAL_ERROR, -+ /* One or both peers not done. */ -+ HANDSHAKE_RETRY -+} handshake_status_t; -+ -+/* Stores the various status information in a handshake loop. */ -+typedef struct handshake_history_entry_st { -+ connect_phase_t phase; -+ handshake_status_t handshake_status; -+ peer_status_t server_status; -+ peer_status_t client_status; -+ int client_turn_count; -+ int is_client_turn; -+} HANDSHAKE_HISTORY_ENTRY; -+ -+typedef struct handshake_history_st { -+ /* Implemented using ring buffer. */ -+ /* -+ * The valid entries are |entries[last_idx]|, |entries[last_idx-1]|, -+ * ..., etc., going up to |entry_count| number of entries. Note that when -+ * the index into the array |entries| becomes < 0, we wrap around to -+ * the end of |entries|. -+ */ -+ HANDSHAKE_HISTORY_ENTRY entries[MAX_HANDSHAKE_HISTORY_ENTRY]; -+ /* The number of valid entries in |entries| array. */ -+ size_t entry_count; -+ /* The index of the last valid entry in the |entries| array. */ -+ size_t last_idx; -+} HANDSHAKE_HISTORY; -+ - typedef struct handshake_result { - ssl_test_result_t result; - /* These alerts are in the 2-byte format returned by the info_callback. */ -@@ -77,6 +139,8 @@ typedef struct handshake_result { - char *cipher; - /* session ticket application data */ - char *result_session_ticket_app_data; -+ /* handshake loop history */ -+ HANDSHAKE_HISTORY history; - } HANDSHAKE_RESULT; - - HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void); -@@ -95,4 +159,8 @@ int configure_handshake_ctx_for_srp(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, - CTX_DATA *server2_ctx_data, - CTX_DATA *client_ctx_data); - -+const char *handshake_connect_phase_name(connect_phase_t phase); -+const char *handshake_status_name(handshake_status_t handshake_status); -+const char *handshake_peer_status_name(peer_status_t peer_status); -+ - #endif /* OSSL_TEST_HANDSHAKE_HELPER_H */ -diff --git a/test/ssl_test.c b/test/ssl_test.c -index ea60851..9d6b093 100644 ---- a/test/ssl_test.c -+++ b/test/ssl_test.c -@@ -26,6 +26,44 @@ static OSSL_LIB_CTX *libctx = NULL; - /* Currently the section names are of the form test-<number>, e.g. test-15. */ - #define MAX_TESTCASE_NAME_LENGTH 100 - -+static void print_handshake_history(const HANDSHAKE_HISTORY *history) -+{ -+ size_t first_idx; -+ size_t i; -+ size_t cur_idx; -+ const HANDSHAKE_HISTORY_ENTRY *cur_entry; -+ const char header_template[] = "|%14s|%16s|%16s|%16s|%17s|%14s|"; -+ const char body_template[] = "|%14s|%16s|%16s|%16s|%17d|%14s|"; -+ -+ TEST_info("The following is the server/client state " -+ "in the most recent %d handshake loops.", -+ MAX_HANDSHAKE_HISTORY_ENTRY); -+ -+ TEST_note("==================================================" -+ "=================================================="); -+ TEST_note(header_template, -+ "phase", "handshake status", "server status", -+ "client status", "client turn count", "is client turn"); -+ TEST_note("+--------------+----------------+----------------" -+ "+----------------+-----------------+--------------+"); -+ -+ first_idx = (history->last_idx - history->entry_count + 1) & -+ MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ for (i = 0; i < history->entry_count; ++i) { -+ cur_idx = (first_idx + i) & MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ cur_entry = &(history->entries)[cur_idx]; -+ TEST_note(body_template, -+ handshake_connect_phase_name(cur_entry->phase), -+ handshake_status_name(cur_entry->handshake_status), -+ handshake_peer_status_name(cur_entry->server_status), -+ handshake_peer_status_name(cur_entry->client_status), -+ cur_entry->client_turn_count, -+ cur_entry->is_client_turn ? "true" : "false"); -+ } -+ TEST_note("==================================================" -+ "=================================================="); -+} -+ - static const char *print_alert(int alert) - { - return alert ? SSL_alert_desc_string_long(alert) : "no alert"; -@@ -388,6 +426,12 @@ static int check_test(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) - ret &= check_client_sign_type(result, test_ctx); - ret &= check_client_ca_names(result, test_ctx); - } -+ -+ /* Print handshake loop history if any check fails. */ -+ if (!ret) { -+ print_handshake_history(&(result->history)); -+ } -+ - return ret; - } - --- -2.25.1 -
meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch +3 -3
@@ -1,4 +1,4 @@ -From 0377f0d5b5c1079e3b9a80881f4dcc891cbe9f9a Mon Sep 17 00:00:00 2001 +From b5cee0cb0f14a78056ef7722a34b361491f1fdda Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <[email protected]> Date: Tue, 30 May 2023 09:11:27 -0700 Subject: [PATCH] Configure: do not tweak mips cflags
@@ -17,10 +17,10 @@ Signed-off-by: Tim Orling <[email protected]> 1 file changed, 10 deletions(-) diff --git a/Configure b/Configure -index fff97bd..5ee54c1 100755 +index c05a30b..db8adee 100755 --- a/Configure +++ b/Configure -@@ -1557,16 +1557,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) +@@ -1575,16 +1575,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) push @{$config{shared_ldflag}}, "-mno-cygwin"; }
meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +5 -6
@@ -1,4 +1,4 @@ -From 5985253f2c9025d7c127443a3a9938946f80c2a1 Mon Sep 17 00:00:00 2001 +From 6df53bfebcf8ca65910a18220a6576fb110918a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <[email protected]> Date: Tue, 6 Nov 2018 14:50:47 +0100 Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map from compiler
@@ -28,17 +28,16 @@ Signed-off-by: Kai Kang <[email protected]> Update to fix buildpaths qa issue for '-ffile-prefix-map'. Signed-off-by: Khem Raj <[email protected]> - --- Configurations/unix-Makefile.tmpl | 16 +++++++++++++++- crypto/build.info | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl -index 09303c4..011bda1 100644 +index eff66e5..bc48f51 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl -@@ -514,13 +514,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), +@@ -503,13 +503,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
@@ -68,10 +67,10 @@ index 09303c4..011bda1 100644 # For x86 assembler: Set PROCESSOR to 386 if you want to support diff --git a/crypto/build.info b/crypto/build.info -index aee5c46..95c9577 100644 +index 8e4a885..95b0902 100644 --- a/crypto/build.info +++ b/crypto/build.info -@@ -115,7 +115,7 @@ DEFINE[../libcrypto]=$UPLINKDEF +@@ -114,7 +114,7 @@ DEFINE[../libcrypto]=$UPLINKDEF DEPEND[info.o]=buildinf.h DEPEND[cversion.o]=buildinf.h
meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patch +2 -2
@@ -1,4 +1,4 @@ -From c7000672296f4c367341aa3415f26c4d9f5e4749 Mon Sep 17 00:00:00 2001 +From 14856dbd767621ce6f162680c00557b54af0effb Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari <[email protected]> Date: Thu, 23 Oct 2025 11:24:36 +0200 Subject: [PATCH] extend check_cwm test timeout
@@ -15,7 +15,7 @@ Signed-off-by: Gyorgy Sarvari <[email protected]> 1 file changed, 5 insertions(+) diff --git a/test/radix/main.c b/test/radix/main.c -index 4a1e886a71..39f8c61ef9 100644 +index 0f3dc11..d925639 100644 --- a/test/radix/main.c +++ b/test/radix/main.c @@ -25,6 +25,11 @@ static int test_script(int idx)
meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +8 -20
@@ -11,7 +11,6 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ file://run-ptest \ file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ file://0001-Configure-do-not-tweak-mips-cflags.patch \ - file://0001-Added-handshake-history-reporting-when-test-fails.patch \ file://0001-extend-check_cwm-test-timeout.patch \ "
@@ -19,10 +18,9 @@ SRC_URI:append:class-nativesdk = " \ file://environment.d-openssl.sh \ " -SRC_URI[sha256sum] = "a8c0d28a529ca480f9f36cf5792e2cd21984552a3c8e4aa11a24aa31aeac98e8" +SRC_URI[sha256sum] = "2db3f3a0d6ea4b59e1f094ace2c8cd536dffb87cdc39084c5afa1e6f7f37dd09" -inherit lib_package multilib_header multilib_script ptest perlnative manpages -MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" +inherit lib_package multilib_header ptest perlnative manpages # OpenSSL publishes bugfix/security-only releases on its per-minor branches. # When the tracked series reaches EOL, bump the regex manually to the next
@@ -33,7 +31,6 @@ PACKAGECONFIG ?= "" PACKAGECONFIG:class-native = "" PACKAGECONFIG:class-nativesdk = "" -PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module" PACKAGECONFIG[legacy] = ",no-legacy" PACKAGECONFIG[tls1] = ",no-tls1" PACKAGECONFIG[tls1_1] = ",no-tls1_1"
@@ -57,8 +54,8 @@ EXTRA_OECONF:append:class-native = " --with-rand-seed=os,devrandom" EXTRA_OECONF:append:class-nativesdk = " --with-rand-seed=os,devrandom" # Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate. -EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' -EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"' #| threads_pthread.c:(.text+0x372): undefined reference to `__atomic_is_lock_free' EXTRA_OECONF:append:toolchain-clang:x86 = " -latomic"
@@ -204,12 +201,10 @@ do_install:append:class-native () { OPENSSL_CONF=\${OPENSSL_CONF:-${libdir}/ssl-3/openssl.cnf} \ SSL_CERT_DIR=\${SSL_CERT_DIR:-${libdir}/ssl-3/certs} \ SSL_CERT_FILE=\${SSL_CERT_FILE:-${libdir}/ssl-3/cert.pem} \ - OPENSSL_ENGINES=\${OPENSSL_ENGINES:-${libdir}/engines-3} \ OPENSSL_MODULES=\${OPENSSL_MODULES:-${libdir}/ossl-modules} - # Setting ENGINESDIR and MODULESDIR to invalid paths prevents host contamination, + # Setting MODULESDIR to invalid paths prevents host contamination, # but also breaks the generated libcrypto.pc file. Post-Fix it manually here. - sed -i 's|^enginesdir=\($.libdir.\)/.*|enginesdir=\1/engines-3|' ${D}${libdir}/pkgconfig/libcrypto.pc sed -i 's|^modulesdir=\($.libdir.\)/.*|modulesdir=\1/ossl-modules|' ${D}${libdir}/pkgconfig/libcrypto.pc }
@@ -252,10 +247,6 @@ do_install_ptest() { sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm ${D}${PTEST_PATH}/util/wrap.pl - install -d ${D}${PTEST_PATH}/engines - install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines/ - install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines/ - ln -s ${libdir}/engines-3/loader_attic.so ${D}${PTEST_PATH}/engines/ ln -s ${libdir}/ossl-modules/ ${D}${PTEST_PATH}/providers }
@@ -270,17 +261,14 @@ pkg_postinst_ontarget:${PN}-ossl-module-fips () { # file to be installed for both the openssl-bin package and the libcrypto # package since the openssl-bin package depends on the libcrypto package. -PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips" +PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips" FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}" FILES:libssl = "${libdir}/libssl${SOLIBS}" FILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf* \ ${libdir}/ssl-3/openssl.cnf* \ " -FILES:${PN}-engines = "${libdir}/engines-3" -# ${prefix} comes from what we pass into --prefix at configure time (which is used for INSTALLTOP) -FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3" -FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash" +FILES:${PN}-misc = "${libdir}/ssl-3/misc" FILES:${PN}-ossl-module-legacy = "${libdir}/ossl-modules/legacy.so" FILES:${PN}-ossl-module-fips = "${libdir}/ossl-modules/fips.so" FILES:${PN} =+ "${libdir}/ssl-3/* ${libdir}/ossl-modules/"
@@ -290,7 +278,7 @@ CONFFILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf" RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy" RDEPENDS:${PN}-misc = "perl" -RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed openssl-engines" +RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed" RRECOMMENDS:${PN}-ptest += "${PN}-ossl-module-legacy" RDEPENDS:${PN}-bin += "openssl-conf"
Re: [OE-core] [RFC v4 1/6] openssl: upgrade 3.5.7 -> 4.0.1
here are meta-openembedded failures
Quoted 689 lines · Jaipaul Cheernam via lists.openembedded.org
Upgrade OpenSSL from 3.5.7 to 4.0.1. This is a major version upgrade.
Changelog:
https://github.com/openssl/openssl/blob/openssl-4.0.1/CHANGES.mdNew CVE fixes not already in 3.5.7:
* CVE-2026-28386: Fixed OOB read in AES-CFB-128 on x86-64 with AVX-512
* CVE-2026-35188: Fixed double-free when checking OCSP stapled response
* CVE-2026-42765: Fixed NULL deref in cert verification with OCSP
* CVE-2026-42771: Fixed OOB read inX509_VERIFY_PARAM_set1_email()Major breaking changes in 4.0.0:
* Removed support for engines. The ENGINE API is fully removed.
* Removed support for SSLv3. SSLv3 has been deprecated since 2015.
* Removed support for the SSLv2 Client Hello.
* Removed per-version TLS method functions (SSLv3_method(),TLSv1_method(), TLSv1_1_method(), TLSv1_2_method()).* Removed
c_rehashscript tool. Use 'openssl rehash' instead.
*ASN1_STRINGhas been made opaque.
* Numerous API function signatures changed to include const qualifiers.
* libcrypto no longer cleans up globally allocated data viaatexit().
* Added AKID verification checks whenX509_V_FLAG_X509_STRICTis set.
* Support of deprecated elliptic curves in TLS disabled at compile-time by default.Recipe changes:
* Drop 0001-Added-handshake-history-reporting-when-test-fails.patch(merged upstream via PR #22481).* Refresh remaining patches against the new version.
* Remove ENGINE API artifacts: engines package, dasync.so/ossltest.so ptest installation, ENGINESDIR references,OPENSSL_ENGINESwrapper variable, and cryptodev-linux PACKAGECONFIG.Tested: ptest on qemux86-64:
Files=362, Tests=4310, Result: PASS
Passed: 338, Skipped: 24 (fips, lms, rc5, tfo, compression, sslversions, sslkeylogfile, external tests - all expected)
Failed: 0Signed-off-by Jaipaul Cheernam <[email protected]>--- ...ke-history-reporting-when-test-fails.patch | 366 ------------------ ...1-Configure-do-not-tweak-mips-cflags.patch | 6 +- ...sysroot-and-debug-prefix-map-from-co.patch | 11 +- .../0001-extend-check_cwm-test-timeout.patch | 4 +- .../{openssl_3.5.7.bb => openssl_4.0.1.bb} | 28 +- 5 files changed, 18 insertions(+), 397 deletions(-) delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch rename meta/recipes-connectivity/openssl/{openssl_3.5.7.bb =>openssl_4.0.1.bb} (87%)
diff --git
a/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patchb/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patchdeleted file mode 100644
index a74c79303f..0000000000
---a/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch+++/dev/nullmeta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-6@@ -1,366 +0,0 @@ -From 5ba65051fea0513db0d997f0ab7cafb9826ed74a Mon Sep 17 00:00:00 2001 -From: William Lyu <[email protected]> -Date: Fri, 20 Oct 2023 16:22:37 -0400 -Subject: [PATCH] Added handshake history reporting when test fails - -Upstream-Status: Submitted [https://github.com/openssl/openssl/pull/22481]
meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-51- -Signed-off-by: William Lyu <[email protected]> ---- - test/helpers/handshake.c | 136 ++++++++++++++++++++++++++++++--------- - test/helpers/handshake.h | 70 +++++++++++++++++++- - test/ssl_test.c | 44 +++++++++++++ - 3 files changed, 217 insertions(+), 33 deletions(-) - -diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c -index f611b3a..5703b48 100644 ---- a/test/helpers/handshake.c -+++ b/test/helpers/handshake.c -@@ -25,6 +25,102 @@ - #include <netinet/sctp.h> - #endif - -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+/* Maps string names to various enumeration type */ -+typedef struct { -+ const char *name; -+ int value; -+} enum_name_map; -+ -+static const enum_name_map connect_phase_names[] = { -+ {"Handshake", HANDSHAKE}, -+ {"RenegAppData", RENEG_APPLICATION_DATA}, -+ {"RenegSetup", RENEG_SETUP}, -+ {"RenegHandshake", RENEG_HANDSHAKE}, -+ {"AppData", APPLICATION_DATA}, -+ {"Shutdown", SHUTDOWN}, -+ {"ConnectionDone", CONNECTION_DONE} -+}; -+ -+static const enum_name_map peer_status_names[] = { -+ {"PeerSuccess", PEER_SUCCESS}, -+ {"PeerRetry", PEER_RETRY}, -+ {"PeerError", PEER_ERROR}, -+ {"PeerWaiting", PEER_WAITING}, -+ {"PeerTestFail", PEER_TEST_FAILURE} -+}; -+ -+static const enum_name_map handshake_status_names[] = { -+ {"HandshakeSuccess", HANDSHAKE_SUCCESS}, -+ {"ClientError", CLIENT_ERROR}, -+ {"ServerError", SERVER_ERROR}, -+ {"InternalError", INTERNAL_ERROR}, -+ {"HandshakeRetry", HANDSHAKE_RETRY} -+}; -+ -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+static const char *enum_name(const enum_name_map *enums, size_t
num_enums,
-+ int value)
-+{
-+size_ti;
-+ for (i = 0; i <num_enums; i++) {
-+ if (enums[i].value == value) {
-+ return enums[i].name;
-+ }
-+ }
-+ return "InvalidValue";
-+}
-+
-+const char *handshake_connect_phase_name(connect_phase_t phase) -+{
-+ return enum_name(connect_phase_names,OSSL_NELEM(connect_phase_names),
-+ (int)phase);
-+}
-+
-+const char *handshake_status_name(handshake_status_thandshake_status) -+{
-+ return enum_name(handshake_status_names,OSSL_NELEM(handshake_status_names),
-+ (int)handshake_status);
-+}
-+
-+const char *handshake_peer_status_name(peer_status_tpeer_status) -+{
-+ return enum_name(peer_status_names,OSSL_NELEM(peer_status_names),
-+ (int)peer_status);
-+}
-+
-+static void save_loop_history(HANDSHAKE_HISTORY *history,-+ connect_phase_t phase, -+ handshake_status_t handshake_status, -+ peer_status_t server_status, -+ peer_status_t client_status, -+ int client_turn_count, -+ int is_client_turn)-+{
-+HANDSHAKE_HISTORY_ENTRY*new_entry= NULL;
-+
-+ /*
-+ * Create a new history entry for a handshake loop with statuses
given in-+ * the arguments. Potentially evicting the oldest entry when the -+ * ring buffer is full. -+ */ -+ ++(history->last_idx); -+ history->last_idx &= MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ -+ new_entry = &((history->entries)[history->last_idx]); -+ new_entry->phase = phase; -+ new_entry->handshake_status = handshake_status; -+ new_entry->server_status = server_status; -+ new_entry->client_status = client_status; -+ new_entry->client_turn_count = client_turn_count; -+ new_entry->is_client_turn = is_client_turn;-+
-+ /* Evict the oldest handshake loop entry when the ring buffer is
full. */
-+ if (history->entry_count<MAX_HANDSHAKE_HISTORY_ENTRY) {
-+ ++(history->entry_count);
-+ }
-+}
-+
-HANDSHAKE_RESULT*HANDSHAKE_RESULT_new(void)
- {
-HANDSHAKE_RESULT*ret;
-@@ -724,15 +820,6 @@ static void configure_handshake_ssl(SSL *server, SSL *client,meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-33- SSL_set_post_handshake_auth(client, 1); - } - --/* The status for each connection phase. */ --typedef enum { -- PEER_SUCCESS, -- PEER_RETRY, -- PEER_ERROR, -- PEER_WAITING, -- PEER_TEST_FAILURE --} peer_status_t; -- - /* An SSL object and associated read-write buffers. */ - typedef struct peer_st { - SSL *ssl; -@@ -1077,16 +1164,6 @@ static void do_shutdown_step(PEER *peer) - } - } - --typedef enum { -- HANDSHAKE, -- RENEG_APPLICATION_DATA, -- RENEG_SETUP, -- RENEG_HANDSHAKE, -- APPLICATION_DATA, -- SHUTDOWN, -- CONNECTION_DONE --} connect_phase_t; -- - static int renegotiate_op(const SSL_TEST_CTX *test_ctx) - { - switch (test_ctx->handshake_mode) { -@@ -1164,19 +1241,6 @@ static void do_connect_step(const SSL_TEST_CTX
*test_ctx, PEER *peer,meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-30- } - } - --typedef enum { -- /* Both parties succeeded. */ -- HANDSHAKE_SUCCESS, -- /* Client errored. */ -- CLIENT_ERROR, -- /* Server errored. */ -- SERVER_ERROR, -- /* Peers are in inconsistent state. */ -- INTERNAL_ERROR, -- /* One or both peers not done. */ -- HANDSHAKE_RETRY --} handshake_status_t; -- - /* - * Determine the handshake outcome. - * last_status: the status of the peer to have acted last. -@@ -1541,6 +1605,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( - - start = time(NULL); - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - /* - * Half-duplex handshake loop. - * Client and server speak to each other synchronously in the sameprocess.
-@@ -1562,6 +1630,10 @@ staticHANDSHAKE_RESULT*do_handshake_internal(meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-20- 0 /* server went last */); - } - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - switch (status) { - case HANDSHAKE_SUCCESS: - client_turn_count = 0; -diff --git a/test/helpers/handshake.h b/test/helpers/handshake.h -index 78b03f9..b9967c2 100644 ---- a/test/helpers/handshake.h -+++ b/test/helpers/handshake.h -@@ -1,5 +1,5 @@ - /* -- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. -+ * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may notuse
- * this file except in compliance with the License. You can obtain a copy
-@@ -12,6 +12,11 @@meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-5- - #include "ssl_test_ctx.h" - -+#define MAX_HANDSHAKE_HISTORY_ENTRY_BIT 4 -+#define MAX_HANDSHAKE_HISTORY_ENTRY (1 <<
MAX_HANDSHAKE_HISTORY_ENTRY_BIT)
-+#defineMAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK\
-+ ((1 <<MAX_HANDSHAKE_HISTORY_ENTRY_BIT) - 1)
-+
- typedef structctx_data_st{meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-53- unsigned char *npn_protocols; - size_t npn_protocols_len; -@@ -22,6 +27,63 @@ typedef struct ctx_data_st { - char *session_ticket_app_data; - } CTX_DATA; - -+typedef enum { -+ HANDSHAKE, -+ RENEG_APPLICATION_DATA, -+ RENEG_SETUP, -+ RENEG_HANDSHAKE, -+ APPLICATION_DATA, -+ SHUTDOWN, -+ CONNECTION_DONE -+} connect_phase_t; -+ -+/* The status for each connection phase. */ -+typedef enum { -+ PEER_SUCCESS, -+ PEER_RETRY, -+ PEER_ERROR, -+ PEER_WAITING, -+ PEER_TEST_FAILURE -+} peer_status_t; -+ -+typedef enum { -+ /* Both parties succeeded. */ -+ HANDSHAKE_SUCCESS, -+ /* Client errored. */ -+ CLIENT_ERROR, -+ /* Server errored. */ -+ SERVER_ERROR, -+ /* Peers are in inconsistent state. */ -+ INTERNAL_ERROR, -+ /* One or both peers not done. */ -+ HANDSHAKE_RETRY -+} handshake_status_t; -+ -+/* Stores the various status information in a handshake loop. */ -+typedef struct handshake_history_entry_st { -+ connect_phase_t phase; -+ handshake_status_t handshake_status; -+ peer_status_t server_status; -+ peer_status_t client_status; -+ int client_turn_count; -+ int is_client_turn; -+} HANDSHAKE_HISTORY_ENTRY; -+ -+typedef struct handshake_history_st { -+ /* Implemented using ring buffer. */ -+ /* -+ * The valid entries are |entries[last_idx]|, |entries[last_idx-1]|, -+ * ..., etc., going up to |entry_count| number of entries. Note thatwhen
-+ * the index into the array |entries| becomes < 0, we wrap around to -+ * the end of |entries|. -+ */ -+ HANDSHAKE_HISTORY_ENTRY entries[MAX_HANDSHAKE_HISTORY_ENTRY]; -+ /* The number of valid entries in |entries| array. */ -+ size_t entry_count; -+ /* The index of the last valid entry in the |entries| array. */ -+ size_t last_idx;-+}
HANDSHAKE_HISTORY;
-+
- typedef structhandshake_result{(quoted diff) +0
-2- ssl_test_result_t result; - /* These alerts are in the 2-byte format returned by the
info_callback. */
-@@ -77,6 +139,8 @@ typedef structhandshake_result{meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-9- char *cipher; - /* session ticket application data */ - char *result_session_ticket_app_data; -+ /* handshake loop history */ -+ HANDSHAKE_HISTORY history; - } HANDSHAKE_RESULT; - - HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void); -@@ -95,4 +159,8 @@ int configure_handshake_ctx_for_srp(SSL_CTX
*server_ctx,SSL_CTX*server2_ctx,meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-14- CTX_DATA *server2_ctx_data, - CTX_DATA *client_ctx_data); - -+const char *handshake_connect_phase_name(connect_phase_t phase); -+const char *handshake_status_name(handshake_status_t handshake_status); -+const char *handshake_peer_status_name(peer_status_t peer_status); -+ - #endif /* OSSL_TEST_HANDSHAKE_HELPER_H */ -diff --git a/test/ssl_test.c b/test/ssl_test.c -index ea60851..9d6b093 100644 ---- a/test/ssl_test.c -+++ b/test/ssl_test.c -@@ -26,6 +26,44 @@ static OSSL_LIB_CTX *libctx = NULL; - /* Currently the section names are of the form test-<number>, e.g.test-15. */
- #defineMAX_TESTCASE_NAME_LENGTH100meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-43- -+static void print_handshake_history(const HANDSHAKE_HISTORY *history) -+{ -+ size_t first_idx; -+ size_t i; -+ size_t cur_idx; -+ const HANDSHAKE_HISTORY_ENTRY *cur_entry; -+ const char header_template[] = "|%14s|%16s|%16s|%16s|%17s|%14s|"; -+ const char body_template[] = "|%14s|%16s|%16s|%16s|%17d|%14s|"; -+ -+ TEST_info("The following is the server/client state " -+ "in the most recent %d handshake loops.", -+ MAX_HANDSHAKE_HISTORY_ENTRY); -+ -+ TEST_note("==================================================" -+ "=================================================="); -+ TEST_note(header_template, -+ "phase", "handshake status", "server status", -+ "client status", "client turn count", "is client turn"); -+ TEST_note("+--------------+----------------+----------------" -+ "+----------------+-----------------+--------------+"); -+ -+ first_idx = (history->last_idx - history->entry_count + 1) & -+ MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ for (i = 0; i < history->entry_count; ++i) { -+ cur_idx = (first_idx + i) & MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ cur_entry = &(history->entries)[cur_idx]; -+ TEST_note(body_template, -+ handshake_connect_phase_name(cur_entry->phase), -+ handshake_status_name(cur_entry->handshake_status), -+ handshake_peer_status_name(cur_entry->server_status), -+ handshake_peer_status_name(cur_entry->client_status), -+ cur_entry->client_turn_count, -+ cur_entry->is_client_turn ? "true" : "false"); -+ } -+ TEST_note("==================================================" -+ "=================================================="); -+} -+ - static const char *print_alert(int alert) - { - return alert ? SSL_alert_desc_string_long(alert) : "no alert"; -@@ -388,6 +426,12 @@ static int check_test(HANDSHAKE_RESULT *result,
SSL_TEST_CTX*test_ctx)meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-15- ret &= check_client_sign_type(result, test_ctx); - ret &= check_client_ca_names(result, test_ctx); - } -+ -+ /* Print handshake loop history if any check fails. */ -+ if (!ret) { -+ print_handshake_history(&(result->history)); -+ } -+ - return ret; - } - --- -2.25.1 -diff --git
a/meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patchb/meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patchindexcd8906df67..77bfe4e4e5100644
---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.patchmeta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch +3
-5@@ -1,4 +1,4 @@ -From 0377f0d5b5c1079e3b9a80881f4dcc891cbe9f9a Mon Sep 17 00:00:00 2001 +From b5cee0cb0f14a78056ef7722a34b361491f1fdda Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <[email protected]> Date: Tue, 30 May 2023 09:11:27 -0700 Subject: [PATCH] Configure: do not tweak mips cflags@@ -17,10 +17,10 @@ Signed-off-by: Tim Orling <[email protected]> 1 file changed, 10 deletions(-) diff --git a/Configure b/Configure -index fff97bd..5ee54c1 100755 +index c05a30b..db8adee 100755 --- a/Configure +++ b/Configure -@@ -1557,16 +1557,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) +@@ -1575,16 +1575,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) push @{$config{shared_ldflag}}, "-mno-cygwin"; }diff --git
a/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patchb/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patchindexbfbfedbd67..1d9e7539f6100644
---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.patchmeta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +1
-1@@ -1,4 +1,4 @@ -From 5985253f2c9025d7c127443a3a9938946f80c2a1 Mon Sep 17 00:00:00 2001 +From 6df53bfebcf8ca65910a18220a6576fb110918a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <[email protected]> Date: Tue, 6 Nov 2018 14:50:47 +0100 Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map fromcompiler
meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +0
-1@@ -28,17 +28,16 @@ Signed-off-by: Kai Kang <[email protected]> Update to fix buildpaths qa issue for '-ffile-prefix-map'. Signed-off-by: Khem Raj <[email protected]> - --- Configurations/unix-Makefile.tmpl | 16 +++++++++++++++- crypto/build.info | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Configurations/unix-Makefile.tmplb/Configurations/unix-Makefile.tmpl
meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +4
-4-index 09303c4..011bda1 100644 +index eff66e5..bc48f51 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl -@@ -514,13 +514,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), +@@ -503,13 +503,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)@@ -68,10 +67,10 @@ index 09303c4..011bda1 100644 # For x86 assembler: Set PROCESSOR to 386 if you want to support diff --git a/crypto/build.info b/crypto/build.info -index aee5c46..95c9577 100644 +index 8e4a885..95b0902 100644 --- a/crypto/build.info +++ b/crypto/build.info -@@ -115,7 +115,7 @@ DEFINE[../libcrypto]=$UPLINKDEF +@@ -114,7 +114,7 @@ DEFINE[../libcrypto]=$UPLINKDEF DEPEND[info.o]=buildinf.h DEPEND[cversion.o]=buildinf.hdiff --git
a/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patchb/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patchindexf6eb28069a..76bc05d5f9100644
---a/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patch
+++b/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patchmeta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patch +2
-2@@ -1,4 +1,4 @@ -From c7000672296f4c367341aa3415f26c4d9f5e4749 Mon Sep 17 00:00:00 2001 +From 14856dbd767621ce6f162680c00557b54af0effb Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari <[email protected]> Date: Thu, 23 Oct 2025 11:24:36 +0200 Subject: [PATCH] extend check_cwm test timeout@@ -15,7 +15,7 @@ Signed-off-by: Gyorgy Sarvari <[email protected]> 1 file changed, 5 insertions(+) diff --git a/test/radix/main.c b/test/radix/main.c -index 4a1e886a71..39f8c61ef9 100644 +index 0f3dc11..d925639 100644 --- a/test/radix/main.c +++ b/test/radix/main.c @@ -25,6 +25,11 @@ static int test_script(int idx)meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -11,7 +11,6 @@ SRC_URI = " http://www.openssl.org/source/openssl-${PV}.tar.gz \ file://run-ptest \ file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ file://0001-Configure-do-not-tweak-mips-cflags.patch \ - file://0001-Added-handshake-history-reporting-when-test-fails.patch \file://0001-extend-check_cwm-test-timeout.patch \ "meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -19,10 +18,9 @@ SRC_URI:append:class-nativesdk = " \ file://environment.d-openssl.sh \ " -SRC_URI[sha256sum] ="
a8c0d28a529ca480f9f36cf5792e2cd21984552a3c8e4aa11a24aa31aeac98e8" +SRC_URI[sha256sum] = "2db3f3a0d6ea4b59e1f094ace2c8cd536dffb87cdc39084c5afa1e6f7f37dd09"-inherit
lib_packagemultilib_headermultilib_scriptptest perlnative manpagesmeta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +1
-1-MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" +inherit lib_package multilib_header ptest perlnative manpages # OpenSSL publishes bugfix/security-only releases on its per-minorbranches.
# When the tracked series reaches EOL, bump the regex manually to the nextmeta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -33,7 +31,6 @@ PACKAGECONFIG ?= "" PACKAGECONFIG:class-native = "" PACKAGECONFIG:class-nativesdk = "" -PACKAGECONFIG[cryptodev-linux] ="enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module"
PACKAGECONFIG[legacy] = ",no-legacy"
PACKAGECONFIG[tls1] = ",no-tls1"
PACKAGECONFIG[tls1_1] = ",no-tls1_1"meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -57,8 +54,8 @@ EXTRA_OECONF:append:class-native = " --with-rand-seed=os,devrandom" EXTRA_OECONF:append:class-nativesdk = " --with-rand-seed=os,devrandom" # Relying on hardcoded built-in paths causes openssl-native to not berelocateable from sstate. -EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' -EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"'
#| threads_pthread.c:(.text+0x372): undefined reference to
`__atomic_is_lock_free'
EXTRA_OECONF:append:toolchain-clang:x86 = " -latomic"meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +1
-2@@ -204,12 +201,10 @@ do_install:append:class-native () { OPENSSL_CONF=\${OPENSSL_CONF:-${libdir}/ssl-3/openssl.cnf} \ SSL_CERT_DIR=\${SSL_CERT_DIR:-${libdir}/ssl-3/certs} \ SSL_CERT_FILE=\${SSL_CERT_FILE:-${libdir}/ssl-3/cert.pem} \ - OPENSSL_ENGINES=\${OPENSSL_ENGINES:-${libdir}/engines-3} \ OPENSSL_MODULES=\${OPENSSL_MODULES:-${libdir}/ossl-modules} - # Setting ENGINESDIR and MODULESDIR to invalid paths prevents host contamination, + # Setting MODULESDIR to invalid paths prevents host contamination, # but also breaks the generated libcrypto.pc file. Post-Fix itmanually here.
- sed -i 's|^enginesdir=\($.libdir.\)/.*|enginesdir=\1/engines-3|'
${D}${libdir}/pkgconfig/libcrypto.pc
sed -i
's|^modulesdir=\($.libdir.\)/.*|modulesdir=\1/ossl-modules|' ${D}${libdir}/pkgconfig/libcrypto.pc
}meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-0@@ -252,10 +247,6 @@ do_install_ptest() { sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm
${D}${PTEST_PATH}/util/wrap.plmeta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-4- install -d ${D}${PTEST_PATH}/engines - install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines/ - install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines/ - ln -s ${libdir}/engines-3/loader_attic.so${D}${PTEST_PATH}/engines/
ln -s ${libdir}/ossl-modules/ ${D}${PTEST_PATH}/providers}
meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -270,17 +261,14 @@ pkg_postinst_ontarget:${PN}-ossl-module-fips () { # file to be installed for both the openssl-bin package and the libcrypto # package since the openssl-bin package depends on the libcrypto package. -PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc${PN}-ossl-module-legacy ${PN}-ossl-module-fips" +PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips"
FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}"
FILES:libssl = "${libdir}/libssl${SOLIBS}"FILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf* \ ${libdir}/ssl-3/openssl.cnf* \ "meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-2-FILES:${PN}-engines = "${libdir}/engines-3" -# ${prefix} comes from what we pass into --prefix at configure time(which is used for INSTALLTOP) -FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3"
meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +1
-1-FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash" +FILES:${PN}-misc = "${libdir}/ssl-3/misc" FILES:${PN}-ossl-module-legacy = "${libdir}/ossl-modules/legacy.so" FILES:${PN}-ossl-module-fips = "${libdir}/ossl-modules/fips.so" FILES:${PN} =+ "${libdir}/ssl-3/* ${libdir}/ossl-modules/"@@ -290,7 +278,7 @@ CONFFILES:openssl-conf ="${sysconfdir}/ssl/openssl.cnf"
RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy" RDEPENDS:${PN}-misc = "perl"
-RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed openssl-engines"
+RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed"
RRECOMMENDS:${PN}-ptest += "${PN}-ossl-module-legacy"RDEPENDS:${PN}-bin += "openssl-conf"
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#243993):
https://lists.openembedded.org/g/openembedded-core/message/243993
Mute This Topic: https://lists.openembedded.org/mt/120878892/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [RFC v4 1/6] openssl: upgrade 3.5.7 -> 4.0.1
https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/8474313/raw_inline
Quoted 697 lines · Khem Raj
here are meta-openembedded failures
Quoted 691 lines · Jaipaul Cheernam via lists.openembedded.org
Upgrade OpenSSL from 3.5.7 to 4.0.1. This is a major version upgrade.
Changelog:
https://github.com/openssl/openssl/blob/openssl-4.0.1/CHANGES.mdNew CVE fixes not already in 3.5.7:
* CVE-2026-28386: Fixed OOB read in AES-CFB-128 on x86-64 with AVX-512
* CVE-2026-35188: Fixed double-free when checking OCSP stapled response
* CVE-2026-42765: Fixed NULL deref in cert verification with OCSP
* CVE-2026-42771: Fixed OOB read inX509_VERIFY_PARAM_set1_email()Major breaking changes in 4.0.0:
* Removed support for engines. The ENGINE API is fully removed.
* Removed support for SSLv3. SSLv3 has been deprecated since 2015.
* Removed support for the SSLv2 Client Hello.
* Removed per-version TLS method functions (SSLv3_method(),TLSv1_method(), TLSv1_1_method(), TLSv1_2_method()).* Removed
c_rehashscript tool. Use 'openssl rehash' instead.
*ASN1_STRINGhas been made opaque.
* Numerous API function signatures changed to include const qualifiers.
* libcrypto no longer cleans up globally allocated data viaatexit().
* Added AKID verification checks whenX509_V_FLAG_X509_STRICTis set.
* Support of deprecated elliptic curves in TLS disabled at compile-time by default.Recipe changes:
* Drop 0001-Added-handshake-history-reporting-when-test-fails.patch(merged upstream via PR #22481).* Refresh remaining patches against the new version.
* Remove ENGINE API artifacts: engines package, dasync.so/ossltest.so ptest installation, ENGINESDIR references,OPENSSL_ENGINESwrapper variable, and cryptodev-linux PACKAGECONFIG.Tested: ptest on qemux86-64:
Files=362, Tests=4310, Result: PASS
Passed: 338, Skipped: 24 (fips, lms, rc5, tfo, compression, sslversions, sslkeylogfile, external tests - all expected)
Failed: 0Signed-off-by Jaipaul Cheernam <[email protected]>--- ...ke-history-reporting-when-test-fails.patch | 366 ------------------ ...1-Configure-do-not-tweak-mips-cflags.patch | 6 +- ...sysroot-and-debug-prefix-map-from-co.patch | 11 +- .../0001-extend-check_cwm-test-timeout.patch | 4 +- .../{openssl_3.5.7.bb => openssl_4.0.1.bb} | 28 +- 5 files changed, 18 insertions(+), 397 deletions(-) delete mode 100644 meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch rename meta/recipes-connectivity/openssl/{openssl_3.5.7.bb =>openssl_4.0.1.bb} (87%)
diff --git
a/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patchb/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patchdeleted file mode 100644
index a74c79303f..0000000000
---a/meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch+++/dev/nullmeta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-6@@ -1,366 +0,0 @@ -From 5ba65051fea0513db0d997f0ab7cafb9826ed74a Mon Sep 17 00:00:00 2001 -From: William Lyu <[email protected]> -Date: Fri, 20 Oct 2023 16:22:37 -0400 -Subject: [PATCH] Added handshake history reporting when test fails - -Upstream-Status: Submitted [https://github.com/openssl/openssl/pull/22481]
meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-51- -Signed-off-by: William Lyu <[email protected]> ---- - test/helpers/handshake.c | 136 ++++++++++++++++++++++++++++++--------- - test/helpers/handshake.h | 70 +++++++++++++++++++- - test/ssl_test.c | 44 +++++++++++++ - 3 files changed, 217 insertions(+), 33 deletions(-) - -diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c -index f611b3a..5703b48 100644 ---- a/test/helpers/handshake.c -+++ b/test/helpers/handshake.c -@@ -25,6 +25,102 @@ - #include <netinet/sctp.h> - #endif - -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+/* Maps string names to various enumeration type */ -+typedef struct { -+ const char *name; -+ int value; -+} enum_name_map; -+ -+static const enum_name_map connect_phase_names[] = { -+ {"Handshake", HANDSHAKE}, -+ {"RenegAppData", RENEG_APPLICATION_DATA}, -+ {"RenegSetup", RENEG_SETUP}, -+ {"RenegHandshake", RENEG_HANDSHAKE}, -+ {"AppData", APPLICATION_DATA}, -+ {"Shutdown", SHUTDOWN}, -+ {"ConnectionDone", CONNECTION_DONE} -+}; -+ -+static const enum_name_map peer_status_names[] = { -+ {"PeerSuccess", PEER_SUCCESS}, -+ {"PeerRetry", PEER_RETRY}, -+ {"PeerError", PEER_ERROR}, -+ {"PeerWaiting", PEER_WAITING}, -+ {"PeerTestFail", PEER_TEST_FAILURE} -+}; -+ -+static const enum_name_map handshake_status_names[] = { -+ {"HandshakeSuccess", HANDSHAKE_SUCCESS}, -+ {"ClientError", CLIENT_ERROR}, -+ {"ServerError", SERVER_ERROR}, -+ {"InternalError", INTERNAL_ERROR}, -+ {"HandshakeRetry", HANDSHAKE_RETRY} -+}; -+ -+/* Shamelessly copied from test/helpers/ssl_test_ctx.c */ -+static const char *enum_name(const enum_name_map *enums, size_t
num_enums,
-+ int value)
-+{
-+size_ti;
-+ for (i = 0; i <num_enums; i++) {
-+ if (enums[i].value == value) {
-+ return enums[i].name;
-+ }
-+ }
-+ return "InvalidValue";
-+}
-+
-+const char *handshake_connect_phase_name(connect_phase_t phase) -+{
-+ return enum_name(connect_phase_names,OSSL_NELEM(connect_phase_names),
-+ (int)phase);
-+}
-+
-+const char *handshake_status_name(handshake_status_thandshake_status) -+{
-+ return enum_name(handshake_status_names,OSSL_NELEM(handshake_status_names),
-+ (int)handshake_status);
-+}
-+
-+const char *handshake_peer_status_name(peer_status_tpeer_status) -+{
-+ return enum_name(peer_status_names,OSSL_NELEM(peer_status_names),
-+ (int)peer_status);
-+}
-+
-+static void save_loop_history(HANDSHAKE_HISTORY *history,-+ connect_phase_t phase, -+ handshake_status_t handshake_status, -+ peer_status_t server_status, -+ peer_status_t client_status, -+ int client_turn_count, -+ int is_client_turn)-+{
-+HANDSHAKE_HISTORY_ENTRY*new_entry= NULL;
-+
-+ /*
-+ * Create a new history entry for a handshake loop with statuses
given in-+ * the arguments. Potentially evicting the oldest entry when the -+ * ring buffer is full. -+ */ -+ ++(history->last_idx); -+ history->last_idx &= MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK; -+ -+ new_entry = &((history->entries)[history->last_idx]); -+ new_entry->phase = phase; -+ new_entry->handshake_status = handshake_status; -+ new_entry->server_status = server_status; -+ new_entry->client_status = client_status; -+ new_entry->client_turn_count = client_turn_count; -+ new_entry->is_client_turn = is_client_turn;-+
-+ /* Evict the oldest handshake loop entry when the ring buffer is
full. */
-+ if (history->entry_count<MAX_HANDSHAKE_HISTORY_ENTRY) {
-+ ++(history->entry_count);
-+ }
-+}
-+
-HANDSHAKE_RESULT*HANDSHAKE_RESULT_new(void)
- {
-HANDSHAKE_RESULT*ret;
-@@ -724,15 +820,6 @@ static void configure_handshake_ssl(SSL *server, SSL *client,meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-33- SSL_set_post_handshake_auth(client, 1); - } - --/* The status for each connection phase. */ --typedef enum { -- PEER_SUCCESS, -- PEER_RETRY, -- PEER_ERROR, -- PEER_WAITING, -- PEER_TEST_FAILURE --} peer_status_t; -- - /* An SSL object and associated read-write buffers. */ - typedef struct peer_st { - SSL *ssl; -@@ -1077,16 +1164,6 @@ static void do_shutdown_step(PEER *peer) - } - } - --typedef enum { -- HANDSHAKE, -- RENEG_APPLICATION_DATA, -- RENEG_SETUP, -- RENEG_HANDSHAKE, -- APPLICATION_DATA, -- SHUTDOWN, -- CONNECTION_DONE --} connect_phase_t; -- - static int renegotiate_op(const SSL_TEST_CTX *test_ctx) - { - switch (test_ctx->handshake_mode) { -@@ -1164,19 +1241,6 @@ static void do_connect_step(const SSL_TEST_CTX
*test_ctx, PEER *peer,meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-30- } - } - --typedef enum { -- /* Both parties succeeded. */ -- HANDSHAKE_SUCCESS, -- /* Client errored. */ -- CLIENT_ERROR, -- /* Server errored. */ -- SERVER_ERROR, -- /* Peers are in inconsistent state. */ -- INTERNAL_ERROR, -- /* One or both peers not done. */ -- HANDSHAKE_RETRY --} handshake_status_t; -- - /* - * Determine the handshake outcome. - * last_status: the status of the peer to have acted last. -@@ -1541,6 +1605,10 @@ static HANDSHAKE_RESULT *do_handshake_internal( - - start = time(NULL); - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - /* - * Half-duplex handshake loop. - * Client and server speak to each other synchronously in the sameprocess.
-@@ -1562,6 +1630,10 @@ staticHANDSHAKE_RESULT*do_handshake_internal(meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-20- 0 /* server went last */); - } - -+ save_loop_history(&(ret->history), -+ phase, status, server.status, client.status, -+ client_turn_count, client_turn); -+ - switch (status) { - case HANDSHAKE_SUCCESS: - client_turn_count = 0; -diff --git a/test/helpers/handshake.h b/test/helpers/handshake.h -index 78b03f9..b9967c2 100644 ---- a/test/helpers/handshake.h -+++ b/test/helpers/handshake.h -@@ -1,5 +1,5 @@ - /* -- * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. -+ * Copyright 2016-2023 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may notuse
- * this file except in compliance with the License. You can obtain a copy
-@@ -12,6 +12,11 @@meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-5- - #include "ssl_test_ctx.h" - -+#define MAX_HANDSHAKE_HISTORY_ENTRY_BIT 4 -+#define MAX_HANDSHAKE_HISTORY_ENTRY (1 <<
MAX_HANDSHAKE_HISTORY_ENTRY_BIT)
-+#defineMAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK\
-+ ((1 <<MAX_HANDSHAKE_HISTORY_ENTRY_BIT) - 1)
-+
- typedef structctx_data_st{meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-53- unsigned char *npn_protocols; - size_t npn_protocols_len; -@@ -22,6 +27,63 @@ typedef struct ctx_data_st { - char *session_ticket_app_data; - } CTX_DATA; - -+typedef enum { -+ HANDSHAKE, -+ RENEG_APPLICATION_DATA, -+ RENEG_SETUP, -+ RENEG_HANDSHAKE, -+ APPLICATION_DATA, -+ SHUTDOWN, -+ CONNECTION_DONE -+} connect_phase_t; -+ -+/* The status for each connection phase. */ -+typedef enum { -+ PEER_SUCCESS, -+ PEER_RETRY, -+ PEER_ERROR, -+ PEER_WAITING, -+ PEER_TEST_FAILURE -+} peer_status_t; -+ -+typedef enum { -+ /* Both parties succeeded. */ -+ HANDSHAKE_SUCCESS, -+ /* Client errored. */ -+ CLIENT_ERROR, -+ /* Server errored. */ -+ SERVER_ERROR, -+ /* Peers are in inconsistent state. */ -+ INTERNAL_ERROR, -+ /* One or both peers not done. */ -+ HANDSHAKE_RETRY -+} handshake_status_t; -+ -+/* Stores the various status information in a handshake loop. */ -+typedef struct handshake_history_entry_st { -+ connect_phase_t phase; -+ handshake_status_t handshake_status; -+ peer_status_t server_status; -+ peer_status_t client_status; -+ int client_turn_count; -+ int is_client_turn; -+} HANDSHAKE_HISTORY_ENTRY; -+ -+typedef struct handshake_history_st { -+ /* Implemented using ring buffer. */ -+ /* -+ * The valid entries are |entries[last_idx]|, |entries[last_idx-1]|, -+ * ..., etc., going up to |entry_count| number of entries. Notethat when
-+ * the index into the array |entries| becomes < 0, we wrap around to -+ * the end of |entries|. -+ */ -+ HANDSHAKE_HISTORY_ENTRY entries[MAX_HANDSHAKE_HISTORY_ENTRY]; -+ /* The number of valid entries in |entries| array. */ -+ size_t entry_count; -+ /* The index of the last valid entry in the |entries| array. */ -+ size_t last_idx;-+}
HANDSHAKE_HISTORY;
-+
- typedef structhandshake_result{(quoted diff) +0
-2- ssl_test_result_t result; - /* These alerts are in the 2-byte format returned by the
info_callback. */
-@@ -77,6 +139,8 @@ typedef structhandshake_result{meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-9- char *cipher; - /* session ticket application data */ - char *result_session_ticket_app_data; -+ /* handshake loop history */ -+ HANDSHAKE_HISTORY history; - } HANDSHAKE_RESULT; - - HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void); -@@ -95,4 +159,8 @@ int configure_handshake_ctx_for_srp(SSL_CTX
*server_ctx,SSL_CTX*server2_ctx,meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-14- CTX_DATA *server2_ctx_data, - CTX_DATA *client_ctx_data); - -+const char *handshake_connect_phase_name(connect_phase_t phase); -+const char *handshake_status_name(handshake_status_t handshake_status); -+const char *handshake_peer_status_name(peer_status_t peer_status); -+ - #endif /* OSSL_TEST_HANDSHAKE_HELPER_H */ -diff --git a/test/ssl_test.c b/test/ssl_test.c -index ea60851..9d6b093 100644 ---- a/test/ssl_test.c -+++ b/test/ssl_test.c -@@ -26,6 +26,44 @@ static OSSL_LIB_CTX *libctx = NULL; - /* Currently the section names are of the form test-<number>, e.g.test-15. */
- #defineMAX_TESTCASE_NAME_LENGTH100
-
-+static voidprint_handshake_history(const HANDSHAKE_HISTORY *history)-+{-+ size_t first_idx; -+ size_t i; -+ size_t cur_idx; -+ const HANDSHAKE_HISTORY_ENTRY *cur_entry; -+ const char header_template[] = "|%14s|%16s|%16s|%16s|%17s|%14s|"; -+ const char body_template[] = "|%14s|%16s|%16s|%16s|%17d|%14s|";-+
-+ TEST_info("The following is the server/client state "
-+ "in the most recent %d handshake loops.",
-+MAX_HANDSHAKE_HISTORY_ENTRY);
-+
-+ TEST_note("=================================================="
-+ "==================================================");
-+ TEST_note(header_template,
-+ "phase", "handshake status", "server status",
-+ "client status", "client turn count", "is client turn");
-+ TEST_note("+--------------+----------------+----------------"
-+ "+----------------+-----------------+--------------+");
-+
-+first_idx= (history->last_idx-history->entry_count+ 1) &
-+MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK;
-+ for (i = 0; i <history->entry_count; ++i) {
-+cur_idx= (first_idx+ i) &MAX_HANDSHAKE_HISTORY_ENTRY_IDX_MASK;
-+cur_entry= &(history->entries)[cur_idx];
-+ TEST_note(body_template,-+ handshake_connect_phase_name(cur_entry->phase), -+ handshake_status_name(cur_entry->handshake_status), -+ handshake_peer_status_name(cur_entry->server_status), -+ handshake_peer_status_name(cur_entry->client_status), -+ cur_entry->client_turn_count, -+ cur_entry->is_client_turn ? "true" : "false");-+ }
-+ TEST_note("=================================================="
-+ "==================================================");
-+}
-+
- static const char *print_alert(int alert)
- {
- return alert ?SSL_alert_desc_string_long(alert): "no alert";
-@@ -388,6 +426,12 @@ static intcheck_test(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx)meta/recipes-connectivity/openssl/openssl/0001-Added-handshake-history-reporting-when-test-fails.patch deleted +0
-15- ret &= check_client_sign_type(result, test_ctx); - ret &= check_client_ca_names(result, test_ctx); - } -+ -+ /* Print handshake loop history if any check fails. */ -+ if (!ret) { -+ print_handshake_history(&(result->history)); -+ } -+ - return ret; - } - --- -2.25.1 -diff --git
a/meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patchb/meta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patchindexcd8906df67..77bfe4e4e5100644
---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.patchmeta/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch +3
-5@@ -1,4 +1,4 @@ -From 0377f0d5b5c1079e3b9a80881f4dcc891cbe9f9a Mon Sep 17 00:00:00 2001 +From b5cee0cb0f14a78056ef7722a34b361491f1fdda Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <[email protected]> Date: Tue, 30 May 2023 09:11:27 -0700 Subject: [PATCH] Configure: do not tweak mips cflags@@ -17,10 +17,10 @@ Signed-off-by: Tim Orling <[email protected]> 1 file changed, 10 deletions(-) diff --git a/Configure b/Configure -index fff97bd..5ee54c1 100755 +index c05a30b..db8adee 100755 --- a/Configure +++ b/Configure -@@ -1557,16 +1557,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) +@@ -1575,16 +1575,6 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m) push @{$config{shared_ldflag}}, "-mno-cygwin"; }diff --git
a/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patchb/meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patchindexbfbfedbd67..1d9e7539f6100644
---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.patchmeta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +1
-1@@ -1,4 +1,4 @@ -From 5985253f2c9025d7c127443a3a9938946f80c2a1 Mon Sep 17 00:00:00 2001 +From 6df53bfebcf8ca65910a18220a6576fb110918a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <[email protected]> Date: Tue, 6 Nov 2018 14:50:47 +0100 Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map fromcompiler
meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +0
-1@@ -28,17 +28,16 @@ Signed-off-by: Kai Kang <[email protected]> Update to fix buildpaths qa issue for '-ffile-prefix-map'. Signed-off-by: Khem Raj <[email protected]> - --- Configurations/unix-Makefile.tmpl | 16 +++++++++++++++- crypto/build.info | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Configurations/unix-Makefile.tmplb/Configurations/unix-Makefile.tmpl
meta/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +4
-4-index 09303c4..011bda1 100644 +index eff66e5..bc48f51 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl -@@ -514,13 +514,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), +@@ -503,13 +503,27 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)@@ -68,10 +67,10 @@ index 09303c4..011bda1 100644 # For x86 assembler: Set PROCESSOR to 386 if you want to support diff --git a/crypto/build.info b/crypto/build.info -index aee5c46..95c9577 100644 +index 8e4a885..95b0902 100644 --- a/crypto/build.info +++ b/crypto/build.info -@@ -115,7 +115,7 @@ DEFINE[../libcrypto]=$UPLINKDEF +@@ -114,7 +114,7 @@ DEFINE[../libcrypto]=$UPLINKDEF DEPEND[info.o]=buildinf.h DEPEND[cversion.o]=buildinf.hdiff --git
a/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patchb/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patchindexf6eb28069a..76bc05d5f9100644
---a/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patch
+++b/meta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patchmeta/recipes-connectivity/openssl/openssl/0001-extend-check_cwm-test-timeout.patch +2
-2@@ -1,4 +1,4 @@ -From c7000672296f4c367341aa3415f26c4d9f5e4749 Mon Sep 17 00:00:00 2001 +From 14856dbd767621ce6f162680c00557b54af0effb Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari <[email protected]> Date: Thu, 23 Oct 2025 11:24:36 +0200 Subject: [PATCH] extend check_cwm test timeout@@ -15,7 +15,7 @@ Signed-off-by: Gyorgy Sarvari <[email protected]> 1 file changed, 5 insertions(+) diff --git a/test/radix/main.c b/test/radix/main.c -index 4a1e886a71..39f8c61ef9 100644 +index 0f3dc11..d925639 100644 --- a/test/radix/main.c +++ b/test/radix/main.c @@ -25,6 +25,11 @@ static int test_script(int idx)meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -11,7 +11,6 @@ SRC_URI = " http://www.openssl.org/source/openssl-${PV}.tar.gz \ file://run-ptest \ file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ file://0001-Configure-do-not-tweak-mips-cflags.patch \ - file://0001-Added-handshake-history-reporting-when-test-fails.patch \file://0001-extend-check_cwm-test-timeout.patch \ "meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -19,10 +18,9 @@ SRC_URI:append:class-nativesdk = " \ file://environment.d-openssl.sh \ " -SRC_URI[sha256sum] ="
a8c0d28a529ca480f9f36cf5792e2cd21984552a3c8e4aa11a24aa31aeac98e8" +SRC_URI[sha256sum] = "2db3f3a0d6ea4b59e1f094ace2c8cd536dffb87cdc39084c5afa1e6f7f37dd09"-inherit
lib_packagemultilib_headermultilib_scriptptest perlnative manpagesmeta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +1
-1-MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" +inherit lib_package multilib_header ptest perlnative manpages # OpenSSL publishes bugfix/security-only releases on its per-minorbranches.
# When the tracked series reaches EOL, bump the regex manually to the
nextmeta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -33,7 +31,6 @@ PACKAGECONFIG ?= "" PACKAGECONFIG:class-native = "" PACKAGECONFIG:class-nativesdk = "" -PACKAGECONFIG[cryptodev-linux] ="enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module"
PACKAGECONFIG[legacy] = ",no-legacy"
PACKAGECONFIG[tls1] = ",no-tls1"
PACKAGECONFIG[tls1_1] = ",no-tls1_1"meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -57,8 +54,8 @@ EXTRA_OECONF:append:class-native = " --with-rand-seed=os,devrandom" EXTRA_OECONF:append:class-nativesdk = " --with-rand-seed=os,devrandom" # Relying on hardcoded built-in paths causes openssl-native to not berelocateable from sstate. -EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' -EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" ENGINESDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-native = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"' +EXTRA_OEMAKE:append:task-compile:class-nativesdk = ' OPENSSLDIR="/not/builtin" MODULESDIR="/not/builtin"'
#| threads_pthread.c:(.text+0x372): undefined reference to
`__atomic_is_lock_free'
EXTRA_OECONF:append:toolchain-clang:x86 = " -latomic"meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +1
-2@@ -204,12 +201,10 @@ do_install:append:class-native () { OPENSSL_CONF=\${OPENSSL_CONF:-${libdir}/ssl-3/openssl.cnf} \ SSL_CERT_DIR=\${SSL_CERT_DIR:-${libdir}/ssl-3/certs} \ SSL_CERT_FILE=\${SSL_CERT_FILE:-${libdir}/ssl-3/cert.pem} \ - OPENSSL_ENGINES=\${OPENSSL_ENGINES:-${libdir}/engines-3} \ OPENSSL_MODULES=\${OPENSSL_MODULES:-${libdir}/ossl-modules} - # Setting ENGINESDIR and MODULESDIR to invalid paths prevents host contamination, + # Setting MODULESDIR to invalid paths prevents host contamination, # but also breaks the generated libcrypto.pc file. Post-Fix itmanually here.
- sed -i 's|^enginesdir=\($.libdir.\)/.*|enginesdir=\1/engines-3|'
${D}${libdir}/pkgconfig/libcrypto.pc
sed -i
's|^modulesdir=\($.libdir.\)/.*|modulesdir=\1/ossl-modules|' ${D}${libdir}/pkgconfig/libcrypto.pc
}meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-0@@ -252,10 +247,6 @@ do_install_ptest() { sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm
${D}${PTEST_PATH}/util/wrap.plmeta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-4- install -d ${D}${PTEST_PATH}/engines - install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines/ - install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines/ - ln -s ${libdir}/engines-3/loader_attic.so${D}${PTEST_PATH}/engines/
ln -s ${libdir}/ossl-modules/ ${D}${PTEST_PATH}/providers}
meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-1@@ -270,17 +261,14 @@ pkg_postinst_ontarget:${PN}-ossl-module-fips () { # file to be installed for both the openssl-bin package and the libcrypto # package since the openssl-bin package depends on the libcrypto package. -PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc${PN}-ossl-module-legacy ${PN}-ossl-module-fips" +PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-misc ${PN}-ossl-module-legacy ${PN}-ossl-module-fips"
FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}"
FILES:libssl = "${libdir}/libssl${SOLIBS}"FILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf* \ ${libdir}/ssl-3/openssl.cnf* \ "meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +0
-2-FILES:${PN}-engines = "${libdir}/engines-3" -# ${prefix} comes from what we pass into --prefix at configure time(which is used for INSTALLTOP) -FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3"
meta/recipes-connectivity/openssl/openssl_4.0.1.bb renamed from meta/recipes-connectivity/openssl/openssl_3.5.7.bb +1
-1-FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash" +FILES:${PN}-misc = "${libdir}/ssl-3/misc" FILES:${PN}-ossl-module-legacy = "${libdir}/ossl-modules/legacy.so" FILES:${PN}-ossl-module-fips = "${libdir}/ossl-modules/fips.so" FILES:${PN} =+ "${libdir}/ssl-3/* ${libdir}/ossl-modules/"@@ -290,7 +278,7 @@ CONFFILES:openssl-conf ="${sysconfdir}/ssl/openssl.cnf"
RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy" RDEPENDS:${PN}-misc = "perl"
-RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed openssl-engines"
+RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed"
RRECOMMENDS:${PN}-ptest += "${PN}-ossl-module-legacy"RDEPENDS:${PN}-bin += "openssl-conf"
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#243993):
https://lists.openembedded.org/g/openembedded-core/message/243993
Mute This Topic: https://lists.openembedded.org/mt/120878892/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [RFC v4 1/6] openssl: upgrade 3.5.7 -> 4.0.1
Quoted 1 line · Khem Raj
https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/8474313/raw_inline
Tested bitbake world -k with OpenSSL 4.0.1 upgrade across meta-oe, meta-networking, meta-python, meta-perl, meta-multimedia, meta-xfce, meta-initramfs, meta-filesystems.
22 recipes fixed — patches provided, all with upstream references.
13 recipes still broken:
ENGINE API removed (needs Provider API rewrite):
- imx-cst — NXP proprietary, no public upstream
- extract-cert — needs Provider API migration
Dead/unmaintained upstream:
- wvstreams/wvdial — archived 2018, dial-up modem dialer
- ntp (classic) — EOL 2023, recommend chrony
- loudmouth — last activity 2019
No upstream fix available:
- ldns — heavy deprecated API usage (issue #243 open since 2024)
- unbound — upstream PR #1437 attempted, closed
- softhsm — upstream PR #882 in progress
- ipmiutil — no upstream fix found
- synergy — TLS methods removed, repo archived
- spdm-emu — depends on libspdm abstraction
- mercurial — Python 3.14 + OpenSSL 4.0 reports TLS 1.2 as unavailable (upstream CPython limitation, only Python 3.15 officially supports OpenSSL 4.0)
https://bugzilla.redhat.com/show_bug.cgi?id=2494735
https://github.com/python/cpython/issues/152709
3 upstream PRs submitted by us: ntopng (merged), thrift, snort3
Re: [OE-core] [RFC v4 1/6] openssl: upgrade 3.5.7 -> 4.0.1
Thanks Jaipaul, For dead packages I would rather like a recipe removal patches.
Quoted 44 lines · Jaipaul Cheernam
Quoted 1 line · Khem Raj
https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/8474313/raw_inline
Tested bitbake world -k with OpenSSL 4.0.1 upgrade across
meta-oe, meta-networking, meta-python, meta-perl, meta-multimedia, meta-xfce, meta-initramfs, meta-filesystems.22 recipes fixed — patches provided, all with upstream references.
13 recipes still broken:
ENGINE API removed (needs Provider API rewrite):
- imx-cst — NXP proprietary, no public upstream
- extract-cert — needs Provider API migrationDead/unmaintained upstream:
- wvstreams/wvdial — archived 2018, dial-up modem dialer
- ntp (classic) — EOL 2023, recommend chrony
- loudmouth — last activity 2019No upstream fix available:
- ldns — heavy deprecated API usage (issue #243 open since 2024)
- unbound — upstream PR #1437 attempted, closed
- softhsm — upstream PR #882 in progress
- ipmiutil — no upstream fix found
- synergy — TLS methods removed, repo archived
- spdm-emu — depends on libspdm abstraction- mercurial — Python 3.14 + OpenSSL 4.0 reports TLS 1.2 as
unavailable (upstream CPython limitation, only Python 3.15 officially supports OpenSSL 4.0)https://bugzilla.redhat.com/show_bug.cgi?id=2494735
https://github.com/python/cpython/issues/152709
3 upstream PRs submitted by us: ntopng (merged), thrift, snort3
RFC v4 2/6 python3: backport OpenSSL 4.0 support from upstream
In reply to Jaipaul CheernamBackport CPython commit 3364e7e62fa24d0e19133fb0f90b1c24ef1110c5:
gh-146207: Add support for OpenSSL 4.0.0 alpha1 (#146217)
OpenSSL 4.0.0 alpha1 removed these functions:
* SSLv3_method()
* TLSv1_method()
* TLSv1_1_method()
* TLSv1_2_method()
Other changes:
* Update test_openssl_version().
* Update multissltests.py for OpenSSL 4.
* Add const qualifier to fix compiler warnings.
Upstream-Status: Backport [https://github.com/python/cpython/commit/3364e7e62fa24d0e19133fb0f90b1c24ef1110c5]
--- ...146207-Add-support-for-OpenSSL-4.0.0.patch | 257 ++++++++++++++++++ ...Update-_ssl._SSLSocket-for-OpenSSL-4.patch | 234 ++++++++++++++++ ...utdown-test-in-test_ssl.test_got_eof.patch | 41 +++ .../recipes-devtools/python/python3_3.14.7.bb | 3 + 4 files changed, 535 insertions(+) create mode 100644 meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch create mode 100644 meta/recipes-devtools/python/python3/0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch create mode 100644 meta/recipes-devtools/python/python3/0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch
meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch new file +257 -0
@@ -0,0 +1,257 @@ +From 3364e7e62fa24d0e19133fb0f90b1c24ef1110c5 Mon Sep 17 00:00:00 2001 +From: Victor Stinner <[email protected]> +Date: Wed, 25 Mar 2026 07:44:47 +0100 +Subject: [PATCH] gh-146207: Add support for OpenSSL 4.0.0 alpha1 (#146217) + +OpenSSL 4.0.0 alpha1 removed these functions: + +* SSLv3_method() +* TLSv1_method() +* TLSv1_1_method() +* TLSv1_2_method() + +Other changes: + +* Update test_openssl_version(). +* Update multissltests.py for OpenSSL 4. +* Add const qualifier to fix compiler warnings. + +Co-authored-by: Bénédikt Tran <[email protected]> +Signed-off-by: Victor Stinner <[email protected]> + +Upstream-Status: Backport [https://github.com/python/cpython/commit/3364e7e62fa24d0e19133fb0f90b1c24ef1110c5] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + Lib/test/test_ssl.py | 52 ++++++++++++++++++++------------------ + Modules/_ssl.c | 27 ++++++++++++++++---- + Modules/_ssl/cert.c | 3 ++- + Tools/ssl/multissltests.py | 7 ++++- + 4 files changed, 58 insertions(+), 31 deletions(-) + +diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py +index dc795c6bd8a..61355927296 100644 +--- a/Lib/test/test_ssl.py ++++ b/Lib/test/test_ssl.py +@@ -395,7 +395,7 @@ def test_constants(self): + ssl.OP_NO_COMPRESSION + self.assertEqual(ssl.HAS_SNI, True) + self.assertEqual(ssl.HAS_ECDH, True) +- self.assertEqual(ssl.HAS_TLSv1_2, True) ++ self.assertIsInstance(ssl.HAS_TLSv1_2, bool) + self.assertEqual(ssl.HAS_TLSv1_3, True) + ssl.OP_NO_SSLv2 + ssl.OP_NO_SSLv3 +@@ -586,11 +586,11 @@ def test_openssl_version(self): + # Some sanity checks follow + # >= 1.1.1 + self.assertGreaterEqual(n, 0x10101000) +- # < 4.0 +- self.assertLess(n, 0x40000000) ++ # < 5.0 ++ self.assertLess(n, 0x50000000) + major, minor, fix, patch, status = t + self.assertGreaterEqual(major, 1) +- self.assertLess(major, 4) ++ self.assertLess(major, 5) + self.assertGreaterEqual(minor, 0) + self.assertLess(minor, 256) + self.assertGreaterEqual(fix, 0) +@@ -656,12 +656,14 @@ def test_openssl111_deprecations(self): + ssl.OP_NO_TLSv1_2, + ssl.OP_NO_TLSv1_3 + ] +- protocols = [ +- ssl.PROTOCOL_TLSv1, +- ssl.PROTOCOL_TLSv1_1, +- ssl.PROTOCOL_TLSv1_2, +- ssl.PROTOCOL_TLS +- ] ++ protocols = [] ++ if hasattr(ssl, 'PROTOCOL_TLSv1'): ++ protocols.append(ssl.PROTOCOL_TLSv1) ++ if hasattr(ssl, 'PROTOCOL_TLSv1_1'): ++ protocols.append(ssl.PROTOCOL_TLSv1_1) ++ if hasattr(ssl, 'PROTOCOL_TLSv1_2'): ++ protocols.append(ssl.PROTOCOL_TLSv1_2) ++ protocols.append(ssl.PROTOCOL_TLS) + versions = [ + ssl.TLSVersion.SSLv3, + ssl.TLSVersion.TLSv1, +@@ -1205,6 +1207,7 @@ def test_min_max_version(self): + ssl.TLSVersion.TLSv1, + ssl.TLSVersion.TLSv1_1, + ssl.TLSVersion.TLSv1_2, ++ ssl.TLSVersion.TLSv1_3, + ssl.TLSVersion.SSLv3, + } + ) +@@ -1218,7 +1221,7 @@ def test_min_max_version(self): + with self.assertRaises(ValueError): + ctx.minimum_version = 42 + +- if has_tls_protocol(ssl.PROTOCOL_TLSv1_1): ++ if has_tls_protocol('PROTOCOL_TLSv1_1'): + ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_1) + + self.assertIn( +@@ -1675,23 +1678,24 @@ def test__create_stdlib_context(self): + self.assertFalse(ctx.check_hostname) + self._assert_context_options(ctx) + +- if has_tls_protocol(ssl.PROTOCOL_TLSv1): ++ if has_tls_protocol('PROTOCOL_TLSv1'): + with warnings_helper.check_warnings(): + ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1) + self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1) + self.assertEqual(ctx.verify_mode, ssl.CERT_NONE) + self._assert_context_options(ctx) + +- with warnings_helper.check_warnings(): +- ctx = ssl._create_stdlib_context( +- ssl.PROTOCOL_TLSv1_2, +- cert_reqs=ssl.CERT_REQUIRED, +- check_hostname=True +- ) +- self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1_2) +- self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED) +- self.assertTrue(ctx.check_hostname) +- self._assert_context_options(ctx) ++ if has_tls_protocol('PROTOCOL_TLSv1_2'): ++ with warnings_helper.check_warnings(): ++ ctx = ssl._create_stdlib_context( ++ ssl.PROTOCOL_TLSv1_2, ++ cert_reqs=ssl.CERT_REQUIRED, ++ check_hostname=True ++ ) ++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1_2) ++ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED) ++ self.assertTrue(ctx.check_hostname) ++ self._assert_context_options(ctx) + + ctx = ssl._create_stdlib_context(purpose=ssl.Purpose.CLIENT_AUTH) + self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLS_SERVER) +@@ -3654,10 +3658,10 @@ def test_protocol_tlsv1_2(self): + client_options=ssl.OP_NO_TLSv1_2) + + try_protocol_combo(ssl.PROTOCOL_TLS, ssl.PROTOCOL_TLSv1_2, 'TLSv1.2') +- if has_tls_protocol(ssl.PROTOCOL_TLSv1): ++ if has_tls_protocol('PROTOCOL_TLSv1'): + try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1, False) + try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1_2, False) +- if has_tls_protocol(ssl.PROTOCOL_TLSv1_1): ++ if has_tls_protocol('PROTOCOL_TLSv1_1'): + try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1_1, False) + try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1_2, False) + +diff --git a/Modules/_ssl.c b/Modules/_ssl.c +index b45295b4c0c..6f75af86113 100644 +--- a/Modules/_ssl.c ++++ b/Modules/_ssl.c +@@ -164,6 +164,17 @@ static void _PySSLFixErrno(void) { + #error Unsupported OpenSSL version + #endif + ++#if (OPENSSL_VERSION_NUMBER >= 0x40000000L) ++# define OPENSSL_NO_SSL3 ++# define OPENSSL_NO_TLS1 ++# define OPENSSL_NO_TLS1_1 ++# define OPENSSL_NO_TLS1_2 ++# define OPENSSL_NO_SSL3_METHOD ++# define OPENSSL_NO_TLS1_METHOD ++# define OPENSSL_NO_TLS1_1_METHOD ++# define OPENSSL_NO_TLS1_2_METHOD ++#endif ++ + /* OpenSSL API 1.1.0+ does not include version methods */ + #ifndef OPENSSL_NO_SSL3_METHOD + extern const SSL_METHOD *SSLv3_method(void); +@@ -1151,7 +1162,7 @@ _asn1obj2py(_sslmodulestate *state, const ASN1_OBJECT *name, int no_name) + + static PyObject * + _create_tuple_for_attribute(_sslmodulestate *state, +- ASN1_OBJECT *name, ASN1_STRING *value) ++ const ASN1_OBJECT *name, const ASN1_STRING *value) + { + Py_ssize_t buflen; + PyObject *pyattr; +@@ -1180,16 +1191,16 @@ _create_tuple_for_attribute(_sslmodulestate *state, + } + + static PyObject * +-_create_tuple_for_X509_NAME (_sslmodulestate *state, X509_NAME *xname) ++_create_tuple_for_X509_NAME(_sslmodulestate *state, const X509_NAME *xname) + { + PyObject *dn = NULL; /* tuple which represents the "distinguished name" */ + PyObject *rdn = NULL; /* tuple to hold a "relative distinguished name" */ + PyObject *rdnt; + PyObject *attr = NULL; /* tuple to hold an attribute */ + int entry_count = X509_NAME_entry_count(xname); +- X509_NAME_ENTRY *entry; +- ASN1_OBJECT *name; +- ASN1_STRING *value; ++ const X509_NAME_ENTRY *entry; ++ const ASN1_OBJECT *name; ++ const ASN1_STRING *value; + int index_counter; + int rdn_level = -1; + int retcode; +@@ -6967,9 +6978,15 @@ sslmodule_init_constants(PyObject *m) + ADD_INT_CONST("PROTOCOL_TLS", PY_SSL_VERSION_TLS); + ADD_INT_CONST("PROTOCOL_TLS_CLIENT", PY_SSL_VERSION_TLS_CLIENT); + ADD_INT_CONST("PROTOCOL_TLS_SERVER", PY_SSL_VERSION_TLS_SERVER); ++#ifndef OPENSSL_NO_TLS1 + ADD_INT_CONST("PROTOCOL_TLSv1", PY_SSL_VERSION_TLS1); ++#endif ++#ifndef OPENSSL_NO_TLS1_1 + ADD_INT_CONST("PROTOCOL_TLSv1_1", PY_SSL_VERSION_TLS1_1); ++#endif ++#ifndef OPENSSL_NO_TLS1_2 + ADD_INT_CONST("PROTOCOL_TLSv1_2", PY_SSL_VERSION_TLS1_2); ++#endif + + #define ADD_OPTION(NAME, VALUE) if (sslmodule_add_option(m, NAME, (VALUE)) < 0) return -1 + +diff --git a/Modules/_ssl/cert.c b/Modules/_ssl/cert.c +index f2e7be89668..061b0fb3171 100644 +--- a/Modules/_ssl/cert.c ++++ b/Modules/_ssl/cert.c +@@ -128,7 +128,8 @@ _ssl_Certificate_get_info_impl(PySSLCertificate *self) + } + + static PyObject* +-_x509name_print(_sslmodulestate *state, X509_NAME *name, int indent, unsigned long flags) ++_x509name_print(_sslmodulestate *state, const X509_NAME *name, ++ int indent, unsigned long flags) + { + PyObject *res; + BIO *biobuf; +diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py +index 3b4507c6771..48207e5330f 100755 +--- a/Tools/ssl/multissltests.py ++++ b/Tools/ssl/multissltests.py +@@ -429,9 +429,11 @@ def _post_install(self): + def _post_install(self): + if self.version.startswith("3."): + self._post_install_3xx() ++ elif self.version.startswith("4."): ++ self._post_install_4xx() + + def _build_src(self, config_args=()): +- if self.version.startswith("3."): ++ if self.version.startswith(("3.", "4.")): + config_args += ("enable-fips",) + super()._build_src(config_args) + +@@ -447,6 +449,9 @@ def _post_install_3xx(self): + lib64 = self.lib_dir + "64" + os.symlink(lib64, self.lib_dir) + ++ def _post_install_4xx(self): ++ self._post_install_3xx() ++ + @property + def short_version(self): + """Short version for OpenSSL download URL""" +-- +2.25.1 +
meta/recipes-devtools/python/python3/0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch new file +234 -0
234 lines not on this page · raw message
meta/recipes-devtools/python/python3/0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch new file +41 -0
41 lines not on this page · raw message
meta/recipes-devtools/python/python3_3.14.7.bb +3 -0
@@ -22,6 +22,9 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-Avoid-shebang-overflow-on-python-config.py.patch \ file://0001-Update-test_sysconfig-for-posix_user-purelib.patch \ file://0001-prefer-valid-entrypoints.patch \ + file://0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch \ + file://0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch \ + file://0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch \ " SRC_URI:append:class-native = " \ file://0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch \
RFC v4 3/6 socat: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 made ASN1_STRING opaque. socat directly accesses pName->d.iPAddress->data and pName->d.iPAddress->length which is no longer allowed.
Use ASN1_STRING_get0_data() and ASN1_STRING_length() accessor functions instead. These have been available since OpenSSL 1.1.0 so this is backward compatible.
Upstream-Status: Submitted [[email protected]]
--- ...penSSL-4.0-use-ASN1_STRING-accessors.patch | 31 +++++++++++++++++++ .../socat/socat_1.8.1.3.bb | 1 + 2 files changed, 32 insertions(+) create mode 100644 meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
meta/recipes-connectivity/socat/files/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jaipaul Cheernam <[email protected]> +Date: Thu, 13 Aug 2026 07:00:00 +0000 +Subject: [PATCH] Fix build with OpenSSL 4.0: use ASN1_STRING accessors + +OpenSSL 4.0 made ASN1_STRING opaque. Direct access to struct members +(->data, ->length) is no longer possible. Use the accessor functions +ASN1_STRING_get0_data() and ASN1_STRING_length() instead. + +These accessors have been available since OpenSSL 1.1.0, so this change +is backward compatible. + +Upstream-Status: Submitted [[email protected]] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + xio-openssl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/xio-openssl.c ++++ b/xio-openssl.c +@@ -1898,8 +1898,8 @@ + case GEN_IPADD: + { + /* binary address format */ +- const unsigned char *data = pName->d.iPAddress->data; +- size_t len = pName->d.iPAddress->length; ++ const unsigned char *data = ASN1_STRING_get0_data(pName->d.iPAddress); ++ size_t len = ASN1_STRING_length(pName->d.iPAddress); + char aBuffer[INET6_ADDRSTRLEN]; /* canonical peername */ + struct in6_addr ip6bin; +
meta/recipes-connectivity/socat/socat_1.8.1.3.bb +1 -0
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \ file://0001-fix-compile-procan.c-failed.patch \ + file://0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch \ " SRC_URI[sha256sum] = "25bc6476292b2e614220989c77b0b6fca87bb2525d9747b31a6639b1fb602418"
RFC v4 4/6 serf: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 made ASN1_STRING opaque. serf directly accesses nm->d.ia5->data and nm->d.ia5->length which is no longer allowed.
Use ASN1_STRING_get0_data() and ASN1_STRING_length() accessor functions instead. These have been available since OpenSSL 1.1.0 so this is backward compatible.
The fix is already in serf trunk (r1935023) but no new release has been made.
Upstream-Status: Backport [https://svn.apache.org/repos/asf/serf/trunk r1935023]
--- ...penSSL-4.0-use-ASN1_STRING-accessors.patch | 35 +++++++++++++++++++ meta/recipes-support/serf/serf_1.3.10.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jaipaul Cheernam <[email protected]> +Date: Thu, 13 Aug 2026 11:52:00 +0000 +Subject: [PATCH] Fix build with OpenSSL 4.0: use ASN1_STRING accessors + +OpenSSL 4.0 made ASN1_STRING opaque. Direct access to struct members +(->data, ->length) is no longer possible. Use the accessor functions +ASN1_STRING_get0_data() and ASN1_STRING_length() instead. + +These accessors have been available since OpenSSL 1.1.0, so this change +is backward compatible. + +Upstream-Status: Backport [https://svn.apache.org/repos/asf/serf/trunk r1935023] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + buckets/ssl_buckets.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/buckets/ssl_buckets.c ++++ b/buckets/ssl_buckets.c +@@ -567,11 +567,11 @@ + switch (nm->type) { + case GEN_DNS: + if (copy_action == ErrorOnNul && +- strlen(nm->d.ia5->data) != nm->d.ia5->length) ++ strlen((const char *)ASN1_STRING_get0_data(nm->d.ia5)) != (size_t)ASN1_STRING_length(nm->d.ia5)) + return SERF_ERROR_SSL_CERT_FAILED; + if (san_arr && *san_arr) +- p = pstrdup_escape_nul_bytes((const char *)nm->d.ia5->data, +- nm->d.ia5->length, ++ p = pstrdup_escape_nul_bytes((const char *)ASN1_STRING_get0_data(nm->d.ia5), ++ ASN1_STRING_length(nm->d.ia5), + pool); + break; + default:
meta/recipes-support/serf/serf_1.3.10.bb +1 -0
@@ -10,6 +10,7 @@ SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ file://0002-SConstruct-Fix-path-quoting-for-.def-generator.patch \ file://0003-gen_def.patch \ file://SConstruct.stop.creating.directories.without.sandbox-install.prefix.patch \ + file://0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch \ " SRC_URI[sha256sum] = "be81ef08baa2516ecda76a77adf7def7bc3227eeb578b9a33b45f7b41dc064e6"
RFC v4 5/6 u-boot: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 removed the ENGINE API entirely. u-boot uses ENGINE_get_id, ENGINE_load_public_key, ENGINE_finish, ENGINE_free in lib/rsa/rsa-sign.c which causes link failures on all platforms that build u-boot (including riscv64).
Backport the Provider API support patch from upstream u-boot which adds OpenSSL Provider support while maintaining backward compatibility with older OpenSSL versions that still have ENGINE.
Add the patch to u-boot-common.inc so it applies to both u-boot and u-boot-tools recipes.
Upstream-Status: Submitted [https://lore.kernel.org/u-boot/[email protected]/]
--- ...Add-support-for-OpenSSL-Provider-API.patch | 340 ++++++++++++++++++ meta/recipes-bsp/u-boot/u-boot-common.inc | 1 + 2 files changed, 341 insertions(+) create mode 100644 meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch
meta/recipes-bsp/u-boot/files/0001-Add-support-for-OpenSSL-Provider-API.patch new file +340 -0
@@ -0,0 +1,340 @@ +From a81cb0932dce109af44d7245d47489fe54ae390f Mon Sep 17 00:00:00 2001 +From: Eddie Kovsky <[email protected]> +Date: Mon, 23 Feb 2026 09:43:22 -0700 +Subject: [PATCH] Add support for OpenSSL Provider API + +The Engine API has been deprecated since the release of OpenSSL 3.0. End +users have been advised to migrate to the new Provider interface. +Several distributions have already removed support for engines, which is +preventing U-Boot from being compiled in those environments. + +Add support for the Provider API while continuing to support the existing +Engine API on distros shipping older releases of OpenSSL. + +This is based on similar work contributed by Jan Stancek updating Linux +to use the Provider interface. + + commit 558bdc45dfb2669e1741384a0c80be9c82fa052c + Author: Jan Stancek <[email protected]> + Date: Fri Sep 20 19:52:48 2024 +0300 + + sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 + +The changes have been tested with the FIT signature verification vboot +tests on Fedora 42 and Debian 13. All 30 tests pass with both the legacy +Engine library installed and with the Provider API. + +Signed-off-by: Eddie Kovsky <[email protected]> + +Upstream-Status: Submitted [https://lore.kernel.org/u-boot/[email protected]/] + +Note: Modified to make pkcs11 provider loading optional. The upstream +patch unconditionally requires the pkcs11 provider, which is not +available in the OE build environment. File-based key signing only needs +the default provider; pkcs11 is only required for pkcs11: URI keys. +Changes from upstream: + - Load default provider first (was pkcs11 first) + - Make pkcs11 provider load failure non-fatal (ERR_clear_error instead + of ERR(1, ...) which calls errx/abort) + +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + doc/build/gcc.rst | 4 +- + lib/aes/aes-encrypt.c | 4 +- + lib/rsa/rsa-sign.c | 102 +++++++++++++++++++++++++++++++++++++++--- + tools/docker/Dockerfile | 1 + + 4 files changed, 103 insertions(+), 8 deletions(-) + +diff --git a/doc/build/gcc.rst b/doc/build/gcc.rst +index 1fef718ceecb..29a6a632e7e3 100644 +--- a/doc/build/gcc.rst ++++ b/doc/build/gcc.rst +@@ -25,8 +25,8 @@ Depending on the build targets further packages maybe needed + + sudo apt-get install bc bison build-essential coccinelle \ + device-tree-compiler dfu-util efitools flex gdisk graphviz imagemagick \ +- libgnutls28-dev libguestfs-tools libncurses-dev \ +- libpython3-dev libsdl2-dev libssl-dev lz4 lzma lzma-alone openssl \ ++ libgnutls28-dev libguestfs-tools libncurses-dev libpython3-dev \ ++ libsdl2-dev libssl-dev lz4 lzma lzma-alone openssl pkcs11-provider \ + pkg-config python3 python3-asteval python3-coverage python3-filelock \ + python3-pkg-resources python3-pycryptodome python3-pyelftools \ + python3-pytest python3-pytest-xdist python3-sphinxcontrib.apidoc \ +diff --git a/lib/aes/aes-encrypt.c b/lib/aes/aes-encrypt.c +index 90e1407b4f09..4fc4ce232478 100644 +--- a/lib/aes/aes-encrypt.c ++++ b/lib/aes/aes-encrypt.c +@@ -16,7 +16,9 @@ + #include <openssl/err.h> + #include <openssl/ssl.h> + #include <openssl/evp.h> +-#include <openssl/engine.h> ++#if !defined(OPENSSL_NO_ENGINE) && !defined(OPENSSL_NO_DEPRECATED_3_0) ++# include <openssl/engine.h> ++#endif + #include <uboot_aes.h> + + #if OPENSSL_VERSION_NUMBER >= 0x10000000L +diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c +index 0e38c9e802fd..f456f3c58e65 100644 +--- a/lib/rsa/rsa-sign.c ++++ b/lib/rsa/rsa-sign.c +@@ -19,7 +19,47 @@ + #include <openssl/err.h> + #include <openssl/ssl.h> + #include <openssl/evp.h> +-#include <openssl/engine.h> ++#if OPENSSL_VERSION_MAJOR >= 3 ++# define USE_PKCS11_PROVIDER ++# include <err.h> ++# include <openssl/provider.h> ++# include <openssl/store.h> ++#else ++# if !defined(OPENSSL_NO_ENGINE) && !defined(OPENSSL_NO_DEPRECATED_3_0) ++# define USE_PKCS11_ENGINE ++# include <openssl/engine.h> ++# endif ++#endif ++ ++#ifdef USE_PKCS11_PROVIDER ++#define ERR(cond, fmt, ...) \ ++ do { \ ++ bool __cond = (cond); \ ++ drain_openssl_errors(__LINE__, 0); \ ++ if (__cond) { \ ++ errx(1, fmt, ## __VA_ARGS__); \ ++ } \ ++ } while (0) ++ ++static void drain_openssl_errors(int l, int silent) ++{ ++ const char *file; ++ char buf[120]; ++ int e, line; ++ ++ if (ERR_peek_error() == 0) ++ return; ++ if (!silent) ++ fprintf(stderr, "At main.c:%d:\n", l); ++ ++ while ((e = ERR_peek_error_line(&file, &line))) { ++ ERR_error_string(e, buf); ++ if (!silent) ++ fprintf(stderr, "- SSL %s: %s:%d\n", buf, file, line); ++ ERR_get_error(); ++ } ++} ++#endif + + static int rsa_err(const char *msg) + { +@@ -94,10 +134,11 @@ static int rsa_pem_get_pub_key(const char *keydir, const char *name, EVP_PKEY ** + * + * @keydir: Key prefix + * @name Name of key +- * @engine Engine to use ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_get_pub_key(const char *keydir, const char *name, + ENGINE *engine, EVP_PKEY **evpp) + { +@@ -157,21 +198,24 @@ static int rsa_engine_get_pub_key(const char *keydir, const char *name, + + return 0; + } ++#endif + + /** + * rsa_get_pub_key() - read a public key + * + * @keydir: Directory containing the key (PEM file) or key prefix (engine) + * @name Name of key file (will have a .crt extension) +- * @engine Engine to use ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ + static int rsa_get_pub_key(const char *keydir, const char *name, + ENGINE *engine, EVP_PKEY **evpp) + { ++#ifdef USE_PKCS11_ENGINE + if (engine) + return rsa_engine_get_pub_key(keydir, name, engine, evpp); ++#endif + return rsa_pem_get_pub_key(keydir, name, evpp); + } + +@@ -207,13 +251,45 @@ static int rsa_pem_get_priv_key(const char *keydir, const char *name, + return -ENOENT; + } + ++#ifdef USE_PKCS11_PROVIDER ++ EVP_PKEY *private_key = NULL; ++ OSSL_STORE_CTX *store; ++ ++ if (!OSSL_PROVIDER_try_load(NULL, "default", true)) ++ ERR(1, "OSSL_PROVIDER_try_load(default)"); ++ /* pkcs11 provider is optional; only needed for pkcs11: URIs */ ++ if (!OSSL_PROVIDER_try_load(NULL, "pkcs11", true)) ++ ERR_clear_error(); ++ ++ store = OSSL_STORE_open(path, NULL, NULL, NULL, NULL); ++ ERR(!store, "OSSL_STORE_open"); ++ ++ while (!OSSL_STORE_eof(store)) { ++ OSSL_STORE_INFO *info = OSSL_STORE_load(store); ++ ++ if (!info) { ++ drain_openssl_errors(__LINE__, 0); ++ continue; ++ } ++ if (OSSL_STORE_INFO_get_type(info) == OSSL_STORE_INFO_PKEY) { ++ private_key = OSSL_STORE_INFO_get1_PKEY(info); ++ ERR(!private_key, "OSSL_STORE_INFO_get1_PKEY"); ++ } ++ OSSL_STORE_INFO_free(info); ++ if (private_key) ++ break; ++ } ++ OSSL_STORE_close(store); ++ ++ *evpp = private_key; ++#else + if (!PEM_read_PrivateKey(f, evpp, NULL, path)) { + rsa_err("Failure reading private key"); + fclose(f); + return -EPROTO; + } + fclose(f); +- ++#endif + return 0; + } + +@@ -226,6 +301,7 @@ static int rsa_pem_get_priv_key(const char *keydir, const char *name, + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_get_priv_key(const char *keydir, const char *name, + const char *keyfile, + ENGINE *engine, EVP_PKEY **evpp) +@@ -293,22 +369,25 @@ static int rsa_engine_get_priv_key(const char *keydir, const char *name, + + return 0; + } ++#endif + + /** + * rsa_get_priv_key() - read a private key + * + * @keydir: Directory containing the key (PEM file) or key prefix (engine) + * @name Name of key +- * @engine Engine to use for signing ++ * @engine Engine to use or NULL when using pkcs11 provider + * @evpp Returns EVP_PKEY object, or NULL on failure + * Return: 0 if ok, -ve on error (in which case *evpp will be set to NULL) + */ + static int rsa_get_priv_key(const char *keydir, const char *name, + const char *keyfile, ENGINE *engine, EVP_PKEY **evpp) + { ++#ifdef USE_PKCS11_ENGINE + if (engine) + return rsa_engine_get_priv_key(keydir, name, keyfile, engine, + evpp); ++#endif + return rsa_pem_get_priv_key(keydir, name, keyfile, evpp); + } + +@@ -325,6 +404,7 @@ static int rsa_init(void) + return 0; + } + ++#ifdef USE_PKCS11_ENGINE + static int rsa_engine_init(const char *engine_id, ENGINE **pe) + { + const char *key_pass; +@@ -380,6 +460,7 @@ static void rsa_engine_remove(ENGINE *e) + ENGINE_free(e); + } + } ++#endif + + static int rsa_sign_with_key(EVP_PKEY *pkey, struct padding_algo *padding_algo, + struct checksum_algo *checksum_algo, +@@ -480,11 +561,13 @@ int rsa_sign(struct image_sign_info *info, + if (ret) + return ret; + ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) { + ret = rsa_engine_init(info->engine_id, &e); + if (ret) + return ret; + } ++#endif + + ret = rsa_get_priv_key(info->keydir, info->keyname, info->keyfile, + e, &pkey); +@@ -496,16 +579,21 @@ int rsa_sign(struct image_sign_info *info, + goto err_sign; + + EVP_PKEY_free(pkey); ++ ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + + return ret; + + err_sign: + EVP_PKEY_free(pkey); + err_priv: ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + return ret; + } + +@@ -645,11 +733,13 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest) + ENGINE *e = NULL; + + debug("%s: Getting verification data\n", __func__); ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) { + ret = rsa_engine_init(info->engine_id, &e); + if (ret) + return ret; + } ++#endif + ret = rsa_get_pub_key(info->keydir, info->keyname, e, &pkey); + if (ret) + goto err_get_pub_key; +@@ -726,8 +816,10 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest) + err_get_params: + EVP_PKEY_free(pkey); + err_get_pub_key: ++#ifdef USE_PKCS11_ENGINE + if (info->engine_id) + rsa_engine_remove(e); ++#endif + + if (ret) + return ret; +diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile +index 73bf6cdd2c52..50e98e83dc20 100644 +--- a/tools/docker/Dockerfile ++++ b/tools/docker/Dockerfile +@@ -122,6 +122,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + openssl \ + picocom \ + parted \ ++ pkcs11-provider \ + pkg-config \ + python-is-python3 \ + python3 \
meta/recipes-bsp/u-boot/u-boot-common.inc +1 -0
@@ -16,6 +16,7 @@ SRCREV = "ece349ade2973e220f524ce59e59711cc919263f" SRC_URI = "git://git.u-boot-project.org/u-boot/u-boot.git;protocol=https;branch=main;tag=v${PV} \ file://0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch \ + file://0001-Add-support-for-OpenSSL-Provider-API.patch \ " B = "${WORKDIR}/build"
RFC v4 6/6 kea: fix build with OpenSSL 4.0
In reply to Jaipaul CheernamOpenSSL 4.0 adds const qualifiers to the return type of X509_get_issuer_name() and X509_get_subject_name(). This causes compilation failures in Kea's TLS code which assigns these to non-const pointers.
Add patch to use const-qualified pointers matching the new OpenSSL 4.0 API.
Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/issues/4673]
--- ...-qualifiers-to-OpenSSL-X509-pointers.patch | 49 +++++++++++++++++++ meta/recipes-connectivity/kea/kea_3.2.0.bb | 1 + 2 files changed, 50 insertions(+) create mode 100644 meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch
meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch new file +49 -0
@@ -0,0 +1,49 @@ +From 82d28b1be73bbc00e73e59d0c59c51a1e76519a5 Mon Sep 17 00:00:00 2001 +From: Simo Sorce <[email protected]> +Date: Mon, 27 Apr 2026 17:49:56 -0400 +Subject: [PATCH] Add const qualifiers to OpenSSL X509 pointers + +Added const qualifiers to the X509_NAME and X509_NAME_ENTRY pointers when +retrieving subject and issuer names from TLS certificates. This ensures const- +correctness and maintains compatibility with newer OpenSSL versions, which +return const pointers from these getter functions. + +Signed-off-by: Simo Sorce <[email protected]> + +Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/issues/4673] +Signed-off-by: Jaipaul Cheernam <[email protected]> +--- + src/lib/asiolink/openssl_tls.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/lib/asiolink/openssl_tls.h b/src/lib/asiolink/openssl_tls.h +index 57c3323..52a969b 100644 +--- a/src/lib/asiolink/openssl_tls.h ++++ b/src/lib/asiolink/openssl_tls.h +@@ -175,9 +175,9 @@ public: + if (!cert) { + return (""); + } +- ::X509_NAME *name = ::X509_get_subject_name(cert); ++ const ::X509_NAME *name = ::X509_get_subject_name(cert); + int loc = ::X509_NAME_get_index_by_NID(name, NID_commonName, -1); +- ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); ++ const ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); + if (!ne) { + ::X509_free(cert); + return (""); +@@ -209,9 +209,9 @@ public: + if (!cert) { + return (""); + } +- ::X509_NAME *name = ::X509_get_issuer_name(cert); ++ const ::X509_NAME *name = ::X509_get_issuer_name(cert); + int loc = ::X509_NAME_get_index_by_NID(name, NID_commonName, -1); +- ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); ++ const ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc); + if (!ne) { + ::X509_free(cert); + return (""); +-- +2.53.0 +
meta/recipes-connectivity/kea/kea_3.2.0.bb +1 -0
@@ -19,6 +19,7 @@ SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.xz \ file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \ file://0001-meson-use-a-runtime-safe-interpreter-string.patch \ file://0001-mk_cfgrpt.sh-strip-prefixes.patch \ + file://0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch \ " SRC_URI[sha256sum] = "14bf695d37b65b9b1bf550fea5d0adaf9806c50e5419ef2a176a4b8e9aade3df"
Re: [OE-core] [RFC v4 0/6] openssl: upgrade 3.5.7 -> 4.0.1
In reply to Jaipaul CheernamQuoted 26 lines · Jaipaul Cheernam via lists.openembedded.org
Upgrade OpenSSL from 3.5.7 to 4.0.1 and fix all dependent recipe breakages in oe-core.
OpenSSL 4.0 is a major version bump that removes the ENGINE API, removes the
c_rehashscript, makesASN1_STRINGfully opaque, adds const qualifiers to X509 accessor return types, and removes per-version TLS method functions.This series fixes python3, socat, serf, u-boot, and kea to build against OpenSSL 4.0.
Changes since v3:
- u-boot: fix malformed patch (hunk line count mismatch from pkcs11 modification). Regenerated patch properly.Changes since v2:
- openssl: removec_rehashfromMULTILIB_SCRIPTSand FILES (fixes multilibdo_packagefailure)
- python3: add backports from CPython PR #149783 for thegot_eof_errorfix (fixes test_https/test_https_sni ptest failures caused by OpenSSL 4.0 changing EOF signaling behavior)
- u-boot: update Upstream-Status to lore link per reviewer feedback, include doc/Dockerfile hunks from upstream v4, make pkcs11 provider loading optional (fixes fitimage signing failure when pkcs11-provider is not installed)
Quoted 4 lines
Changes since v1:
- u-boot: move patch from u-boot-tools to u-boot-common.inc (fixes riscv64 build failure)
- serf/socat: fix Upstream-Status tags
Thanks, definitely getting better!
There was one failure in core I spotted in barebox:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4689
I think that is openssl related but it is hard to be 100% sure.
Cheers,
Richard
Re: [OE-core] [RFC v4 0/6] openssl: upgrade 3.5.7 -> 4.0.1
Hi Richard,
Hi Jaipaul,
Quoted 32 lines · Richard Purdie via lists.openembedded.org
Quoted 26 lines · Jaipaul Cheernam via lists.openembedded.org
Upgrade OpenSSL from 3.5.7 to 4.0.1 and fix all dependent recipe breakages in oe-core.
OpenSSL 4.0 is a major version bump that removes the ENGINE API, removes the
c_rehashscript, makesASN1_STRINGfully opaque, adds const qualifiers to X509 accessor return types, and removes per-version TLS method functions.This series fixes python3, socat, serf, u-boot, and kea to build against OpenSSL 4.0.
Changes since v3:
- u-boot: fix malformed patch (hunk line count mismatch from pkcs11 modification). Regenerated patch properly.Changes since v2:
- openssl: removec_rehashfromMULTILIB_SCRIPTSand FILES (fixes multilibdo_packagefailure)
- python3: add backports from CPython PR #149783 for thegot_eof_errorfix (fixes test_https/test_https_sni ptest failures caused by OpenSSL 4.0 changing EOF signaling behavior)
- u-boot: update Upstream-Status to lore link per reviewer feedback, include doc/Dockerfile hunks from upstream v4, make pkcs11 provider loading optional (fixes fitimage signing failure when pkcs11-provider is not installed)Quoted 4 lines
Changes since v1:
- u-boot: move patch from u-boot-tools to u-boot-common.inc (fixes riscv64 build failure)
- serf/socat: fix Upstream-Status tags
Quoted 7 lines
Thanks, definitely getting better!
There was one failure in core I spotted in barebox:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4689
I think that is openssl related but it is hard to be 100% sure.
barebox v2026.08.0 was released today and it includes following fix, which should make barebox compile against OpenSSL v4.x:
https://github.com/barebox/barebox/commit/7152488b95484e8fc4a427471dab0aa4fa5e0aad
Thanks,
Ahmad
Quoted 15 lines
Cheers,
Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#244011): https://lists.openembedded.org/g/openembedded-core/message/244011
Mute This Topic: https://lists.openembedded.org/mt/120878891/4830399
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Re: [OE-core] [RFC v4 0/6] openssl: upgrade 3.5.7 -> 4.0.1
Quoted 6 lines · Ahmad Fatoum
Quoted 5 lines · Richard Purdie via lists.openembedded.org
On Sat, 2026-08-22 at 19:51 +0200, Jaipaul Cheernam via lists.openembedded.org wrote:
There was one failure in core I spotted in barebox:
Quoted 8 lines
Quoted 3 lines
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4689
I think that is openssl related but it is hard to be 100% sure.
barebox v2026.08.0 was released today and it includes following fix, which should make barebox compile against OpenSSL v4.x:
https://github.com/barebox/barebox/commit/7152488b95484e8fc4a427471dab0aa4fa5e0aad
Thanks, I'll queue/test an upgrade and see if we can get things merged...
Cheers,
Richard