Skip to contentSkip to conversation

tools: mkimage: fix build with recent LibreSSL

PATCH Superseded Mark Kettenis 3 participants 3 messages Aug 27, 2022 – Aug 29, 2022 Arm/Allwinner sunXi SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: mkimage: fix build with recent LibreSSL

Recent versions of LibreSSL, such as those shipped as part of OpenBSD 7.1 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")
---
 tools/sunxi_toc0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/sunxi_toc0.c +1 -1
index 56200bd927..eb5626411c 100644
@@ -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 < 0x3050100fL
 #define RSA_get0_n(key) (key)->n
 #define RSA_get0_e(key) (key)->e
 #define RSA_get0_d(key) (key)->d
Signature · 1 line
2.37.2
#1 lore raw
Quoted 3 lines · Mark Kettenis

Recent versions of LibreSSL, such as those shipped as part of OpenBSD 7.1 and later have an opaque RSA object and do provide the RSA_get0_* functions that OpenSSL provides.

part of 3.5.0 / 0x3050000fL as well
https://lists.denx.de/pipermail/u-boot/2022-July/489768.html
https://marc.info/?l=libressl&m=164572407401570&w=2

Quoted 24 lines
Fixes 2ecc354b8e46 ("tools: mkimage: fix build with LibreSSL")
---
 tools/sunxi_toc0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/sunxi_toc0.c +1 -1
index 56200bd927..eb5626411c 100644
@@ -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 < 0x3050100fL
 #define RSA_get0_n(key) (key)->n
 #define RSA_get0_e(key) (key)->e
 #define RSA_get0_d(key) (key)->d
Signature · 1 line
2.37.2
#2 lore raw
Quoted 11 lines

Date: Mon, 29 Aug 2022 00:37:55 +1000
From: Jonathan Gray <[email protected]>

Quoted 3 lines · Mark Kettenis

Recent versions of LibreSSL, such as those shipped as part of OpenBSD 7.1 and later have an opaque RSA object and do provide the RSA_get0_* functions that OpenSSL provides.

part of 3.5.0 / 0x3050000fL as well
https://lists.denx.de/pipermail/u-boot/2022-July/489768.html
https://marc.info/?l=libressl&m=164572407401570&w=2

Hmm, I thought I'd checked the 3.5.0 tarball, but apparently I didn't. Just posted v2 with the version check adjusted.

Quoted 24 lines
Quoted 23 lines
Fixes 2ecc354b8e46 ("tools: mkimage: fix build with LibreSSL")
---
 tools/sunxi_toc0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/sunxi_toc0.c +1 -1
index 56200bd927..eb5626411c 100644
@@ -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 < 0x3050100fL
 #define RSA_get0_n(key) (key)->n
 #define RSA_get0_e(key) (key)->e
 #define RSA_get0_d(key) (key)->d
Signature · 1 line
2.37.2