diff mbox series

[v3,2/3] linux-generic: crypto: port to OpenSSL 1.0.x thread id API

Message ID 20170223133734.19436-2-dmitry.ereminsolenikov@linaro.org
State Accepted
Commit bcf8b3b1b5d509ba01c0daff9f2b2056026b643a
Headers show
Series [v3,1/3] linux-generic: crypto: add missing include | expand

Commit Message

Dmitry Eremin-Solenikov Feb. 23, 2017, 1:37 p.m. UTC
OpenSSL 1.0.x has deperecated old 0.9.x thread id callbacks. If the
library is compiled without deprecated functions, compiling ODP fails
with missing functions errors. So, let's port odp_crypto to OpenSSL 1.0
thread ID API.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
 platform/linux-generic/odp_crypto.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.11.0
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c
index b53b0fc1..adadbf97 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -949,9 +949,9 @@  odp_crypto_operation(odp_crypto_op_param_t *param,
 	return 0;
 }
 
-static unsigned long openssl_thread_id(void)
+static void openssl_thread_id(CRYPTO_THREADID *id)
 {
-	return (unsigned long)odp_thread_id();
+	CRYPTO_THREADID_set_numeric(id, odp_thread_id());
 }
 
 static void openssl_lock(int mode, int n,
@@ -1003,7 +1003,7 @@  odp_crypto_init_global(void)
 			odp_ticketlock_init((odp_ticketlock_t *)
 					    &global->openssl_lock[idx]);
 
-		CRYPTO_set_id_callback(openssl_thread_id);
+		CRYPTO_THREADID_set_callback(openssl_thread_id);
 		CRYPTO_set_locking_callback(openssl_lock);
 	}