]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Compatibility defines should be used for LibreSSL.
authordana koch <dsk@google.com>
Fri, 25 Dec 2015 02:54:29 +0000 (18:54 -0800)
committerNick Mathewson <nickm@torproject.org>
Thu, 7 Jan 2016 20:48:59 +0000 (12:48 -0800)
LibreSSL doesn't use OpenSSL_version (it uses the older SSLeay_version
API), but it reports a major version number as 2 in
OPENSSL_VERSION_NUMBER. Instead of fudging the version check, for now,
let's just check if we're using LibreSSL by checking the version number
macro exists, and use compatibility defines unconditionally when we
detect LibreSSL.

src/common/compat_openssl.h

index 3fcd684c0ccfc01e96d257767530884acb7e1ace..5825ff7a4ddb13da8d1c0975adaf70eba8ce7d59 100644 (file)
@@ -19,7 +19,8 @@
 #error "We require OpenSSL >= 1.0.0"
 #endif
 
-#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0)
+#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0) || \
+   defined(LIBRESSL_VERSION_NUMBER)
 #define OPENSSL_VERSION SSLEAY_VERSION
 #define OpenSSL_version(v) SSLeay_version(v)
 #define OpenSSL_version_num() SSLeay()