diff options
author | Matthew Kunjummen <mkunjummen@gmail.com> | 2017-10-17 21:03:00 -0500 |
---|---|---|
committer | Matthew Kunjummen <mkunjummen@gmail.com> | 2017-10-17 21:06:39 -0500 |
commit | d154b846e8a113b56ef464f036c0e316d4e44568 (patch) | |
tree | e2cb38e06f297a61474f004aafbcd38edfac40e9 /modules | |
parent | bac99b6811bc1215c3bcadb2b5fe8174915932c2 (diff) |
Adjust openssl #defines to be libressl compatible
Corrected inability to build on systems using libressl instead of
openssl (e. g. void linux) by adjusting the #defines in
modules/openssl/stream_peer_openssl.cpp and
modules/openssl/stream_peer_openssl.h to check if
LIBRESSL_VERSION_NUMBER is defined (as done similarly in the following
patch in freebsd:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219362 ).
Diffstat (limited to 'modules')
-rw-r--r-- | modules/openssl/stream_peer_openssl.cpp | 6 | ||||
-rw-r--r-- | modules/openssl/stream_peer_openssl.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/openssl/stream_peer_openssl.cpp b/modules/openssl/stream_peer_openssl.cpp index c19bdc4214..6d1d5485f3 100644 --- a/modules/openssl/stream_peer_openssl.cpp +++ b/modules/openssl/stream_peer_openssl.cpp @@ -30,7 +30,7 @@ #include "stream_peer_openssl.h" // Compatibility with OpenSSL 1.1.0. -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) #define BIO_set_num(b, n) #else #define BIO_set_num(b, n) ((b)->num = (n)) @@ -269,7 +269,7 @@ int StreamPeerOpenSSL::_bio_puts(BIO *b, const char *str) { return _bio_write(b, str, strlen(str)); } -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) BIO_METHOD *StreamPeerOpenSSL::_bio_method = NULL; BIO_METHOD *StreamPeerOpenSSL::_get_bio_method() { @@ -568,7 +568,7 @@ void StreamPeerOpenSSL::initialize_ssl() { load_certs_func = _load_certs; _create = _create_func; -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) CRYPTO_malloc_init(); // Initialize malloc, free, etc for OpenSSL's use #endif SSL_library_init(); // Initialize OpenSSL's SSL libraries diff --git a/modules/openssl/stream_peer_openssl.h b/modules/openssl/stream_peer_openssl.h index 535114058d..ad09564447 100644 --- a/modules/openssl/stream_peer_openssl.h +++ b/modules/openssl/stream_peer_openssl.h @@ -53,7 +53,7 @@ private: static int _bio_gets(BIO *b, char *buf, int len); static int _bio_puts(BIO *b, const char *str); -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) static BIO_METHOD *_bio_method; #else static BIO_METHOD _bio_method; |