The mxsimage utility fails to compile against LibreSSL because LibreSSL
says it is OpenSSL 2.0, but it does not support the complete OpenSSL 1.1
interface.

LibreSSL defines OPENSSL_VERSION_NUMBER with 0x20000000L and therefor
claims to have an API compatible with OpenSSL 2.0, but it does not
implement OPENSSL_zalloc() and some other functions in its most recent
version. OpenSSL implements this function since version 1.1.0.

This commit will activate the compatibility code meant for
OpenSSL < 1.1.0 also for all versions of LibreSSL, if some version of
LibreSSL will support these functions in the future the version check
should be adapted.

Signed-off-by: Hauke Mehrtens <ha...@hauke-m.de>
---
 tools/mxsimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/mxsimage.c b/tools/mxsimage.c
index 32a7978cae..0cbf007dff 100644
--- a/tools/mxsimage.c
+++ b/tools/mxsimage.c
@@ -26,7 +26,7 @@
  * OpenSSL 1.1.0 and newer compatibility functions:
  * https://wiki.openssl.org/index.php/1.1_API_Changes
  */
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
 static void *OPENSSL_zalloc(size_t num)
 {
        void *ret = OPENSSL_malloc(num);
-- 
2.11.0

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to