[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Compatibility defines should be used for LibreSSL.



commit be841f77aaa818f445d5b9a5e2eca6aa7ce4f0b6
Author: dana koch <dsk@xxxxxxxxxx>
Date:   Thu Dec 24 18:54:29 2015 -0800

    Compatibility defines should be used for LibreSSL.
    
    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 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/common/compat_openssl.h b/src/common/compat_openssl.h
index 3fcd684..5825ff7 100644
--- a/src/common/compat_openssl.h
+++ b/src/common/compat_openssl.h
@@ -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()

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits