diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2018-12-06 12:45:10 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-12-07 07:54:21 +0100 |
commit | 113677818502a071aeaddffd0b64dce3dcab220d (patch) | |
tree | e71913493dbbf9be7f3b2b5afeb8d54e35751400 /scripts | |
parent | 706671ef92d0a9985afb87e733d765bb3d4ebe8b (diff) | |
download | barebox-113677818502a071aeaddffd0b64dce3dcab220d.tar.gz barebox-113677818502a071aeaddffd0b64dce3dcab220d.tar.xz |
scripts: imx-image: fix build with OpenSSL < 1.1.0
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>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/imx/imx-image.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c index 5fd34065ec..34a072039d 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, |