You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

47 lines
1.3 KiB

From cd73c968e896b8ba364510abdcd3dcc63d017110 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Thu, 8 Nov 2018 14:57:49 -0800
Subject: [PATCH] libyara: Switch to OpenSSL's THREADID API
The non THREADID API was deprecated back in OpenSSL 1.0.0
---
libyara/libyara.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libyara/libyara.c b/libyara/libyara.c
index f05d1f9..6f20488 100644
--- a/libyara/libyara.c
+++ b/libyara/libyara.c
@@ -87,9 +87,9 @@ char yr_altercase[256];
static YR_MUTEX *openssl_locks;
-static unsigned long _thread_id(void)
+static void _thread_id(CRYPTO_THREADID *id)
{
- return (unsigned long) yr_current_thread_id();
+ CRYPTO_THREADID_set_numeric(id, (unsigned long) yr_current_thread_id());
}
@@ -155,7 +155,7 @@ YR_API int yr_initialize(void)
for (i = 0; i < CRYPTO_num_locks(); i++)
yr_mutex_create(&openssl_locks[i]);
- CRYPTO_set_id_callback(_thread_id);
+ CRYPTO_THREADID_set_callback(_thread_id);
CRYPTO_set_locking_callback(_locking_function);
#elif defined(HAVE_WINCRYPT_H)
@@ -226,7 +226,7 @@ YR_API int yr_finalize(void)
yr_mutex_destroy(&openssl_locks[i]);
OPENSSL_free(openssl_locks);
- CRYPTO_set_id_callback(NULL);
+ CRYPTO_THREADID_set_callback(NULL);
CRYPTO_set_locking_callback(NULL);
#elif defined(HAVE_WINCRYPT_H)
--
2.19.1