[openwrt/openwrt] uboot-mvebu: backport LibreSSL patches for older version of LibreSSL

LEDE Commits lede-commits at lists.infradead.org
Mon Oct 3 15:13:39 PDT 2022


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/23d23038dd02b55ebfc21e9276f408a0f85ab047

commit 23d23038dd02b55ebfc21e9276f408a0f85ab047
Author: Josef Schlehofer <pepe.schlehofer at gmail.com>
AuthorDate: Wed Sep 14 15:23:45 2022 +0200

    uboot-mvebu: backport LibreSSL patches for older version of LibreSSL
    
    If you would like to compile the newest version of U-boot together with the stable
    OpenWrt version, which does not have LibreSSL >= 3.5, which was updated
    in the master branch by commit 5451b03b7ceb2315445c683fe174e28bbdd49c2f
    ("tools/libressl: bump to v3.5.3"), then you need these two patches to
    fix it. They are backported from U-boot repository.
    
    This should be backported to stable OpenWrt versions.
    
    Reported-by: Michal Vasilek <michal.vasilek at nic.cz>
    Signed-off-by: Josef Schlehofer <pepe.schlehofer at gmail.com>
    (cherry picked from commit 185541f50ff59c0a5e0663ad612f0f5eb31926cf)
---
 ...002-tools-mkimage-fix-build-with-LibreSSL.patch | 28 ++++++++++++++++++++++
 ...ls-mkimage-fix-build-with-recent-LibreSSL.patch | 27 +++++++++++++++++++++
 2 files changed, 55 insertions(+)

diff --git a/package/boot/uboot-mvebu/patches/0002-tools-mkimage-fix-build-with-LibreSSL.patch b/package/boot/uboot-mvebu/patches/0002-tools-mkimage-fix-build-with-LibreSSL.patch
new file mode 100644
index 0000000000..ebea2a41cd
--- /dev/null
+++ b/package/boot/uboot-mvebu/patches/0002-tools-mkimage-fix-build-with-LibreSSL.patch
@@ -0,0 +1,28 @@
+From aed6107ae96870cd190b23d6da34a7e616799ed3 Mon Sep 17 00:00:00 2001
+From: Michal Vasilek <michal.vasilek at nic.cz>
+Date: Fri, 22 Jul 2022 19:55:53 +0200
+Subject: [PATCH 1/2] tools: mkimage: fix build with LibreSSL
+
+RSA_get0_* functions are not available in LibreSSL
+
+Signed-off-by: Michal Vasilek <michal.vasilek at nic.cz>
+Reviewed-by: Simon Glass <sjg at chromium.org>
+---
+ tools/sunxi_toc0.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/tools/sunxi_toc0.c
++++ b/tools/sunxi_toc0.c
+@@ -34,6 +34,12 @@
+ #define pr_warn(fmt, args...)	fprintf(stderr, pr_fmt(fmt), "warning", ##args)
+ #define pr_info(fmt, args...)	fprintf(stderr, pr_fmt(fmt), "info", ##args)
+ 
++#if defined(LIBRESSL_VERSION_NUMBER)
++#define RSA_get0_n(key) (key)->n
++#define RSA_get0_e(key) (key)->e
++#define RSA_get0_d(key) (key)->d
++#endif
++
+ struct __packed toc0_key_item {
+ 	__le32  vendor_id;
+ 	__le32  key0_n_len;
diff --git a/package/boot/uboot-mvebu/patches/0003-tools-mkimage-fix-build-with-recent-LibreSSL.patch b/package/boot/uboot-mvebu/patches/0003-tools-mkimage-fix-build-with-recent-LibreSSL.patch
new file mode 100644
index 0000000000..2e955848e8
--- /dev/null
+++ b/package/boot/uboot-mvebu/patches/0003-tools-mkimage-fix-build-with-recent-LibreSSL.patch
@@ -0,0 +1,27 @@
+From 16b94d211b18ae0204c4f850fdf23573b19170ec Mon Sep 17 00:00:00 2001
+From: Mark Kettenis <kettenis at openbsd.org>
+Date: Mon, 29 Aug 2022 13:34:01 +0200
+Subject: [PATCH 2/2] tools: mkimage: fix build with recent LibreSSL
+
+LibreSSL 3.5.0 and later (also shipped as part of OpenBSD 7.1 and
+and later) have an opaque RSA object and do provide the
+RSA_get0_* functions that OpenSSL provides.
+
+Fixes: 2ecc354b8e46 ("tools: mkimage: fix build with LibreSSL")
+Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
+Reviewed-by: Jonathan Gray <jsg at jsg.id.au>
+---
+ tools/sunxi_toc0.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tools/sunxi_toc0.c
++++ b/tools/sunxi_toc0.c
+@@ -34,7 +34,7 @@
+ #define pr_warn(fmt, args...)	fprintf(stderr, pr_fmt(fmt), "warning", ##args)
+ #define pr_info(fmt, args...)	fprintf(stderr, pr_fmt(fmt), "info", ##args)
+ 
+-#if defined(LIBRESSL_VERSION_NUMBER)
++#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x3050000fL
+ #define RSA_get0_n(key) (key)->n
+ #define RSA_get0_e(key) (key)->e
+ #define RSA_get0_d(key) (key)->d




More information about the lede-commits mailing list