]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
test require-server-cookie with rate-limit
authorMark Andrews <marka@isc.org>
Mon, 5 Nov 2018 04:55:19 +0000 (15:55 +1100)
committerMark Andrews <marka@isc.org>
Mon, 5 Nov 2018 23:10:04 +0000 (10:10 +1100)
bin/tests/system/cookie/ns8/example.db [new file with mode: 0644]
bin/tests/system/cookie/ns8/named.conf.in [new file with mode: 0644]
bin/tests/system/cookie/setup.sh
bin/tests/system/cookie/tests.sh
util/copyrights

diff --git a/bin/tests/system/cookie/ns8/example.db b/bin/tests/system/cookie/ns8/example.db
new file mode 100644 (file)
index 0000000..0693de0
--- /dev/null
@@ -0,0 +1,11 @@
+; 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 http://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+@      3600    SOA     . . 0 0 0 0 0
+@      3600    NS      .
diff --git a/bin/tests/system/cookie/ns8/named.conf.in b/bin/tests/system/cookie/ns8/named.conf.in
new file mode 100644 (file)
index 0000000..36bc29d
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * 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 http://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+key rndc_key {
+       secret "1234abcd8765";
+       algorithm hmac-sha256;
+};
+
+controls {
+       inet 10.53.0.8 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
+};
+
+options {
+       query-source address 10.53.0.8;
+       notify-source 10.53.0.8;
+       transfer-source 10.53.0.8;
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.8; };
+       listen-on-v6 { none; };
+       dnssec-validation yes;
+       rate-limit {};
+       require-server-cookie yes;
+};
+
+zone "example" {
+       type master;
+       file "example.db";
+};
index fa6de38c00d1b40fd5a0a21fe41d003cdfca7cfa..7929f095450f8d722a415b3a86ca3ce5aaa8a877 100644 (file)
@@ -20,3 +20,4 @@ copy_setports ns4/named.conf.in ns4/named.conf
 copy_setports ns5/named.conf.in ns5/named.conf
 copy_setports ns6/named.conf.in ns6/named.conf
 copy_setports ns7/named.conf.in ns7/named.conf
+copy_setports ns8/named.conf.in ns8/named.conf
index 816f6a312b5996a9050f21052fa76c4bc3ef0fb1..7708a59ce853dae76df949354ca99290d8cb4244 100755 (executable)
@@ -169,6 +169,17 @@ if [ $linecount != 2 ]; then ret=1; fi
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo_i "checking require-server-cookie yes with rate-limit ($n)"
+ret=0
+$DIG $DIGOPTS +qr +cookie +nobadcookie soa example @10.53.0.8 > dig.out.test$n
+grep "flags: qr[^;]* ad[ ;]" dig.out.test$n > /dev/null && ret=1
+grep BADCOOKIE dig.out.test$n > /dev/null || ret=1
+linecount=`getcookie dig.out.test$n | wc -l`
+if [ $linecount != 2 ]; then ret=1; fi
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
 #
 # Test shared cookie-secret support.
 #
index 6f4b833408f2085fd97680c4bee65e0c8a6b3d2d..ee921366886529d35750d3230c5393673ff8eaa7 100644 (file)
 ./bin/tests/system/cookie/ns6/root.hint                ZONE    2017,2018
 ./bin/tests/system/cookie/ns7/named.conf.in    CONF-C  2018
 ./bin/tests/system/cookie/ns7/root.db          ZONE    2018
+./bin/tests/system/cookie/ns8/example.db       ZONE    2018
+./bin/tests/system/cookie/ns8/named.conf.in    CONF-C  2018
 ./bin/tests/system/cookie/setup.sh             SH      2018
 ./bin/tests/system/cookie/tests.sh             SH      2014,2015,2016,2017,2018
 ./bin/tests/system/coverage/01-ksk-inactive/README     X       2013,2018