From 1f2b558da9f631a635e9b099b455696b1903bee4 Mon Sep 17 00:00:00 2001
From: Quentin Armitage <quentin@armitage.org.uk>
Date: Fri, 15 Mar 2019 00:12:19 +0000
Subject: [PATCH 3/3] Fix some configure tested checks for OPENSSL_init_crypto
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
---
genhash/ssl.c | 6 +++---
keepalived/check/check_ssl.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/genhash/ssl.c b/genhash/ssl.c
index 96f51201..0574675a 100644
--- a/genhash/ssl.c
+++ b/genhash/ssl.c
@@ -44,7 +44,7 @@ void
init_ssl(void)
{
/* Library initialization */
-#if HAVE_OPENSSL_INIT_CRYPTO
+#ifdef HAVE_OPENSSL_INIT_CRYPTO
#ifndef HAVE_OPENSSL_INIT_NO_LOAD_CONFIG_BUG
/* In OpenSSL v1.1.1 if the following is called, SSL_CTX_new() below fails.
* It works in v1.1.0h and v1.1.1b.
@@ -59,7 +59,7 @@ init_ssl(void)
#endif
/* Initialize SSL context */
-#if HAVE_TLS_METHOD
+#ifdef HAVE_TLS_METHOD
req->meth = TLS_method();
#else
req->meth = SSLv23_method();
@@ -123,7 +123,7 @@ ssl_connect(thread_t * thread)
}
BIO_set_nbio(sock_obj->bio, 1); /* Set the Non-Blocking flag */
-#if HAVE_SSL_SET0_RBIO
+#ifdef HAVE_SSL_SET0_RBIO
BIO_up_ref(sock_obj->bio);
SSL_set0_rbio(sock_obj->ssl, sock_obj->bio);
SSL_set0_wbio(sock_obj->ssl, sock_obj->bio);
diff --git a/keepalived/check/check_ssl.c b/keepalived/check/check_ssl.c
index 2743ea87..58061b91 100644
--- a/keepalived/check/check_ssl.c
+++ b/keepalived/check/check_ssl.c
@@ -68,7 +68,7 @@ build_ssl_ctx(void)
ssl_data_t *ssl;
/* Library initialization */
-#if HAVE_OPENSSL_INIT_CRYPTO
+#ifdef HAVE_OPENSSL_INIT_CRYPTO
#ifndef HAVE_OPENSSL_INIT_NO_LOAD_CONFIG_BUG
/* In OpenSSL v1.1.1 if the following is called, SSL_CTX_new() below fails.
* It works in v1.1.0h and v1.1.1b.
@@ -88,7 +88,7 @@ build_ssl_ctx(void)
ssl = check_data->ssl;
/* Initialize SSL context */
-#if HAVE_TLS_METHOD
+#ifdef HAVE_TLS_METHOD
ssl->meth = TLS_method();
#else
ssl->meth = SSLv23_method();
@@ -226,7 +226,7 @@ ssl_connect(thread_t * thread, int new_req)
BIO_get_fd(req->bio, &bio_fd);
fcntl(bio_fd, F_SETFD, fcntl(bio_fd, F_GETFD) | FD_CLOEXEC);
-#if HAVE_SSL_SET0_RBIO
+#ifdef HAVE_SSL_SET0_RBIO
BIO_up_ref(req->bio);
SSL_set0_rbio(req->ssl, req->bio);
SSL_set0_wbio(req->ssl, req->bio);
--
2.20.1