[PATCH 4/4] scripts: imx-image: fix build with OpenSSL < 1.1.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux