void-packages/srcpkgs/yara/patches/libressl.patch

32 lines
1.3 KiB
Diff

--- libyara/libyara.c.orig 2016-09-06 20:09:47.000000000 +0000
+++ libyara/libyara.c 2017-05-10 12:40:13.393089280 +0000
@@ -71,7 +71,7 @@
char 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(&tidx_key));
FAIL_ON_ERROR(yr_thread_storage_create(&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));
--- libyara/modules/pe.c.orig 2016-09-06 20:09:47.000000000 +0000
+++ libyara/modules/pe.c 2017-05-10 12:38:23.755095815 +0000
@@ -42,7 +42,7 @@
#include <openssl/bio.h>
#include <openssl/pkcs7.h>
#include <openssl/x509.h>
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#define X509_get_signature_nid(o) OBJ_obj2nid((o)->sig_alg->algorithm)
#endif
#endif