mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/4] scripts: imx-image: fix build with OpenSSL < 1.1.0
Date: Thu,  6 Dec 2018 12:45:10 +0100	[thread overview]
Message-ID: <20181206114510.20643-4-l.stach@pengutronix.de> (raw)
In-Reply-To: <20181206114510.20643-1-l.stach@pengutronix.de>

When adding support for OpenSSL 1.1.x it was missed that EVP_PKEY_get0_RSA
is only available with that version. Earlier versions don't provide a fully
equivalent function, so add it to the compatibility helpers.

Fixes: 542a50d4eb (scripts: imx-image: fix build with OpenSSL 1.1.x)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 scripts/imx/imx-image.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index fa93e4791784..7c59ef024b84 100644
--- a/scripts/imx/imx-image.c
+++ b/scripts/imx/imx-image.c
@@ -132,6 +132,14 @@ void RSA_get0_key(const RSA *r, const BIGNUM **n,
 	if (d != NULL)
 		*d = r->d;
 }
+
+RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
+{
+    if (pkey->type != EVP_PKEY_RSA)
+        return NULL;
+
+    return pkey->pkey.rsa;
+}
 #endif
 
 static int extract_key(const char *certfile, uint8_t **modulus, int *modulus_len,
-- 
2.19.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-12-06 11:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06 11:45 [PATCH 1/4] ARM: imx: select OFDEVICE for VF610 Lucas Stach
2018-12-06 11:45 ` [PATCH 2/4] of: remove non-existent of_match_ptr Lucas Stach
2018-12-06 11:45 ` [PATCH 3/4] ARM: at91: add architecture dependecy to KSZ9477_EVB board Lucas Stach
2018-12-06 11:45 ` Lucas Stach [this message]
2018-12-07  6:54 ` [PATCH 1/4] ARM: imx: select OFDEVICE for VF610 Sascha Hauer
2018-12-07  8:18 ` Uwe Kleine-König
2018-12-07  9:01   ` Lucas Stach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181206114510.20643-4-l.stach@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox