build: improve detection of new OpenSSL features

Building on Mac OS X revealed that the current check for
CRYPTO_THREADID_set_callback() availability in OpenSSL is not correct.

There also does not seem to be a guarantee that TLSv1_2_method() is
available when TLS1_2_VERSION is #define'd.

Change-Id: I21508065fc181a1c74bee4fd6d23bb5bdf7cea7a
BUG: 1222317
Original-author: Kaleb KEITHLEY <kkeithle@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/11140
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
This commit is contained in:
Niels de Vos 2015-06-09 16:32:37 +02:00 committed by Raghavendra G
parent 71f27128cb
commit 515feb9885
2 changed files with 4 additions and 3 deletions

View File

@ -534,8 +534,9 @@ fi
AM_CONDITIONAL([ENABLE_BD_XLATOR], [test x$BUILD_BD_XLATOR = xyes])
dnl check for old openssl
AC_CHECK_FUNC([ssl], [CRYPTO_THREADID_set_callback], [HAVE_CRYPTO_THREADID=1], HAVE_CRYPTO_THREADID=0)
AC_DEFINE(HAVE_CRYPTO_THREADID, $HAVE_CRYPTO_THREADID, [use new OpenSSL functions])
AC_CHECK_LIB([crypto], CRYPTO_THREADID_set_callback, [AC_DEFINE([HAVE_CRYPTO_THREADID], [1], [use new OpenSSL functions])])
AC_CHECK_LIB([ssl], TLSv1_2_method, [AC_DEFINE([HAVE_TLSV1_2_METHOD], [1], [use new OpenSSL functions])])
# start encryption/crypt section

View File

@ -4000,7 +4000,7 @@ socket_init (rpc_transport_t *this)
goto err;
}
#if defined(TLS1_2_VERSION)
#if HAVE_TLSV1_2_METHOD
priv->ssl_meth = (SSL_METHOD *)TLSv1_2_method();
#else /* old openssl */
#warning TLSv1.2 is not available, using insecure TLSv1 support