|
|
9abc64 |
From eee06b7744c4999ec3c7cb0654f97a9b4c79f77f Mon Sep 17 00:00:00 2001
|
|
|
9abc64 |
From: Mark Andrews <marka@isc.org>
|
|
|
9abc64 |
Date: Wed, 25 Mar 2020 17:44:51 +1100
|
|
|
9abc64 |
Subject: [PATCH] Check that a 'BADTIME' response with 'QR=0' is handled as a
|
|
|
9abc64 |
request
|
|
|
9abc64 |
|
|
|
9abc64 |
(cherry picked from commit 67ba3f8f3ab2a748dff1e8a2029fde3bc84ec3f1)
|
|
|
9abc64 |
---
|
|
|
9abc64 |
bin/tests/system/tsig/badtime | 37 ++++++++++++++++++++++++++++++++++
|
|
|
9abc64 |
bin/tests/system/tsig/tests.sh | 9 +++++++++
|
|
|
9abc64 |
2 files changed, 46 insertions(+)
|
|
|
9abc64 |
create mode 100644 bin/tests/system/tsig/badtime
|
|
|
9abc64 |
|
|
|
9abc64 |
diff --git a/bin/tests/system/tsig/badtime b/bin/tests/system/tsig/badtime
|
|
|
9abc64 |
new file mode 100644
|
|
|
9abc64 |
index 0000000000..7926404cfb
|
|
|
9abc64 |
--- /dev/null
|
|
|
9abc64 |
+++ b/bin/tests/system/tsig/badtime
|
|
|
9abc64 |
@@ -0,0 +1,37 @@
|
|
|
9abc64 |
+# Transaction ID
|
|
|
9abc64 |
+1122
|
|
|
9abc64 |
+# Standard query
|
|
|
9abc64 |
+0000
|
|
|
9abc64 |
+# Questions: 1, Additional: 1
|
|
|
9abc64 |
+0001 0000 0000 0001
|
|
|
9abc64 |
+# QNAME: isc.org
|
|
|
9abc64 |
+03 69 73 63 03 6F 72 67 00
|
|
|
9abc64 |
+# Type: A (Host Address)
|
|
|
9abc64 |
+0001
|
|
|
9abc64 |
+# Class: IN
|
|
|
9abc64 |
+0001
|
|
|
9abc64 |
+# Specially crafted TSIG Resource Record
|
|
|
9abc64 |
+# Name: "sha256"
|
|
|
9abc64 |
+06 73 68 61 32 35 36 00
|
|
|
9abc64 |
+# Type: TSIG (Transaction Signature)
|
|
|
9abc64 |
+00fa
|
|
|
9abc64 |
+# Class: ANY
|
|
|
9abc64 |
+00ff
|
|
|
9abc64 |
+# TTL: 0
|
|
|
9abc64 |
+00000000
|
|
|
9abc64 |
+# RdLen: 29
|
|
|
9abc64 |
+001d
|
|
|
9abc64 |
+# Algorithm Name: hmac-sha256
|
|
|
9abc64 |
+0b 68 6D 61 63 2D 73 68 61 32 35 36 00
|
|
|
9abc64 |
+# Time Signed: Jan 1, 1970 01:00:00.000000000 CET
|
|
|
9abc64 |
+00 00 00 00 00 00
|
|
|
9abc64 |
+# Fudge: 300
|
|
|
9abc64 |
+012c
|
|
|
9abc64 |
+# MAC Size: 0; MAC: empty
|
|
|
9abc64 |
+0000
|
|
|
9abc64 |
+# Original ID: 0
|
|
|
9abc64 |
+0000
|
|
|
9abc64 |
+# Error: BADSIG
|
|
|
9abc64 |
+0010
|
|
|
9abc64 |
+# Other Data Length: 0
|
|
|
9abc64 |
+0000
|
|
|
9abc64 |
diff --git a/bin/tests/system/tsig/tests.sh b/bin/tests/system/tsig/tests.sh
|
|
|
9abc64 |
index cade35bc1d..284aea1056 100644
|
|
|
9abc64 |
--- a/bin/tests/system/tsig/tests.sh
|
|
|
9abc64 |
+++ b/bin/tests/system/tsig/tests.sh
|
|
|
9abc64 |
@@ -233,5 +233,14 @@ if [ $ret -eq 1 ] ; then
|
|
|
9abc64 |
echo "I: failed"; status=1
|
|
|
9abc64 |
fi
|
|
|
9abc64 |
|
|
|
9abc64 |
+echo_i "check that a 'BADTIME' response with 'QR=0' is handled as a request"
|
|
|
9abc64 |
+ret=0
|
|
|
9abc64 |
+$PERL ../packet.pl -a 10.53.0.1 -p ${PORT} -t tcp < badtime > /dev/null
|
|
|
9abc64 |
+$DIG -p ${PORT} @10.53.0.1 version.bind txt ch > dig.out.verify || ret=1
|
|
|
9abc64 |
+grep "status: NOERROR" dig.out.verify > /dev/null || ret=1
|
|
|
9abc64 |
+if [ $ret -eq 1 ] ; then
|
|
|
9abc64 |
+ echo_i "failed"; status=1
|
|
|
9abc64 |
+fi
|
|
|
9abc64 |
+
|
|
|
9abc64 |
echo_i "exit status: $status"
|
|
|
9abc64 |
[ $status -eq 0 ] || exit 1
|
|
|
9abc64 |
--
|
|
|
9abc64 |
2.21.1
|
|
|
9abc64 |
|