Skip to contentSkip to conversation

tools/mxsimage: Support building with LibreSSL

PATCH New Hauke Mehrtens 3 participants 3 messages Mar 18, 2018 – Apr 7, 2018 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 tools/mxsimage: Support building with LibreSSL

The mxsimage utility fails to compile against LibreSSL version < 2.7.0 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 implements EVP_MD_CTX_new(), EVP_MD_CTX_free() and EVP_CIPHER_CTX_reset() only starting with version 2.7.0, which is not yet released. OpenSSL implements this function since version 1.1.0.

This commit will activate the compatibility code meant for OpenSSL < 1.1.0 also for LibreSSL version < 2.7.0.

---
 tools/mxsimage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/mxsimage.c +2 -1
index 32a7978cae..c8f1f204e3 100644
@@ -26,7 +26,8 @@
  * 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) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
 static void *OPENSSL_zalloc(size_t num)
 {
 	void *ret = OPENSSL_malloc(num);
Signature · 1 line
2.11.0
#1 lore raw

PATCH v3 1/1 tools/mxsimage: Support building with LibreSSL

Quoted 10 lines · Hauke Mehrtens

The mxsimage utility fails to compile against LibreSSL version < 2.7.0 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 implements EVP_MD_CTX_new(), EVP_MD_CTX_free() and EVP_CIPHER_CTX_reset() only starting with version 2.7.0, which is not yet released. OpenSSL implements this function since version 1.1.0.

Quoted 4 lines

This commit will activate the compatibility code meant for OpenSSL < 1.1.0 also for LibreSSL version < 2.7.0.

Quoted 25 lines
---
 tools/mxsimage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/mxsimage.c +2 -1
index 32a7978cae..c8f1f204e3 100644
@@ -26,7 +26,8 @@
  * 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) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
 static void *OPENSSL_zalloc(size_t num)
 {
 	void *ret = OPENSSL_malloc(num);
Signature · 6 lines
2.11.0

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
#2 lore raw

PATCH v3 1/1 tools/mxsimage: Support building with LibreSSL

In reply to Hauke Mehrtens
Quoted 10 lines · Hauke Mehrtens

The mxsimage utility fails to compile against LibreSSL version < 2.7.0 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 implements EVP_MD_CTX_new(), EVP_MD_CTX_free() and EVP_CIPHER_CTX_reset() only starting with version 2.7.0, which is not yet released. OpenSSL implements this function since version 1.1.0.

Quoted 5 lines

This commit will activate the compatibility code meant for OpenSSL < 1.1.0 also for LibreSSL version < 2.7.0.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180407/a7538680/attachment.sig>