]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix configure to detect SSL_CTX_set_ecdh_auto.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 21 Jul 2015 14:30:49 +0000 (14:30 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 21 Jul 2015 14:30:49 +0000 (14:30 +0000)
git-svn-id: file:///svn/unbound/trunk@3453 be551aaa-1e26-0410-a405-d3ace91eadb9

config.h.in
configure
configure.ac
daemon/remote.c
doc/Changelog
testcode/petal.c
util/net_help.c

index 8e231296455adcbb2586b911d52fe20533829d61..7576e15090ccc72e84a1f766e915a5fe184e1131 100644 (file)
    `SSL_COMP_get_compression_methods', and to 0 if you don't. */
 #undef HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
 
+/* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to
+   0 if you don't. */
+#undef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO
+
 /* Define to 1 if you have the declaration of `strlcat', and to 0 if you
    don't. */
 #undef HAVE_DECL_STRLCAT
 /* Define if you have the SSL libraries installed. */
 #undef HAVE_SSL
 
-/* Define to 1 if you have the `SSL_CTX_set_ecdh_auto' function. */
-#undef HAVE_SSL_CTX_SET_ECDH_AUTO
-
 /* Define to 1 if you have the <stdarg.h> header file. */
 #undef HAVE_STDARG_H
 
index 398fa1068b313b548d056091cc4eb255ec6a5a72..03c142257cb864ec97eb8d3436cad73e705ba86f 100755 (executable)
--- a/configure
+++ b/configure
@@ -16773,7 +16773,7 @@ fi
 
 done
 
-for ac_func in OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode SSL_CTX_set_ecdh_auto
+for ac_func in OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode
 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"
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_SK_SSL_COMP_POP_FREE $ac_have_decl
 _ACEOF
+ac_fn_c_check_decl "$LINENO" "SSL_CTX_set_ecdh_auto" "ac_cv_have_decl_SSL_CTX_set_ecdh_auto" "
+$ac_includes_default
+#ifdef HAVE_OPENSSL_ERR_H
+#include <openssl/err.h>
+#endif
+
+#ifdef HAVE_OPENSSL_RAND_H
+#include <openssl/rand.h>
+#endif
+
+#ifdef HAVE_OPENSSL_CONF_H
+#include <openssl/conf.h>
+#endif
+
+#ifdef HAVE_OPENSSL_ENGINE_H
+#include <openssl/engine.h>
+#endif
+#include <openssl/ssl.h>
+#include <openssl/evp.h>
+
+"
+if test "x$ac_cv_have_decl_SSL_CTX_set_ecdh_auto" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SSL_CTX_SET_ECDH_AUTO $ac_have_decl
+_ACEOF
 
 fi
 
index 9c71ac4eab383c4c8b7fe40eeef28f5fdc32f7ab..1b27692f68e04ce7ebedd96fa4d1b22ce39e329b 100644 (file)
@@ -577,8 +577,8 @@ else
 fi
 AC_CHECK_HEADERS([openssl/conf.h],,, [AC_INCLUDES_DEFAULT])
 AC_CHECK_HEADERS([openssl/engine.h],,, [AC_INCLUDES_DEFAULT])
-AC_CHECK_FUNCS([OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode SSL_CTX_set_ecdh_auto])
-AC_CHECK_DECLS([SSL_COMP_get_compression_methods,sk_SSL_COMP_pop_free], [], [], [
+AC_CHECK_FUNCS([OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode])
+AC_CHECK_DECLS([SSL_COMP_get_compression_methods,sk_SSL_COMP_pop_free,SSL_CTX_set_ecdh_auto], [], [], [
 AC_INCLUDES_DEFAULT
 #ifdef HAVE_OPENSSL_ERR_H
 #include <openssl/err.h>
index 6f7888803a03e3ba2fb1e8175b15a76ff2361fbf..fec046f9af6e9311abda5ebc392e12448faccc71 100644 (file)
@@ -258,7 +258,7 @@ daemon_remote_create(struct config_file* cfg)
                log_crypto_err("Error in SSL_CTX check_private_key");
                goto setup_error;
        }
-#ifdef SSL_CTX_SET_ECDH_AUTO
+#ifdef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO
        if(!SSL_CTX_set_ecdh_auto(rc->ctx,1)) {
                log_crypto_err("Error in SSL_CTX_ecdh_auto, not enabling ECDHE");
        }
index 651d7364453589ded7a029fee779e98ca54f8c6b..6c37f0d95b0ee6f6727d042764bfbbae57fcc929 100644 (file)
@@ -1,3 +1,6 @@
+21 July 2015: Wouter
+       - Fix configure to detect SSL_CTX_set_ecdh_auto.
+
 20 July 2015: Wouter
        - Enable ECDHE for servers.  Where available, use
          SSL_CTX_set_ecdh_auto() for TLS-wrapped server configurations to
index 2661c3e4d1ada73867e86601cf49e43e4b518af5..3996cde8a7ee7be3fdac6420bd342d2498a9df9e 100644 (file)
@@ -242,7 +242,7 @@ setup_ctx(char* key, char* cert)
                print_exit("cannot read key");
        if(!SSL_CTX_check_private_key(ctx))
                print_exit("private key is not correct");
-#ifdef SSL_CTX_SET_ECDH_AUTO
+#ifdef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO
        if (!SSL_CTX_set_ecdh_auto(ctx,1))
                if(verb>=1) printf("failed to set_ecdh_auto, not enabling ECDHE\n");
 #elif defined(USE_ECDSA)
index 59b3f91d52c3e1487f2fb8319ce50186e21af66c..b4703366c6e25161ac99f319cc4a3f732c9b52e6 100644 (file)
@@ -647,7 +647,7 @@ void* listen_sslctx_create(char* key, char* pem, char* verifypem)
                SSL_CTX_free(ctx);
                return NULL;
        }
-#ifdef SSL_CTX_SET_ECDH_AUTO
+#ifdef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO
        if(!SSL_CTX_set_ecdh_auto(ctx,1)) {
                log_crypto_err("Error in SSL_CTX_ecdh_auto, not enabling ECDHE");
        }