void-packages/srcpkgs/yara/patches/libressl.patch
2017-06-28 22:36:08 +00:00

47 lines
1.7 KiB
Diff

--- libyara/libyara.c.orig 2017-05-22 10:24:23.000000000 +0000
+++ libyara/libyara.c 2017-05-23 00:18:32.658793790 +0000
@@ -37,7 +37,7 @@
#include <yara/mem.h>
#include <yara/threading.h>
-#if defined(HAVE_LIBCRYPTO) && OPENSSL_VERSION_NUMBER < 0x10100000L
+#if defined(HAVE_LIBCRYPTO) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
#include <openssl/crypto.h>
#endif
@@ -71,7 +71,7 @@
char yr_altercase[256];
-#if defined(HAVE_LIBCRYPTO) && OPENSSL_VERSION_NUMBER < 0x10100000L
+#if defined(HAVE_LIBCRYPTO) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
// The OpenSSL library before version 1.1 requires some locks in order
// to be thread-safe. These locks are initialized in yr_initialize
@@ -133,7 +133,7 @@
FAIL_ON_ERROR(yr_thread_storage_create(&yr_tidx_key));
FAIL_ON_ERROR(yr_thread_storage_create(&yr_recovery_state_key));
- #if defined HAVE_LIBCRYPTO && OPENSSL_VERSION_NUMBER < 0x10100000L
+ #if defined HAVE_LIBCRYPTO && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
openssl_locks = (YR_MUTEX*) OPENSSL_malloc(
CRYPTO_num_locks() * sizeof(YR_MUTEX));
@@ -178,7 +178,7 @@
YR_API int yr_finalize(void)
{
- #if defined HAVE_LIBCRYPTO && OPENSSL_VERSION_NUMBER < 0x10100000L
+ #if defined HAVE_LIBCRYPTO && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
int i;
#endif
@@ -194,7 +194,7 @@
if (init_count > 0)
return ERROR_SUCCESS;
- #if defined HAVE_LIBCRYPTO && OPENSSL_VERSION_NUMBER < 0x10100000L
+ #if defined HAVE_LIBCRYPTO && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
for (i = 0; i < CRYPTO_num_locks(); i ++)
yr_mutex_destroy(&openssl_locks[i]);