]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Make isc_nm_tlssocket unit tests available in non DoH-enabled builds
authorArtem Boldariev <artem@boldariev.com>
Tue, 23 Aug 2022 19:15:54 +0000 (22:15 +0300)
committerArtem Boldariev <artem@boldariev.com>
Tue, 20 Dec 2022 20:13:53 +0000 (22:13 +0200)
This commit ensures that generic TLS unit tests are available in non
DoH-enabled builds, as isc_nm_tlssocket is not tied exclusively to the
DoH implementation anymore.

tests/isc/netmgr_common.c
tests/isc/tls_test.c

index cf3351e21e9e5045e3a421138203c49f221e7a10..cd4e8f28c003c2562893e657ad0b4983a5154c9b 100644 (file)
@@ -560,22 +560,18 @@ tcp_connect(isc_nm_t *nm) {
                          connect_connect_cb, NULL, T_CONNECT);
 }
 
-#if HAVE_LIBNGHTTP2
 static void
 tls_connect(isc_nm_t *nm) {
        isc_nm_tlsconnect(nm, &tcp_connect_addr, &tcp_listen_addr,
                          connect_connect_cb, NULL, tcp_connect_tlsctx,
                          tcp_tlsctx_client_sess_cache, T_CONNECT);
 }
-#endif
 
 stream_connect_function
 get_stream_connect_function(void) {
-#if HAVE_LIBNGHTTP2
        if (stream_use_TLS) {
                return (tls_connect);
        }
-#endif
        return (tcp_connect);
 }
 
@@ -584,7 +580,6 @@ stream_listen(isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
              isc_quota_t *quota, isc_nmsocket_t **sockp) {
        isc_result_t result = ISC_R_SUCCESS;
 
-#if HAVE_LIBNGHTTP2
        if (stream_use_TLS) {
                result = isc_nm_listentls(listen_nm, ISC_NM_LISTEN_ALL,
                                          &tcp_listen_addr, accept_cb,
@@ -592,7 +587,6 @@ stream_listen(isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
                                          tcp_listen_tlsctx, sockp);
                return (result);
        }
-#endif
        result = isc_nm_listentcp(listen_nm, ISC_NM_LISTEN_ALL,
                                  &tcp_listen_addr, accept_cb, accept_cbarg,
                                  backlog, quota, sockp);
@@ -603,7 +597,7 @@ stream_listen(isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
 void
 stream_connect(isc_nm_cb_t cb, void *cbarg, unsigned int timeout) {
        isc_refcount_increment0(&active_cconnects);
-#if HAVE_LIBNGHTTP2
+
        if (stream_use_TLS) {
                isc_nm_tlsconnect(connect_nm, &tcp_connect_addr,
                                  &tcp_listen_addr, cb, cbarg,
@@ -611,7 +605,6 @@ stream_connect(isc_nm_cb_t cb, void *cbarg, unsigned int timeout) {
                                  tcp_tlsctx_client_sess_cache, timeout);
                return;
        }
-#endif
        isc_nm_tcpconnect(connect_nm, &tcp_connect_addr, &tcp_listen_addr, cb,
                          cbarg, timeout);
 }
index e4d7f86ea4f383ed76e318792705ada40a50ea7a..200fc2adfdeee0526c0b17970c2ba336dc105a1b 100644 (file)
@@ -38,7 +38,6 @@
 
 #include <tests/isc.h>
 
-#if HAVE_LIBNGHTTP2
 ISC_LOOP_TEST_IMPL(tls_noop) {
        stream_noop(arg);
        return;
@@ -96,11 +95,9 @@ ISC_LOOP_TEST_IMPL(tls_recv_send_quota_sendback) {
        atomic_store(&check_listener_quota, true);
        stream_recv_send(arg);
 }
-#endif
 
 ISC_TEST_LIST_START
 
-#if HAVE_LIBNGHTTP2
 /* TLS */
 ISC_TEST_ENTRY_CUSTOM(tls_noop, stream_noop_setup, stream_noop_teardown)
 ISC_TEST_ENTRY_CUSTOM(tls_noresponse, stream_noresponse_setup,
@@ -125,7 +122,6 @@ ISC_TEST_ENTRY_CUSTOM(tls_recv_send_quota, stream_recv_send_setup,
                      stream_recv_send_teardown)
 ISC_TEST_ENTRY_CUSTOM(tls_recv_send_quota_sendback, stream_recv_send_setup,
                      stream_recv_send_teardown)
-#endif
 
 ISC_TEST_LIST_END