]> 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>
Wed, 15 Apr 2026 06:52:48 +0000 (16:52 +1000)
(cherry picked from commit 213e59ccf56f4d66cf65f363be4563f2e853d12f)

bin/tests/system/catz/clean.sh
bin/tests/system/catz/ns1/catalog-bad6.example.db [new file with mode: 0644]
bin/tests/system/catz/ns1/named.conf.in
bin/tests/system/catz/ns2/named.conf.in
bin/tests/system/catz/tests.sh

index 3a78760f2b6d5190cfda7cc4c9eeddab685adb0a..803763920716c6c03f42171e9dc4b05782ebda79 100644 (file)
@@ -17,6 +17,7 @@ rm -f ns*/named.run
 rm -f ns*/named.run.prev
 rm -f ns1/*dom*example.db
 rm -f ns2/__catz__*db
+rm -f ns2/catalog-bad6.example.db
 rm -f ns2/named.conf.tmp
 rm -f ns3/dom13.example.db ns3/dom14.example.db
 rm -f nsupdate.out.*
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..da17105
--- /dev/null
@@ -0,0 +1,16 @@
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0. If a copy of the MPL was not distributed with this
+; file, you can obtain one at https://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+@ 3600 SOA . . 1 86400 3600 86400 3600
+@ 3600 IN NS invalid.
+version IN TXT "1"
+deadbeef.zones IN PTR member.example.
+mykey.masters.deadbeef.zones IN A 192.0.2.1
+; bad key name label too big
+mykey.masters.deadbeef.zones IN TXT "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.example.com"
index 6856ec702872e8940c13130f574eaca7d0519b9b..8892230e9564053419e83bf99b2be97c574c4f02 100644 (file)
@@ -59,6 +59,16 @@ zone "catalog4.example" {
 
 /* catalog5 is missing on purpose */
 
+# Bad TSIG key name
+zone "catalog-bad6.example" {
+       type master;
+       file "catalog-bad6.example.db";
+       allow-transfer { any; };
+       allow-update { any; };
+       also-notify { 10.53.0.2; };
+       notify explicit;
+};
+
 key tsig_key. {
        secret "LSAnCU+Z";
        algorithm hmac-md5;
index dd3a9dc87102493c4d17da22a9b93b4eb763822f..59eef9e4cd94abda255dedaf92045f1bd58a1cd3 100644 (file)
@@ -41,6 +41,8 @@ options {
 #T1                    default-masters { 10.53.0.1; };
 #T2            zone "catalog5.example"
 #T2                    default-masters { 10.53.0.1; };
+               zone "catalog-bad6.example"
+                       default-masters { 10.53.0.1; };
        };
 };
 
@@ -68,6 +70,13 @@ zone "catalog4.example" {
        masters { 10.53.0.1; };
 };
 
+# Bad TSIG key name
+zone "catalog-bad6.example" {
+       type slave;
+       file "catalog-bad6.example.db";
+       masters { 10.53.0.1; };
+};
+
 key tsig_key. {
        secret "LSAnCU+Z";
        algorithm hmac-md5;
index a628ba6518632811eade7ed00b7bfda34b4b75b8..0152c90df542930d6bcbc9e7cc73da3162f96ba4 100644 (file)
@@ -77,6 +77,17 @@ wait_for_no_zonefile() (
 
 status=0
 n=0
+
+##########################################################################
+
+echo_i "checking that catalog-bad6.example (invalid TSIG key name) is handled ($n)"
+ret=0
+wait_for_message ns2/named.run "catz: unknown record in catalog zone - mykey.masters.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
+
 ##########################################################################
 echo_i "Testing adding/removing of domain in catalog zone"
 n=`expr $n + 1`