mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 03:44:22 -04:00
Unbreak build with LibreSSL after openssl 1.1 support added
Fixes: 3e9e0a0d46e4 ("Make it build using OpenSSL 1.1.0") Fixes: #445 (cherry picked from commit d057c45e8f48aa90d8b340cac4c8ae4cc8b5d0ac)
This commit is contained in:
parent
8567f2f56e
commit
230af9f0e8
@ -1,7 +1,7 @@
|
|||||||
#ifndef OPENSSL_COMPAT_H
|
#ifndef OPENSSL_COMPAT_H
|
||||||
#define 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)
|
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
|
#define TLS_method SSLv23_method
|
||||||
|
|
||||||
#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
|
#endif /* (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) */
|
||||||
|
|
||||||
#endif /* OPENSSL_COMPAT_H */
|
#endif /* OPENSSL_COMPAT_H */
|
||||||
|
@ -312,7 +312,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
uri[sizeof(uri) - 1] = '\0';
|
uri[sizeof(uri) - 1] = '\0';
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
// Initialize OpenSSL
|
// Initialize OpenSSL
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
@ -480,7 +480,7 @@ cleanup:
|
|||||||
SSL_CTX_free(ssl_ctx);
|
SSL_CTX_free(ssl_ctx);
|
||||||
if (type == HTTP && ssl)
|
if (type == HTTP && ssl)
|
||||||
SSL_free(ssl);
|
SSL_free(ssl);
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
EVP_cleanup();
|
EVP_cleanup();
|
||||||
ERR_free_strings();
|
ERR_free_strings();
|
||||||
|
|
||||||
@ -492,7 +492,7 @@ cleanup:
|
|||||||
CRYPTO_cleanup_all_ex_data();
|
CRYPTO_cleanup_all_ex_data();
|
||||||
|
|
||||||
sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
|
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
|
#ifdef _WIN32
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
|
@ -259,7 +259,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
if (use_ssl) {
|
if (use_ssl) {
|
||||||
int r;
|
int r;
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
|
@ -48,7 +48,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#define HOSTNAME_MAX_SIZE 255
|
#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
|
#define ASN1_STRING_get0_data ASN1_STRING_data
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ get_ssl_ctx(void)
|
|||||||
void
|
void
|
||||||
init_ssl(void)
|
init_ssl(void)
|
||||||
{
|
{
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user