Permalink
Browse files

Detect newer OpenSSL function names. Fixes #323

* Checks for newer OpenSSL function names when old ones aren't found.
  • Loading branch information...
1 parent 39ee2eb commit 4cae98176bb9df8a1e0ee436785d39aad9b57cd3 @Cizzle Cizzle committed with vanosg Jan 28, 2017
Showing with 67 additions and 11 deletions.
  1. +17 −1 aclocal.m4
  2. +6 −6 config.h.in
  3. +42 −2 configure
  4. +2 −2 src/patch.h
View
@@ -1645,10 +1645,26 @@ AC_DEFUN([EGG_TLS_DETECT],
if test -z "$SSL_LIBS"; then
AC_CHECK_LIB(ssl, SSL_accept, , [havessllib="no"], [-lcrypto])
AC_CHECK_LIB(crypto, X509_digest, , [havessllib="no"], [-lssl])
- AC_CHECK_FUNCS([EVP_md5 EVP_sha1 a2i_IPADDRESS hex_to_string string_to_hex], , [[
+ AC_CHECK_FUNCS([EVP_md5 EVP_sha1 a2i_IPADDRESS], , [[
havessllib="no"
break
]])
+ AC_CHECK_FUNC(hex_to_string, ,
+ AC_CHECK_FUNC(OPENSSL_hexstr2buf,
+ AC_DEFINE([hex_to_string], [OPENSSL_hexstr2buf], [Define this to OPENSSL_hexstr2buf when using OpenSSL 1.1.0+])
+ , [[
+ havessllib="no"
+ break
+ ]])
+ )
+ AC_CHECK_FUNC(string_to_hex, ,
+ AC_CHECK_FUNC(OPENSSL_buf2hexstr,
+ AC_DEFINE([string_to_hex], [OPENSSL_buf2hexstr], [Define this to OPENSSL_buf2hexstr when using OpenSSL 1.1.0+])
+ , [[
+ havessllib="no"
+ break
+ ]])
+ )
fi
if test "$enable_tls" = "yes"; then
if test "$havesslinc" = "no"; then
View
@@ -111,9 +111,6 @@
/* Define to 1 if you have the `getrusage' function. */
#undef HAVE_GETRUSAGE
-/* Define to 1 if you have the `hex_to_string' function. */
-#undef HAVE_HEX_TO_STRING
-
/* Define to 1 if you have the in6addr_any constant. */
#undef HAVE_IN6ADDR_ANY
@@ -294,9 +291,6 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
-/* Define to 1 if you have the `string_to_hex' function. */
-#undef HAVE_STRING_TO_HEX
-
/* Define to 1 if you have the `strncasecmp' function. */
#undef HAVE_STRNCASECMP
@@ -494,6 +488,9 @@
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
+/* Define this to OPENSSL_hexstr2buf when using OpenSSL 1.1.0+ */
+#undef hex_to_string
+
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
@@ -510,6 +507,9 @@
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
+/* Define this to OPENSSL_buf2hexstr when using OpenSSL 1.1.0+ */
+#undef string_to_hex
+
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
#undef volatile
View
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac 96f3dda.
+# From configure.ac 2483ce3c.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for Eggdrop 1.8.0.
#
@@ -8716,7 +8716,7 @@ else
havessllib="no"
fi
- for ac_func in EVP_md5 EVP_sha1 a2i_IPADDRESS hex_to_string string_to_hex
+ for ac_func in EVP_md5 EVP_sha1 a2i_IPADDRESS
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"
@@ -8733,6 +8733,46 @@ else
fi
done
+ ac_fn_c_check_func "$LINENO" "hex_to_string" "ac_cv_func_hex_to_string"
+if test "x$ac_cv_func_hex_to_string" = xyes; then :
+
+else
+ ac_fn_c_check_func "$LINENO" "OPENSSL_hexstr2buf" "ac_cv_func_OPENSSL_hexstr2buf"
+if test "x$ac_cv_func_OPENSSL_hexstr2buf" = xyes; then :
+
+$as_echo "#define hex_to_string OPENSSL_hexstr2buf" >>confdefs.h
+
+
+else
+
+ havessllib="no"
+ break
+
+fi
+
+
+fi
+
+ ac_fn_c_check_func "$LINENO" "string_to_hex" "ac_cv_func_string_to_hex"
+if test "x$ac_cv_func_string_to_hex" = xyes; then :
+
+else
+ ac_fn_c_check_func "$LINENO" "OPENSSL_buf2hexstr" "ac_cv_func_OPENSSL_buf2hexstr"
+if test "x$ac_cv_func_OPENSSL_buf2hexstr" = xyes; then :
+
+$as_echo "#define string_to_hex OPENSSL_buf2hexstr" >>confdefs.h
+
+
+else
+
+ havessllib="no"
+ break
+
+fi
+
+
+fi
+
fi
if test "$enable_tls" = "yes"; then
if test "$havesslinc" = "no"; then
View
@@ -39,12 +39,12 @@ patch("Git"); /* Git version */
*
*
*/
-patch("1485483674"); /* current unixtime */
+patch("1485620062"); /* current unixtime */
/*
*
*
*/
-patch("timerdrift");
+patch("detectssl");
/*
*
*

0 comments on commit 4cae981

Please sign in to comment.