]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check that a 'BADTIME' response with 'QR=0' is handled as a request
authorMark Andrews <marka@isc.org>
Wed, 25 Mar 2020 06:44:51 +0000 (17:44 +1100)
committerMichał Kępień <michal@isc.org>
Tue, 5 May 2020 21:48:47 +0000 (23:48 +0200)
bin/tests/system/tsig/badtime [new file with mode: 0644]
bin/tests/system/tsig/tests.sh
util/copyrights

diff --git a/bin/tests/system/tsig/badtime b/bin/tests/system/tsig/badtime
new file mode 100644 (file)
index 0000000..7926404
--- /dev/null
@@ -0,0 +1,37 @@
+# Transaction ID
+1122
+# Standard query
+0000
+# Questions: 1, Additional: 1
+0001 0000 0000 0001
+# QNAME: isc.org
+03 69 73 63 03 6F 72 67 00
+# Type: A (Host Address)
+0001
+# Class: IN
+0001
+# Specially crafted TSIG Resource Record
+# Name: "sha256"
+06 73 68 61 32 35 36 00
+# Type: TSIG (Transaction Signature)
+00fa
+# Class: ANY
+00ff
+# TTL: 0
+00000000
+# RdLen: 29
+001d
+# Algorithm Name: hmac-sha256
+0b 68 6D 61 63 2D 73 68 61 32 35 36 00
+# Time Signed: Jan 1, 1970 01:00:00.000000000 CET
+00 00 00 00 00 00
+# Fudge: 300
+012c
+# MAC Size: 0; MAC: empty
+0000
+# Original ID: 0
+0000
+# Error: BADSIG
+0010
+# Other Data Length: 0
+0000
index f731fa604cbf8d3fdc885da3da148167785745be..c54391f0658b30b9c4a20d49d07da2b4ff62b61c 100644 (file)
@@ -218,5 +218,14 @@ if [ $ret -eq 1 ] ; then
        echo "I: failed"; status=1
 fi
 
+echo_i "check that a 'BADTIME' response with 'QR=0' is handled as a request"
+ret=0
+$PERL ../packet.pl -a 10.53.0.1 -p ${PORT} -t tcp < badtime > /dev/null
+$DIG -p ${PORT} @10.53.0.1 version.bind txt ch > dig.out.verify || ret=1
+grep "status: NOERROR" dig.out.verify > /dev/null || ret=1
+if [ $ret -eq 1 ] ; then
+    echo_i "failed"; status=1
+fi
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1
index aa8dae1289eaf901f1b3c4ec45763d76eb6f4605..918f4f2981f955086f2a567f9e4924b72d51f526 100644 (file)
 ./bin/tests/system/tkey/prereq.sh              SH      2001,2004,2006,2007,2009,2012,2014,2016,2018,2019,2020
 ./bin/tests/system/tkey/setup.sh               SH      2001,2004,2007,2009,2012,2013,2014,2016,2018,2019,2020
 ./bin/tests/system/tkey/tests.sh               SH      2001,2004,2007,2009,2011,2012,2013,2014,2016,2018,2019,2020
+./bin/tests/system/tsig/badtime                        X       2020
 ./bin/tests/system/tsig/clean.sh               SH      2005,2006,2007,2012,2014,2016,2018,2019,2020
 ./bin/tests/system/tsig/ns1/example.db         ZONE    2005,2006,2007,2009,2012,2016,2018,2019,2020
 ./bin/tests/system/tsig/ns1/named.conf.in      CONF-C  2018,2019,2020