Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/4] package/uboot-tools: do not require OpenSSL PKCS#11 provider
@ 2026-10-16 15:28 Fiona Klute via buildroot
  2026-10-16 15:28 ` [Buildroot] [PATCH 2/4] support/testing/tests/package/test_uboot_tools.py: fix typos Fiona Klute via buildroot
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fiona Klute via buildroot @ 2026-10-16 15:28 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, Thomas Petazzoni, Fiona Klute (othermo GmbH)

From: "Fiona Klute (othermo GmbH)" <fiona.klute@gmx.de>

Patch 0003-Add-support-for-OpenSSL-Provider-API.patch makes
package/uboot-tools build without the OpenSSL engine API, but it fails
at runtime if pkcs11-provider [1] is not available. That provider is
not packaged in Buildroot, and should not be required when not
actually using PKCS#11 keys.

The problem has been discussed on the U-Boot mailing list [2], and
part of the reason this patch has not been merged into U-Boot yet. It
causes tests.package.test_uboot_tools.TestHostUbootTools to fail with:

=== STDOUT/STDERR ===
At main.c:259:
- SSL error:12800067:DSO support routines::could not load the shared library: crypto/dso/dso_dlfcn.c:115
- SSL error:12800067:DSO support routines::could not load the shared library: crypto/dso/dso_lib.c:147
- SSL error:07880025:common libcrypto routines::reason(37): crypto/provider_core.c:1026
mkimage: OSSL_PROVIDER_try_load(pkcs11)

This commit adjust the patch as suggested in [2] to continue if the
PKCS#11 provider fails to load, making the test work. However,
actually using PKCS#11 keys will not work until pkcs11-provider [1] is
packaged.

[1] https://github.com/openssl-projects/pkcs11-provider
[2] https://lists.u-boot-project.org/pipermail/u-boot/2026-August/629348.html

Fixes: f87cf2d6239d676147dec1fef088d81ee873277a ("package/uboot-tools: Fix build with OpenSSL 4.0.0")

Signed-off-by: Fiona Klute (othermo GmbH) <fiona.klute@gmx.de>
---
The alternative is to revert f87cf2d6239d676147dec1fef088d81ee873277a
until a fixed version is available. In any case I think either revert or
a package for pkcs11-provider are needed before the 2026.11 release,
support for PKCS#11 is important outside testing.

 .../0003-Add-support-for-OpenSSL-Provider-API.patch         | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/package/uboot-tools/0003-Add-support-for-OpenSSL-Provider-API.patch b/package/uboot-tools/0003-Add-support-for-OpenSSL-Provider-API.patch
index 9a5071cae3..2403e3ebab 100644
--- a/package/uboot-tools/0003-Add-support-for-OpenSSL-Provider-API.patch
+++ b/package/uboot-tools/0003-Add-support-for-OpenSSL-Provider-API.patch
@@ -29,6 +29,8 @@ Signed-off-by: Eddie Kovsky <ewk@edkovsky.org>
 Upstream: https://github.com/u-boot/u-boot/pull/918
 
 Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+[Fiona: apply fix from https://lists.u-boot-project.org/pipermail/u-boot/2026-August/629348.html to make pkcs11 provider optional]
+Signed-off-by: Fiona Klute (othermo GmbH) <fiona.klute@gmx.de>
 ---
  lib/aes/aes-encrypt.c |   4 +-
  lib/rsa/rsa-sign.c    | 102 +++++++++++++++++++++++++++++++++++++++---
@@ -149,10 +151,10 @@ index 0e38c9e802f..f456f3c58e6 100644
 +	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)");
++	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");
-- 
2.55.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-18  9:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 15:28 [Buildroot] [PATCH 1/4] package/uboot-tools: do not require OpenSSL PKCS#11 provider Fiona Klute via buildroot
2026-10-16 15:28 ` [Buildroot] [PATCH 2/4] support/testing/tests/package/test_uboot_tools.py: fix typos Fiona Klute via buildroot
2026-10-16 15:28 ` [Buildroot] [PATCH 3/4] package/uboot-tools: fix target FIT signature support Fiona Klute via buildroot
2026-10-16 15:28 ` [Buildroot] [PATCH 4/4] support/testing/tests/package/test_uboot_tools.py: test FIT signature on target Fiona Klute via buildroot
2026-10-18  9:52 ` [Buildroot] [PATCH 1/4] package/uboot-tools: do not require OpenSSL PKCS#11 provider Julien Olivain via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox