From: Remi Gacogne Date: Fri, 12 Aug 2016 07:52:08 +0000 (+0200) Subject: Fix build with LibreSSL, for which OPENSSL_VERSION_NUMBER is irrelevant X-Git-Tag: rec-4.0.2~39^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=115f658ee2000a4cdcc13e999da50b3634c6a907;p=pdns Fix build with LibreSSL, for which OPENSSL_VERSION_NUMBER is irrelevant --- diff --git a/pdns/dns_random.cc b/pdns/dns_random.cc index 623e3aa54..4a8ef8212 100644 --- a/pdns/dns_random.cc +++ b/pdns/dns_random.cc @@ -2,7 +2,7 @@ #include "config.h" #endif #include -#if OPENSSL_VERSION_NUMBER > 0x1000100fL +#if OPENSSL_VERSION_NUMBER > 0x1000100fL && !defined LIBRESSL_VERSION_NUMBER // Older OpenSSL does not have CRYPTO_ctr128_encrypt. Before 1.1.0 the header // file did not have the necessary extern "C" wrapper. In 1.1.0, AES_ctr128_encrypt // was removed. @@ -53,7 +53,7 @@ unsigned int dns_random(unsigned int n) if(!g_initialized) abort(); uint32_t out; -#if OPENSSL_VERSION_NUMBER > 0x1000100fL +#if OPENSSL_VERSION_NUMBER > 0x1000100fL && !defined LIBRESSL_VERSION_NUMBER CRYPTO_ctr128_encrypt((const unsigned char*)&g_in, (unsigned char*) &out, sizeof(g_in), &aes_key, g_counter, g_stream, &g_offset, (block128_f) AES_encrypt); #else AES_ctr128_encrypt((const unsigned char*)&g_in, (unsigned char*) &out, sizeof(g_in), &aes_key, g_counter, g_stream, &g_offset); diff --git a/pdns/opensslsigners.cc b/pdns/opensslsigners.cc index 349699257..18b78cd3d 100644 --- a/pdns/opensslsigners.cc +++ b/pdns/opensslsigners.cc @@ -12,7 +12,7 @@ #include "opensslsigners.hh" #include "dnssecinfra.hh" -#if OPENSSL_VERSION_NUMBER < 0x1010000fL +#if (OPENSSL_VERSION_NUMBER < 0x1010000fL || defined LIBRESSL_VERSION_NUMBER) /* OpenSSL < 1.1.0 needs support for threading/locking in the calling application. */ static pthread_mutex_t *openssllocks;