diff mbox series

[U-Boot] tools/kwbimage: fix LibreSSL build

Message ID 20180220155901.71215-1-jsg@jsg.id.au
State Accepted
Commit a2d5efd74fb2e6893bcebfae41ea600bc7b65e6e
Delegated to: Tom Rini
Headers show
Series [U-Boot] tools/kwbimage: fix LibreSSL build | expand

Commit Message

Jonathan Gray Feb. 20, 2018, 3:59 p.m. UTC
Fix build after addition of RSA_get0_key() to LibreSSL.
Patch from Theo Buehler and Stuart Henderson.

Signed-off-by: Theo Buehler <tb@openbsd.org>
Signed-off-by: Stuart Henderson <sthen@openbsd.org>
---
 tools/kwbimage.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Tom Rini Feb. 23, 2018, 6:04 p.m. UTC | #1
On Wed, Feb 21, 2018 at 02:59:01AM +1100, Jonathan Gray wrote:

> Fix build after addition of RSA_get0_key() to LibreSSL.
> Patch from Theo Buehler and Stuart Henderson.
> 
> Signed-off-by: Theo Buehler <tb@openbsd.org>
> Signed-off-by: Stuart Henderson <sthen@openbsd.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index ccecf87185..3ca3b3b4a6 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -24,7 +24,8 @@ 
 #include <openssl/err.h>
 #include <openssl/evp.h>
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
+    (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
 static void RSA_get0_key(const RSA *r,
                  const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
 {
@@ -36,7 +37,7 @@  static void RSA_get0_key(const RSA *r,
        *d = r->d;
 }
 
-#else
+#elif !defined(LIBRESSL_VERSION_NUMBER)
 void EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
 {
 	EVP_MD_CTX_reset(ctx);