uboot-mvebu: backport LibreSSL patches for older version of LibreSSL
[openwrt/openwrt.git] / package / boot / uboot-mvebu / patches / 0002-tools-mkimage-fix-build-with-LibreSSL.patch
1 From aed6107ae96870cd190b23d6da34a7e616799ed3 Mon Sep 17 00:00:00 2001
2 From: Michal Vasilek <michal.vasilek@nic.cz>
3 Date: Fri, 22 Jul 2022 19:55:53 +0200
4 Subject: [PATCH 1/2] tools: mkimage: fix build with LibreSSL
5
6 RSA_get0_* functions are not available in LibreSSL
7
8 Signed-off-by: Michal Vasilek <michal.vasilek@nic.cz>
9 Reviewed-by: Simon Glass <sjg@chromium.org>
10 ---
11 tools/sunxi_toc0.c | 6 ++++++
12 1 file changed, 6 insertions(+)
13
14 --- a/tools/sunxi_toc0.c
15 +++ b/tools/sunxi_toc0.c
16 @@ -34,6 +34,12 @@
17 #define pr_warn(fmt, args...) fprintf(stderr, pr_fmt(fmt), "warning", ##args)
18 #define pr_info(fmt, args...) fprintf(stderr, pr_fmt(fmt), "info", ##args)
19
20 +#if defined(LIBRESSL_VERSION_NUMBER)
21 +#define RSA_get0_n(key) (key)->n
22 +#define RSA_get0_e(key) (key)->e
23 +#define RSA_get0_d(key) (key)->d
24 +#endif
25 +
26 struct __packed toc0_key_item {
27 __le32 vendor_id;
28 __le32 key0_n_len;