From: parazyd Date: Wed, 27 Jun 2018 12:33:05 +0200 Subject: [U-Boot] [PATCH v2] rsa: Support LibreSSL in rsa-sign.c Message-ID: <20180627103305.2722-1-parazyd@dyne.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de At present rsa-sign.c can not be compiled with LibreSSL older than 2.7.0. This commit adjusts the guards in the rsa-sign.c to check for LiBRESSL_VERSION_NUMBER where necessary. Signed-off-by: parazyd --- lib/rsa/rsa-sign.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c index cfe09cc94c..ff866c6045 100644 --- a/lib/rsa/rsa-sign.c +++ b/lib/rsa/rsa-sign.c @@ -20,7 +20,7 @@ #define HAVE_ERR_REMOVE_THREAD_STATE #endif -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || LIBRESSL_VERSION_NUMBER < 0x2070000fL static void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) { @@ -299,7 +299,7 @@ static int rsa_init(void) { int ret; -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || LIBRESSL_VERSION_NUMBER < 0x2070000fL ret = SSL_library_init(); #else ret = OPENSSL_init_ssl(0, NULL); @@ -432,7 +432,7 @@ static int rsa_sign_with_key(RSA *rsa, struct checksum_algo *checksum_algo, ret = rsa_err("Could not obtain signature"); goto err_sign; } - #if OPENSSL_VERSION_NUMBER < 0x10100000L + #if OPENSSL_VERSION_NUMBER < 0x10100000L || LIBRESSL_VERSION_NUMBER < 0x2070000fL EVP_MD_CTX_cleanup(context); #else EVP_MD_CTX_reset(context); -- 2.18.0