From 75f3fbaa3c7316fcef3509ef1e3813b94d8c4c8a Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 2 May 2018 08:18:48 -0400 Subject: LibreSSL compatibility fixes. LibreSSL, despite not having the OpenSSL 1.1 API, does define OPENSSL_VERSION in crypto.h. Additionally, it apparently annotates some functions as returning NULL, so that our unit tests need to be more careful about checking for NULL so they don't get compilation warnings. Closes ticket 26006. --- src/common/compat_openssl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/compat_openssl.h b/src/common/compat_openssl.h index 1bfe188075..76679872bc 100644 --- a/src/common/compat_openssl.h +++ b/src/common/compat_openssl.h @@ -8,6 +8,8 @@ #define TOR_COMPAT_OPENSSL_H #include +// workaround for libressl; not needed in later Tor versions. +#include /** * \file compat_openssl.h @@ -27,8 +29,11 @@ #define OPENSSL_1_1_API #endif -#ifndef OPENSSL_1_1_API +#ifndef OPENSSL_VERSION #define OPENSSL_VERSION SSLEAY_VERSION +#endif + +#ifndef OPENSSL_1_1_API #define OpenSSL_version(v) SSLeay_version(v) #define OpenSSL_version_num() SSLeay() #define RAND_OpenSSL() RAND_SSLeay() -- cgit v1.2.3-54-g00ecf