From: Nikolai Kondrashov Date: Fri, 18 Nov 2016 18:08:33 +0000 (+0200) Subject: Fix SSL_get_client/server_random checks X-Git-Tag: release_3_0_13~92^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce9170227abed38f81e288b343655c509cc95e55;p=thirdparty%2Ffreeradius-server.git Fix SSL_get_client/server_random checks Needed for conditionally avoiding accessing private OpenSSL structures in a following patch. Backported from v3.1.x. --- diff --git a/configure b/configure index 9d6a0808817..c9ab0b53b83 100755 --- a/configure +++ b/configure @@ -8779,6 +8779,21 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + for ac_func in \ + SSL_get_client_random \ + SSL_get_server_random \ + +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + CPPFLAGS="$old_CPPFLAGS" fi @@ -8787,17 +8802,6 @@ fi export OPENSSL_LIBS OPENSSL_LDFLAGS OPENSSL_CPPFLAGS - for ac_func in SSL_get_client_random -do : - ac_fn_c_check_func "$LINENO" "SSL_get_client_random" "ac_cv_func_SSL_get_client_random" -if test "x$ac_cv_func_SSL_get_client_random" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SSL_GET_CLIENT_RANDOM 1 -_ACEOF - SSL_get_server_random -fi -done - fi if test "x$PCAP_LIBS" = x; then diff --git a/configure.ac b/configure.ac index 90c35bd31ad..bd9fc458063 100644 --- a/configure.ac +++ b/configure.ac @@ -1174,6 +1174,13 @@ if test "x$WITH_OPENSSL" = xyes; then AC_MSG_RESULT([cross-compiling (assuming yes)]) ] ) + dnl # + dnl # Check if the new HMAC_CTX interface is defined + dnl # + AC_CHECK_FUNCS( \ + SSL_get_client_random \ + SSL_get_server_random \ + ) CPPFLAGS="$old_CPPFLAGS" fi @@ -1182,7 +1189,6 @@ if test "x$WITH_OPENSSL" = xyes; then AC_SUBST(OPENSSL_LDFLAGS) AC_SUBST(OPENSSL_CPPFLAGS) export OPENSSL_LIBS OPENSSL_LDFLAGS OPENSSL_CPPFLAGS - AC_CHECK_FUNCS(SSL_get_client_random,SSL_get_server_random) fi dnl # diff --git a/src/include/autoconf.h.in b/src/include/autoconf.h.in index a637c68577d..7f528542531 100644 --- a/src/include/autoconf.h.in +++ b/src/include/autoconf.h.in @@ -374,6 +374,9 @@ /* Define to 1 if you have the `SSL_get_client_random' function. */ #undef HAVE_SSL_GET_CLIENT_RANDOM +/* Define to 1 if you have the `SSL_get_server_random' function. */ +#undef HAVE_SSL_GET_SERVER_RANDOM + /* Define to 1 if you have the header file. */ #undef HAVE_STDBOOL_H