From: Remi Gacogne Date: Wed, 9 Jun 2021 15:23:17 +0000 (+0200) Subject: dnsdist: Fix compilation of the TCPIOHandler w/ old GnuTLS versions X-Git-Tag: dnsdist-1.7.0-alpha1~45^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=912014da56fe2e0920ee25479a2000fcdcfecec0;p=thirdparty%2Fpdns.git dnsdist: Fix compilation of the TCPIOHandler w/ old GnuTLS versions --- diff --git a/m4/pdns_with_gnutls.m4 b/m4/pdns_with_gnutls.m4 index 425dce472e..c693dff81f 100644 --- a/m4/pdns_with_gnutls.m4 +++ b/m4/pdns_with_gnutls.m4 @@ -18,7 +18,7 @@ AC_DEFUN([PDNS_WITH_GNUTLS], [ save_LIBS=$LIBS CFLAGS="$GNUTLS_CFLAGS $CFLAGS" LIBS="$GNUTLS_LIBS $LIBS" - AC_CHECK_FUNCS([gnutls_memset gnutls_session_set_verify_cert]) + AC_CHECK_FUNCS([gnutls_memset gnutls_session_set_verify_cert gnutls_session_get_verify_cert_status]) CFLAGS=$save_CFLAGS LIBS=$save_LIBS diff --git a/pdns/tcpiohandler.cc b/pdns/tcpiohandler.cc index c4a07587b6..ae8fbbbb50 100644 --- a/pdns/tcpiohandler.cc +++ b/pdns/tcpiohandler.cc @@ -937,6 +937,7 @@ public: else if (gnutls_error_is_fatal(ret) || ret == GNUTLS_E_WARNING_ALERT_RECEIVED) { if (d_client) { std::string error; +#if HAVE_GNUTLS_SESSION_GET_VERIFY_CERT_STATUS if (ret == GNUTLS_E_CERTIFICATE_VERIFICATION_ERROR) { gnutls_datum_t out; if (gnutls_certificate_verification_status_print(gnutls_session_get_verify_cert_status(d_conn.get()), gnutls_certificate_type_get(d_conn.get()), &out, 0) == 0) { @@ -944,6 +945,7 @@ public: gnutls_free(out.data); } } +#endif /* HAVE_GNUTLS_SESSION_GET_VERIFY_CERT_STATUS */ throw std::runtime_error("Error accepting a new connection: " + std::string(gnutls_strerror(ret)) + error); } else {