uboot-tools/U-Boot-2-2-rsa-Fix-deprecat...

50 lines
1.6 KiB
Diff

From patchwork Mon Feb 13 09:00:37 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,2/2] rsa: Fix deprecated warnings for OpenSSL 1.1.x
From: Jelle van der Waa <jelle@vdwaa.nl>
X-Patchwork-Id: 727165
Message-Id: <20170213090037.29223-2-jelle@vdwaa.nl>
To: Andrew Duda <aduda@meraki.com>, Simon Glass <sjg@chromium.org>,
"mario . six @ gdsys . cc" <mario.six@gdsys.cc>
Cc: u-boot@lists.denx.de
Date: Mon, 13 Feb 2017 10:00:37 +0100
ERR_remove_thread_state is deprecated in OpenSSL 1.1.x and does not do
anything anymore. Thread initialisation and deinitialisation is now
handled by the OpenSSL library.
Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
---
lib/rsa/rsa-sign.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c
index 965fb00f95..347a6aa89e 100644
--- a/lib/rsa/rsa-sign.c
+++ b/lib/rsa/rsa-sign.c
@@ -16,10 +16,6 @@
#include <openssl/evp.h>
#include <openssl/engine.h>
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-#define HAVE_ERR_REMOVE_THREAD_STATE
-#endif
-
#if OPENSSL_VERSION_NUMBER < 0x10100000L
void RSA_get0_key(const RSA *r,
const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
@@ -356,9 +352,9 @@ static void rsa_remove(void)
{
CRYPTO_cleanup_all_ex_data();
ERR_free_strings();
-#ifdef HAVE_ERR_REMOVE_THREAD_STATE
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L && OPENSSL_VERSION_NUMBER < 0x10100000L
ERR_remove_thread_state(NULL);
-#else
+#elif OPENSSL_VERSION_NUMBER < 0x10000000L
ERR_remove_state(0);
#endif
EVP_cleanup();