]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix SSL_get_client/server_random checks
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Fri, 18 Nov 2016 18:08:33 +0000 (20:08 +0200)
committerNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Wed, 7 Dec 2016 12:03:04 +0000 (14:03 +0200)
Needed for conditionally avoiding accessing private OpenSSL structures
in a following patch.

Backported from v3.1.x.

configure
configure.ac
src/include/autoconf.h.in

index 9d6a08088171b79528b698e0e3fa2ad279915bec..c9ab0b53b8377f3bc42f96191ea6943264b68e99 100755 (executable)
--- 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
index 90c35bd31ada09d6a56973610819398887eb20e5..bd9fc4580639bc1d9a33af028544f0955b027b8d 100644 (file)
@@ -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 #
index a637c68577d765fa07c8ae75b323646c56c48483..7f528542531a43dce336f1e8cf6dca4cd8a40116 100644 (file)
 /* 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 <stdbool.h> header file. */
 #undef HAVE_STDBOOL_H