]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3040. [bug] Named failed to validate insecure zones where a node
authorMark Andrews <marka@isc.org>
Wed, 23 Feb 2011 11:30:35 +0000 (11:30 +0000)
committerMark Andrews <marka@isc.org>
Wed, 23 Feb 2011 11:30:35 +0000 (11:30 +0000)
                        with a CNAME existed between the trust anchor and the
                        top of the zone. [RT #23338]

CHANGES
bin/tests/system/dnssec/clean.sh
bin/tests/system/dnssec/ns2/example.db.in
bin/tests/system/dnssec/ns2/sign.sh
bin/tests/system/dnssec/ns3/insecure.below-cname.example.db [new file with mode: 0644]
bin/tests/system/dnssec/ns3/named.conf
bin/tests/system/dnssec/ns3/secure.below-cname.example.db.in [new file with mode: 0644]
bin/tests/system/dnssec/ns3/sign.sh
bin/tests/system/dnssec/tests.sh

diff --git a/CHANGES b/CHANGES
index 6c362c0d56151d44f963fa3b7e570698310584f4..95277c2d779d1748447deb03838343cd67f5f88a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+3040.  [bug]           Named failed to validate insecure zones where a node
+                       with a CNAME existed between the trust anchor and the
+                       top of the zone. [RT #23338]
+
 3039.  [func]          Redirect on NXDOMAIN support. [RT #23146]
 
 3038.  [bug]           Install <dns/rpz.h>.  [RT #23342]
index e66a71bed5a54291b111f56a2111af26f7f1d7e3..46067813223a1b942cd7ae03500d10b4380ce577 100644 (file)
@@ -15,7 +15,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: clean.sh,v 1.34 2011/02/14 23:53:43 marka Exp $
+# $Id: clean.sh,v 1.35 2011/02/23 11:30:34 marka Exp $
 
 rm -f */K* */keyset-* */dsset-* */dlvset-* */signedkey-* */*.signed
 rm -f */trusted.conf */managed.conf */tmp* */*.jnl */*.bk
@@ -47,3 +47,6 @@ rm -f signer/example.db
 rm -f ns2/algroll.db
 rm -f ns3/kskonly.example.db
 rm -f ns4/named.conf
+rm -f ns3/auto-nsec.example.db ns3/auto-nsec3.example.db
+rm -f ns3/secure.below-cname.example.db
+
index 4b3c137dcb12cbd2cda2577771bf547e3736daf5..50b39de0ba2c6cfa3512faab61ebc5cd36de06cc 100644 (file)
@@ -13,7 +13,7 @@
 ; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 ; PERFORMANCE OF THIS SOFTWARE.
 
-; $Id: example.db.in,v 1.27 2011/02/15 23:47:35 tbox Exp $
+; $Id: example.db.in,v 1.28 2011/02/23 11:30:35 marka Exp $
 
 $TTL 300       ; 5 minutes
 @                      IN SOA  mname1. . (
@@ -116,3 +116,12 @@ ns.auto-nsec               A       10.53.0.3
 
 auto-nsec3             NS      ns.auto-nsec3
 ns.auto-nsec3          A       10.53.0.3
+
+
+below-cname            CNAME   some.where.else.
+
+insecure.below-cname   NS      ns.insecure.below-cname
+ns.insecure.below-cname        A       10.53.0.3
+
+secure.below-cname     NS      ns.secure.below-cname
+ns.secure.below-cname  A       10.53.0.3
index 7b12749a55a6d45ac9e874a7c09b9c772bd3236b..855e3e106233b614105f020b16c7bcf5c366ea71 100644 (file)
@@ -15,7 +15,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: sign.sh,v 1.44 2011/02/15 23:47:35 tbox Exp $
+# $Id: sign.sh,v 1.45 2011/02/23 11:30:35 marka Exp $
 
 SYSTEMTESTTOP=../..
 . $SYSTEMTESTTOP/conf.sh
@@ -32,7 +32,7 @@ zonefile=example.db
 
 for subdomain in secure bogus dynamic keyless nsec3 optout nsec3-unknown \
     optout-unknown multiple rsasha256 rsasha512 kskonly update-nsec3 \
-    auto-nsec auto-nsec3 
+    auto-nsec auto-nsec3 secure.below-cname
 do
        cp ../ns3/dsset-$subdomain.example. .
 done
diff --git a/bin/tests/system/dnssec/ns3/insecure.below-cname.example.db b/bin/tests/system/dnssec/ns3/insecure.below-cname.example.db
new file mode 100644 (file)
index 0000000..6879923
--- /dev/null
@@ -0,0 +1,32 @@
+; Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
+; Copyright (C) 2000, 2001  Internet Software Consortium.
+;
+; Permission to use, copy, modify, and/or distribute this software for any
+; purpose with or without fee is hereby granted, provided that the above
+; copyright notice and this permission notice appear in all copies.
+;
+; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+; AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+; PERFORMANCE OF THIS SOFTWARE.
+
+; $Id: insecure.below-cname.example.db,v 1.2 2011/02/23 11:30:35 marka Exp $
+
+$TTL 300       ; 5 minutes
+@                      IN SOA  mname1. . (
+                               2000042407 ; serial
+                               20         ; refresh (20 seconds)
+                               20         ; retry (20 seconds)
+                               1814400    ; expire (3 weeks)
+                               3600       ; minimum (1 hour)
+                               )
+                       NS      ns
+ns                     A       10.53.0.3
+
+a                      A       10.0.0.1
+b                      A       10.0.0.2
+d                      A       10.0.0.4
+z                      A       10.0.0.26
index f3bb617e05a03e6220a535cefb166dbfbc790902..5cc605baa61f2bf5f1495e83ec08ffe1b5610909 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: named.conf,v 1.42 2011/02/15 22:02:36 marka Exp $ */
+/* $Id: named.conf,v 1.43 2011/02/23 11:30:35 marka Exp $ */
 
 // NS3
 
@@ -192,4 +192,14 @@ zone "auto-nsec3.example" {
        file "auto-nsec3.example.db.signed";
 };
 
+zone "insecure.below-cname.example" {
+       type master;
+       file "insecure.below-cname.example.db";
+};
+
+zone "secure.below-cname.example" {
+       type master;
+       file "secure.below-cname.example.db.signed";
+};
+
 include "trusted.conf";
diff --git a/bin/tests/system/dnssec/ns3/secure.below-cname.example.db.in b/bin/tests/system/dnssec/ns3/secure.below-cname.example.db.in
new file mode 100644 (file)
index 0000000..4b487d8
--- /dev/null
@@ -0,0 +1,32 @@
+; Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
+; Copyright (C) 2000, 2001  Internet Software Consortium.
+;
+; Permission to use, copy, modify, and/or distribute this software for any
+; purpose with or without fee is hereby granted, provided that the above
+; copyright notice and this permission notice appear in all copies.
+;
+; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+; AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+; PERFORMANCE OF THIS SOFTWARE.
+
+; $Id: secure.below-cname.example.db.in,v 1.2 2011/02/23 11:30:35 marka Exp $
+
+$TTL 300       ; 5 minutes
+@                      IN SOA  mname1. . (
+                               2000042407 ; serial
+                               20         ; refresh (20 seconds)
+                               20         ; retry (20 seconds)
+                               1814400    ; expire (3 weeks)
+                               3600       ; minimum (1 hour)
+                               )
+                       NS      ns
+ns                     A       10.53.0.3
+
+a                      A       10.0.0.1
+b                      A       10.0.0.2
+d                      A       10.0.0.4
+z                      A       10.0.0.26
index e820f23e861b8a4933b129728a991e02face272b..8d9a8a709db926323e5bfc812a5b0c4307511499 100644 (file)
@@ -15,7 +15,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: sign.sh,v 1.36 2011/02/15 22:02:36 marka Exp $
+# $Id: sign.sh,v 1.37 2011/02/23 11:30:35 marka Exp $
 
 SYSTEMTESTTOP=../..
 . $SYSTEMTESTTOP/conf.sh
@@ -315,3 +315,13 @@ kskname=`$KEYGEN -q -3 -r $RANDFILE -fk $zone`
 zskname=`$KEYGEN -q -3 -r $RANDFILE $zone`
 cat $infile $kskname.key $zskname.key >$zonefile
 $SIGNER -P -3 - -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
+
+#
+# Secure below cname test zone.
+#
+zone=secure.below-cname.example.
+infile=secure.below-cname.example.db.in
+zonefile=secure.below-cname.example.db
+keyname=`$KEYGEN -q -r $RANDFILE -a RSASHA1 -b 1024 -n zone $zone`
+cat $infile $keyname.key >$zonefile
+$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
index 4dc452d2a5e920e83d158155ef560ee129e29698..cb2a9143a823509870d854752ff4633c122aaae0 100644 (file)
@@ -15,7 +15,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.76 2011/02/15 22:02:36 marka Exp $
+# $Id: tests.sh,v 1.77 2011/02/23 11:30:35 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -1155,5 +1155,24 @@ n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+echo "I:checking that a insecure zone beneath a cname resolves ($n)"
+ret=0
+$DIG $DIGOPTS soa insecure.below-cname.example. @10.53.0.4 > dig.out.ns4.test$n || ret=1
+grep "NOERROR" dig.out.ns4.test$n > /dev/null || ret=1
+grep "ANSWER: 1," dig.out.ns4.test$n > /dev/null || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
+echo "I:checking that a secure zone beneath a cname resolves ($n)"
+ret=0
+$DIG $DIGOPTS soa secure.below-cname.example. @10.53.0.4 > dig.out.ns4.test$n || ret=1
+grep "NOERROR" dig.out.ns4.test$n > /dev/null || ret=1
+grep "ANSWER: 2," dig.out.ns4.test$n > /dev/null || ret=1
+grep "flags:.* ad[ ;]" dig.out.ns4.test$n > /dev/null || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:exit status: $status"
 exit $status