aboutsummaryrefslogtreecommitdiffstats
path: root/community/pdns/libressl.patch
blob: 0fecb708146caaa533de5a4d5ed14a8a54cafc45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 115f658ee2000a4cdcc13e999da50b3634c6a907 Mon Sep 17 00:00:00 2001
From: Remi Gacogne <remi.gacogne@powerdns.com>
Date: Fri, 12 Aug 2016 09:52:08 +0200
Subject: [PATCH] Fix build with LibreSSL, for which OPENSSL_VERSION_NUMBER is
 irrelevant

---
 pdns/dns_random.cc     | 4 ++--
 pdns/opensslsigners.cc | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pdns/dns_random.cc b/pdns/dns_random.cc
index 623e3aa..4a8ef82 100644
--- a/pdns/dns_random.cc
+++ b/pdns/dns_random.cc
@@ -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);
diff --git a/pdns/opensslsigners.cc b/pdns/opensslsigners.cc
index 3496992..18b78cd 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;