]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3041. [bug] dnssec-signzone failed to generate new signatures on
authorMark Andrews <marka@isc.org>
Thu, 24 Feb 2011 04:06:39 +0000 (04:06 +0000)
committerMark Andrews <marka@isc.org>
Thu, 24 Feb 2011 04:06:39 +0000 (04:06 +0000)
                        ttl changes. [RT #23330]

CHANGES
bin/dnssec/dnssec-signzone.c
bin/tests/system/dnssec/clean.sh
bin/tests/system/dnssec/signer/example.db.in [new file with mode: 0644]
bin/tests/system/dnssec/tests.sh

diff --git a/CHANGES b/CHANGES
index 5b92ef7120c6ff74f861434ce2ba29004331a0e1..83b504ddef0b846c358672b6614393c198d87b78 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3041.  [bug]           dnssec-signzone failed to generate new signatures on
+                       ttl changes. [RT #23330]
+
 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]
index e46e6107edb01f4494f4ae7ebd84f329b89a95e1..d6b8495e4659fb2496d488f0367008eddac55713 100644 (file)
@@ -16,7 +16,7 @@
  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-signzone.c,v 1.177.18.29 2009/07/21 06:44:32 tbox Exp $ */
+/* $Id: dnssec-signzone.c,v 1.177.18.30 2011/02/24 04:06:38 marka Exp $ */
 
 /*! \file */
 
@@ -435,32 +435,32 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
                        if (!expired)
                                keep = ISC_TRUE;
                } else if (issigningkey(key)) {
-                       if (!expired && setverifies(name, set, key, &sigrdata))
-                       {
+                       if (!expired && rrsig.originalttl == set->ttl &&
+                           setverifies(name, set, key, &sigrdata)) {
                                vbprintf(2, "\trrsig by %s retained\n", sigstr);
                                keep = ISC_TRUE;
                                wassignedby[key->position] = ISC_TRUE;
                                nowsignedby[key->position] = ISC_TRUE;
                        } else {
                                vbprintf(2, "\trrsig by %s dropped - %s\n",
-                                        sigstr,
-                                        expired ? "expired" :
-                                                  "failed to verify");
+                                        sigstr, expired ? "expired" :
+                                        rrsig.originalttl != set->ttl ?
+                                        "ttl change" : "failed to verify");
                                wassignedby[key->position] = ISC_TRUE;
                                resign = ISC_TRUE;
                        }
                } else if (iszonekey(key)) {
-                       if (!expired && setverifies(name, set, key, &sigrdata))
-                       {
+                       if (!expired && rrsig.originalttl == set->ttl &&
+                           setverifies(name, set, key, &sigrdata)) {
                                vbprintf(2, "\trrsig by %s retained\n", sigstr);
                                keep = ISC_TRUE;
                                wassignedby[key->position] = ISC_TRUE;
                                nowsignedby[key->position] = ISC_TRUE;
                        } else {
                                vbprintf(2, "\trrsig by %s dropped - %s\n",
-                                        sigstr,
-                                        expired ? "expired" :
-                                                  "failed to verify");
+                                        sigstr, expired ? "expired" :
+                                        rrsig.originalttl != set->ttl ?
+                                        "ttl change" : "failed to verify");
                                wassignedby[key->position] = ISC_TRUE;
                        }
                } else if (!expired) {
index 962aae157ec39d304dd7e957fab54783577fbc90..4f677779af827eb53656ba9e7f1e220dde02d6cd 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.15.18.2 2005/06/24 00:08:12 marka Exp $
+# $Id: clean.sh,v 1.15.18.3 2011/02/24 04:06:39 marka Exp $
 
 rm -f */K* */keyset-* */dsset-* */dlvset-* */signedkey-* */*.signed */trusted.conf */tmp*
 rm -f ns1/root.db ns2/example.db ns3/secure.example.db
@@ -26,3 +26,5 @@ rm -f */example.bk
 rm -f dig.out.*
 rm -f random.data
 rm -f ns2/dlv.db
+rm -f signer/example.db.after signer/example.db.before
+rm -f signer/example.db.changed
diff --git a/bin/tests/system/dnssec/signer/example.db.in b/bin/tests/system/dnssec/signer/example.db.in
new file mode 100644 (file)
index 0000000..6f68c8e
--- /dev/null
@@ -0,0 +1,21 @@
+; Copyright (C) 2010  Internet Systems Consortium, Inc. ("ISC")
+;
+; 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: example.db.in,v 1.2.154.2 2011/02/24 04:06:39 marka Exp $
+$TTL 60
+example. 60 IN SOA example. . 0 0 0 0 0
+example. 60 IN NS example.
+example. 60 IN A 1.2.3.4
+; out of zone record
+; out-of-zone. 60 IN A 1.2.3.4
index f5bbc4d8bd7aaddccbf6026529528be34e7538dc..d2ecd7ea11b4c1f7b55f07f5ec6e48415d5b35e8 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.44.18.10 2011/02/23 13:15:38 marka Exp $
+# $Id: tests.sh,v 1.44.18.11 2011/02/24 04:06:39 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -476,6 +476,24 @@ n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+echo "I:checking that dnsssec-signzone updates originalttl on ttl changes ($n)"
+ret=0
+(
+cd signer
+RANDFILE=../random.data
+zone=example
+key1=`$KEYGEN -r $RANDFILE -a RSASHA1 -b 1024 -n zone $zone`
+key2=`$KEYGEN -r $RANDFILE -f KSK -a RSASHA1 -b 1024 -n zone $zone`
+cat example.db.in $key1.key $key2.key > example.db
+$SIGNER -o example -f example.db.before example.db > /dev/null 2>&1
+sed 's/60.IN.SOA./50 IN SOA /' example.db.before > example.db.changed
+$SIGNER -o example -f example.db.after example.db.changed > /dev/null 2>&1
+)
+grep "SOA 5 1 50" signer/example.db.after > /dev/null || ret=1
+n=`expr $n + 1`
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 #
 # private.secure.example is served by the same server as its
 # grand parent and there is not a secure delegation from secure.example