]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Checking invalid TSIG key name in a catalog zone
authorMark Andrews <marka@isc.org>
Fri, 10 Apr 2026 03:05:31 +0000 (13:05 +1000)
committerMark Andrews <marka@isc.org>
Tue, 14 Apr 2026 23:00:26 +0000 (09:00 +1000)
bin/tests/system/catz/ns1/catalog-bad6.example.db [new file with mode: 0644]
bin/tests/system/catz/ns1/named.conf.j2
bin/tests/system/catz/ns2/named.conf.j2
bin/tests/system/catz/tests.sh

diff --git a/bin/tests/system/catz/ns1/catalog-bad6.example.db b/bin/tests/system/catz/ns1/catalog-bad6.example.db
new file mode 100644 (file)
index 0000000..bc5ca70
--- /dev/null
@@ -0,0 +1,7 @@
+@ 3600 SOA . . 1 86400 3600 86400 3600
+@ 3600 IN NS invalid.
+version IN TXT "2"
+deadbeef.zones IN PTR member.example.
+mykey.primaries.ext.deadbeef.zones IN A 192.0.2.1
+; bad key name label too big
+mykey.primaries.ext.deadbeef.zones IN TXT "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.example.com"
index 146aa5b1125c4d832d74e7c82f4b4989e7adc684..703060d596da39f95cf03bc94cca08524da918db 100644 (file)
@@ -115,6 +115,16 @@ view "default" {
                notify explicit;
        };
 
+       # Bad TSIG key name
+       zone "catalog-bad6.example" {
+               type primary;
+               file "catalog-bad6.example.db";
+               allow-transfer { any; };
+               allow-update { any; };
+               also-notify { 10.53.0.2; };
+               notify explicit;
+       };
+
        # A catalog zone that requires TLS to be used
        zone "catalog-tls.example" {
                type primary;
index be0d052fccb07be3d9983cb85ea50fe15f4a44f2..4f354d2bb93322d11f593460d46cc8aaa28c132e 100644 (file)
@@ -88,6 +88,10 @@ view "default" {
                        default-masters { 10.53.0.1; }
                        min-update-interval 1s
                        in-memory yes;
+               zone "catalog-bad6.example"
+                       default-masters { 10.53.0.1; }
+                       min-update-interval 1s
+                       in-memory yes;
        };
 
 {% if bad_dlz %}
@@ -193,6 +197,12 @@ view "default" {
                primaries { 10.53.0.1; };
        };
 
+       # Bad TSIG key name
+       zone "catalog-bad6.example" {
+               type secondary;
+               file "catalog-bad6.example.db";
+               primaries { 10.53.0.1; };
+       };
 };
 
 key tsig_key. {
index 0e964d457f74fd2de19d3149c003f819f39e16b9..e90b606d82c1a23a1b425bcdff0d424455545432 100644 (file)
@@ -116,6 +116,12 @@ wait_for_message ns2/named.run "catz: invalid record in catalog zone - version.c
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
+echo_i "checking that catalog-bad6.example (invalid TSIG key name) is handled ($n)"
+ret=0
+wait_for_message ns2/named.run "catz: invalid record in catalog zone - mykey.primaries.ext.deadbeef.zones.catalog-bad6.example IN TXT (label too long) - ignoring" || ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
 nextpart ns2/named.run >/dev/null
 
 ##########################################################################