]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Require "dot" ALPN token for incoming xfrs over XoT
authorArtem Boldariev <artem@boldariev.com>
Mon, 30 Aug 2021 14:13:00 +0000 (17:13 +0300)
committerArtem Boldariev <artem@boldariev.com>
Tue, 5 Oct 2021 08:23:47 +0000 (11:23 +0300)
This commit make the code handling incoming zone transfers to verify
if they are allowed to be done over the underlying connections. As a
result the check ensures that the "dot" ALPN token has been negotiated
over the underlying connection.

lib/dns/xfrin.c

index 0dc308839704a850f2bb95c7c22bb923f78a6817..4ebc09e67ca30394cbc19c26ef6b11a470ae1e9b 100644 (file)
@@ -947,6 +947,7 @@ xfrin_start(dns_xfrin_ctx_t *xfr) {
                break;
        case DNS_TRANSPORT_TLS:
                CHECK(isc_tlsctx_createclient(&xfr->tlsctx));
+               isc_tlsctx_enable_dot_client_alpn(xfr->tlsctx);
                isc_nm_tlsdnsconnect(xfr->netmgr, &xfr->sourceaddr,
                                     &xfr->masteraddr, xfrin_connect_done,
                                     connect_xfr, 30000, 0, xfr->tlsctx);
@@ -1018,6 +1019,10 @@ xfrin_connect_done(isc_nmhandle_t *handle, isc_result_t result, void *cbarg) {
 
        CHECK(result);
 
+       if (!isc_nm_xfr_allowed(handle)) {
+               goto failure;
+       }
+
        zmgr = dns_zone_getmgr(xfr->zone);
        if (zmgr != NULL) {
                if (result != ISC_R_SUCCESS) {