# it will just work!
fi
+ if $found; then
+ AC_DEFINE([HAVE_LIBCRYPTO], [1], [Define to 1 if you have OpenSSL libcrypto])
+ fi
+
# try the preprocessor and linker with our new flags,
# being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
AC_SUBST([LIBCRYPTO_INCLUDES])
AC_SUBST([LIBCRYPTO_LIBS])
AC_SUBST([LIBCRYPTO_LDFLAGS])
+ AM_CONDITIONAL([HAVE_LIBCRYPTO], [test "x$LIBCRYPTO_LIBS" != "x"])
])
#include <sys/stat.h>
#include <sys/types.h>
+#include "config.h"
#include "dnsdist.hh"
#include "dnsdist-lua.hh"
#include "dnsdist-protobuf.hh"
#include "dolog.hh"
#include "fstrm_logger.hh"
#include "remote_logger.hh"
+
+#ifdef HAVE_LIBCRYPTO
#include "ipcipher.hh"
+#endif /* HAVE_LIBCRYPTO */
void setupLuaBindings(bool client)
{
g_lua.registerFunction<ComboAddress(ComboAddress::*)()>("mapToIPv4", [](const ComboAddress& ca) { return ca.mapToIPv4(); });
g_lua.registerFunction<bool(nmts_t::*)(const ComboAddress&)>("match", [](nmts_t& s, const ComboAddress& ca) { return s.match(ca); });
+#ifdef HAVE_LIBCRYPTO
g_lua.registerFunction<ComboAddress(ComboAddress::*)(const std::string& key)>("ipencrypt", [](const ComboAddress& ca, const std::string& key) {
return encryptCA(ca, key);
});
g_lua.writeFunction("makeIPCipherKey", [](const std::string& password) {
return makeIPCipherKey(password);
});
+#endif /* HAVE_LIBCRYPTO */
/* DNSName */
g_lua.registerFunction("isPartOf", &DNSName::isPartOf);
#ifdef HAVE_FSTRM
cout<<"fstrm ";
#endif
+#ifdef HAVE_LIBCRYPTO
+ cout<<"ipcipher ";
+#endif
#ifdef HAVE_LIBSODIUM
cout<<"libsodium ";
#endif
dnsdist_LDADD += $(RE2_LIBS)
endif
+if HAVE_LIBCRYPTO
+dnsdist_LDADD += $(LIBCRYPTO_LIBS)
+dnsdist_SOURCES += ipcipher.cc ipcipher.hh ext/ipcrypt/ipcrypt.c ext/ipcrypt/ipcrypt.h
+endif
+
+if HAVE_DNS_OVER_TLS
if HAVE_GNUTLS
dnsdist_LDADD += -lgnutls
endif
if HAVE_LIBSSL
-dnsdist_LDADD += $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS)
-dnsdist_SOURCES += ipcipher.cc ipcipher.hh ext/ipcrypt/ipcrypt.c ext/ipcrypt/ipcrypt.h
+dnsdist_LDADD += $(LIBSSL_LIBS)
+endif
endif
if !HAVE_LUA_HPP
AS_IF([test "x$enable_dns_over_tls" != "xno"], [
DNSDIST_WITH_GNUTLS
DNSDIST_WITH_LIBSSL
- AS_IF([test "$HAVE_LIBSSL" = "1"], [
- # we need libcrypto if libssl is enabled
-
- ])
AS_IF([test "$HAVE_GNUTLS" = "0" -a "$HAVE_LIBSSL" = "0"], [
AC_MSG_ERROR([DNS over TLS support requested but neither GnuTLS nor OpenSSL are available])
])
[AC_MSG_NOTICE([systemd: yes])],
[AC_MSG_NOTICE([systemd: no])]
)
+AS_IF([test "x$LIBCRYPTO_LIBS" != "x"],
+ [AC_MSG_NOTICE([ipcipher: yes])],
+ [AC_MSG_NOTICE([ipcipher: no])]
+)
AS_IF([test "x$LIBSODIUM_LIBS" != "x"],
[AC_MSG_NOTICE([libsodium: yes])],
[AC_MSG_NOTICE([libsodium: no])]