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

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