]> granicus.if.org Git - libevent/commitdiff
Unbreak build with LibreSSL after openssl 1.1 support added
authorJan Beich <jbeich@FreeBSD.org>
Sat, 28 Jan 2017 16:42:13 +0000 (16:42 +0000)
committerAzat Khuzhin <a3at.mail@gmail.com>
Sun, 29 Jan 2017 21:25:26 +0000 (00:25 +0300)
Fixes: 3e9e0a0d46e4 ("Make it build using OpenSSL 1.1.0")
Fixes: #445
openssl-compat.h
sample/https-client.c
sample/le-proxy.c
sample/openssl_hostname_validation.c
test/regress_ssl.c

index 69afc716e25eebda54e076f335c8a612df749b99..0f2dcb75d88fcbeeeeeedfb8ebf9a3f2f57f6296 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef OPENSSL_COMPAT_H
 #define OPENSSL_COMPAT_H
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
 
 static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
 {
@@ -30,6 +30,6 @@ static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
 
 #define TLS_method SSLv23_method
 
-#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+#endif /* (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) */
 
 #endif /* OPENSSL_COMPAT_H */
index 748395656b2e5e6f1e492e64c10a817520be0417..7566683644c2b57ff3b662071a3b0ce83cff2f6f 100644 (file)
@@ -312,7 +312,7 @@ main(int argc, char **argv)
        }
        uri[sizeof(uri) - 1] = '\0';
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
        // Initialize OpenSSL
        SSL_library_init();
        ERR_load_crypto_strings();
@@ -480,7 +480,7 @@ cleanup:
                SSL_CTX_free(ssl_ctx);
        if (type == HTTP && ssl)
                SSL_free(ssl);
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
        EVP_cleanup();
        ERR_free_strings();
 
@@ -492,7 +492,7 @@ cleanup:
        CRYPTO_cleanup_all_ex_data();
 
        sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
-#endif /*OPENSSL_VERSION_NUMBER < 0x10100000L */
+#endif /* (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) */
 
 #ifdef _WIN32
        WSACleanup();
index 8d9b529ee68d1105ed365787531e1b9c5763311c..e2fbf4522d650d7226a88d974c869cbcaf10f882 100644 (file)
@@ -259,7 +259,7 @@ main(int argc, char **argv)
 
        if (use_ssl) {
                int r;
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
                SSL_library_init();
                ERR_load_crypto_strings();
                SSL_load_error_strings();
index 40312f2e96132cbdb73aca15a545a4a407528f22..a60e38c4e0f9330039d709928047e0e339d094e3 100644 (file)
@@ -48,7 +48,7 @@ SOFTWARE.
 
 #define HOSTNAME_MAX_SIZE 255
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
 #define ASN1_STRING_get0_data ASN1_STRING_data
 #endif
 
index 681705fcf96997b6212b6035f3dbc64987e62126..490853fcb0a4d8562122116eb1412e7ec991ff00 100644 (file)
@@ -186,7 +186,7 @@ get_ssl_ctx(void)
 void
 init_ssl(void)
 {
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
        SSL_library_init();
        ERR_load_crypto_strings();
        SSL_load_error_strings();