]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a system test for mixed-case data for the same owner
authorOndřej Surý <ondrej@isc.org>
Sun, 11 Feb 2024 08:13:43 +0000 (09:13 +0100)
committerMichał Kępień <michal@isc.org>
Sun, 11 Feb 2024 10:57:58 +0000 (11:57 +0100)
We were missing a test where a single owner name would have multiple
types with a different case.  The generated RRSIGs and NSEC records will
then have different case than the signed records and message parser have
to cope with that and treat everything as the same owner.

(cherry picked from commit a114042059ecbbc94ae0f604ca681323a75af480)

bin/tests/system/dnssec/ns3/secure.example.db.in
bin/tests/system/dnssec/ns3/sign.sh
bin/tests/system/dnssec/tests.sh

index ec39308e9a478262eeba57ef0249753eaef7c7f3..883e06790bbc8c2696fbdece099160774ce078ce 100644 (file)
@@ -47,3 +47,8 @@ rrsigonly             A       10.0.0.29
 cnameandkey            CNAME   @
 cnamenokey             CNAME   @
 dnameandkey            DNAME   @
+
+mixedcase              A       10.0.0.30
+mixedCASE              TXT     "mixed case"
+MIXEDcase              AAAA    2002::
+mIxEdCaSe              LOC     37 52 56.788 N 121 54 55.02 W 1120m 10m 100m 10m
index 400c5d2cbdcf6b56f06b18e2564cc4e419f0e8d0..278e8dd5a959a17929be226d00bad0845235a5bf 100644 (file)
@@ -87,7 +87,9 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
 
 cat "$infile" "$cnameandkey.key" "$dnameandkey.key" "$keyname.key" >"$zonefile"
 
-"$SIGNER" -P -o "$zone" "$zonefile" >/dev/null
+"$SIGNER" -P -D -o "$zone" "$zonefile" >/dev/null
+cat "$zonefile" "$zonefile".signed >"$zonefile".tmp
+mv "$zonefile".tmp "$zonefile".signed
 
 zone=bogus.example.
 infile=bogus.example.db.in
index 7a2be13b7d4ad74bd37fb78a751243b53c32617d..28d3b6bd719e381e6a5dd8c256498ae48e384fee 100644 (file)
@@ -771,6 +771,21 @@ n=$((n + 1))
 test "$ret" -eq 0 || echo_i "failed"
 status=$((status + ret))
 
+echo_i "checking mixed-case positive validation ($n)"
+ret=0
+for type in a txt aaaa loc; do
+  dig_with_opts +noauth mixedcase.secure.example. \
+    @10.53.0.3 $type >dig.out.$type.ns3.test$n || ret=1
+  dig_with_opts +noauth mixedcase.secure.example. \
+    @10.53.0.4 $type >dig.out.$type.ns4.test$n || ret=1
+  digcomp --lc dig.out.$type.ns3.test$n dig.out.$type.ns4.test$n || ret=1
+  grep "status: NOERROR" dig.out.$type.ns4.test$n >/dev/null || ret=1
+  grep "flags:.*ad.*QUERY" dig.out.$type.ns4.test$n >/dev/null || ret=1
+done
+n=$((n + 1))
+test "$ret" -eq 0 || echo_i "failed"
+status=$((status + ret))
+
 echo_i "checking multi-stage positive validation NSEC/NSEC3 ($n)"
 ret=0
 dig_with_opts +noauth a.nsec3.example. \