From 31031d7c57a73f612ca2b4c457283e30ec7c87e5 Mon Sep 17 00:00:00 2001 From: Renaud Allard Date: Tue, 24 Mar 2020 14:14:39 +0100 Subject: [PATCH] Added checks for LibreSSL and OpenBSD --- CMakeLists.txt | 2 +- src/openssl/tls.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10d10b99..5169c68c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,7 +102,7 @@ elseif (APPLE) elseif (UNIX) set(HOSTOS "unix") - if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") + if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600") endif () if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") diff --git a/src/openssl/tls.c b/src/openssl/tls.c index af1c3122..8730165a 100644 --- a/src/openssl/tls.c +++ b/src/openssl/tls.c @@ -48,19 +48,21 @@ #include "context.h" #include "const-info.h" -#ifdef USE_DANESSL +#if defined(USE_DANESSL) || defined(LIBRESSL_VERSION_NUMBER) # include "ssl_dane/danessl.h" #endif #include "tls.h" /* Double check configure has worked as expected. */ +#ifndef LIBRESSL_VERSION_NUMBER #if defined(USE_DANESSL) && \ (defined(HAVE_SSL_DANE_ENABLE) || \ defined(HAVE_OPENSSL_INIT_CRYPTO) || \ defined(HAVE_SSL_CTX_DANE_ENABLE)) #error Configure error USE_DANESSL defined with OpenSSL 1.1 functions! #endif +#endif /* Cipher suites recommended in RFC7525. */ static char const * const _getdns_tls_context_default_cipher_list =