All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3] tools/mxsimage: Support building with LibreSSL
@ 2018-03-18 15:03 Hauke Mehrtens
  2018-03-19 10:04 ` Jonathan Gray
  2018-04-07 13:24 ` [U-Boot] [U-Boot, " Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Hauke Mehrtens @ 2018-03-18 15:03 UTC (permalink / raw)
  To: u-boot

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.

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

diff --git a/tools/mxsimage.c b/tools/mxsimage.c
index 32a7978cae..c8f1f204e3 100644
--- a/tools/mxsimage.c
+++ b/tools/mxsimage.c
@@ -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);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v3] tools/mxsimage: Support building with LibreSSL
  2018-03-18 15:03 [U-Boot] [PATCH v3] tools/mxsimage: Support building with LibreSSL Hauke Mehrtens
@ 2018-03-19 10:04 ` Jonathan Gray
  2018-04-07 13:24 ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Gray @ 2018-03-19 10:04 UTC (permalink / raw)
  To: u-boot

On Sun, Mar 18, 2018 at 04:03:47PM +0100, Hauke Mehrtens wrote:
> 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.
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Reviewed-by: Jonathan Gray <jsg@jsg.id.au>

> ---
>  tools/mxsimage.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/mxsimage.c b/tools/mxsimage.c
> index 32a7978cae..c8f1f204e3 100644
> --- a/tools/mxsimage.c
> +++ b/tools/mxsimage.c
> @@ -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);
> -- 
> 2.11.0
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [U-Boot, v3] tools/mxsimage: Support building with LibreSSL
  2018-03-18 15:03 [U-Boot] [PATCH v3] tools/mxsimage: Support building with LibreSSL Hauke Mehrtens
  2018-03-19 10:04 ` Jonathan Gray
@ 2018-04-07 13:24 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2018-04-07 13:24 UTC (permalink / raw)
  To: u-boot

On Sun, Mar 18, 2018 at 04:03:47PM +0100, Hauke Mehrtens wrote:

> 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.
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> Reviewed-by: Jonathan Gray <jsg@jsg.id.au>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-07 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-18 15:03 [U-Boot] [PATCH v3] tools/mxsimage: Support building with LibreSSL Hauke Mehrtens
2018-03-19 10:04 ` Jonathan Gray
2018-04-07 13:24 ` [U-Boot] [U-Boot, " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.