]> granicus.if.org Git - pdns/commitdiff
Fix build with LibreSSL, for which OPENSSL_VERSION_NUMBER is irrelevant
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 12 Aug 2016 07:52:08 +0000 (09:52 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 12 Aug 2016 07:52:08 +0000 (09:52 +0200)
pdns/dns_random.cc
pdns/opensslsigners.cc

index 623e3aa54dd4df3de3647d204e6b369542eca537..4a8ef8212d34266e042babec515fbef12dccf744 100644 (file)
@@ -2,7 +2,7 @@
 #include "config.h"
 #endif
 #include <openssl/aes.h>
-#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);
index 3496992574c157c3de7f71600d90b70af7756088..18b78cd3dec88fd2af5153fb9417cb7bdcaf5d18 100644 (file)
@@ -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;