]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3424. [func] dnssec-dsfromkey now emits the hash without spaces.
authorMark Andrews <marka@isc.org>
Tue, 27 Nov 2012 03:22:28 +0000 (14:22 +1100)
committerMark Andrews <marka@isc.org>
Tue, 27 Nov 2012 03:22:28 +0000 (14:22 +1100)
                        [RT #31951]

Squashed commit of the following:

commit 7369da0369e1de1fe6c5b5f84df8848b9a0984eb
Author: Mark Andrews <marka@isc.org>
Date:   Fri Nov 23 17:24:04 2012 +1100

    dupped/created reversed in log message

commit 0cef5faaf3ac22b00ed0f95b6bb7a146cf4cac15
Author: Mark Andrews <marka@isc.org>
Date:   Fri Nov 23 13:40:14 2012 +1100

    remove space from DS hash

CHANGES
bin/dnssec/dnssec-dsfromkey.c
bin/tests/system/dnssec/clean.sh
bin/tests/system/dnssec/tests.sh

diff --git a/CHANGES b/CHANGES
index 17c1520ea75a2c844671cd03dab0362f5bba10ad..0cf816fc94df30463e002712e7237845f469f052 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3424.  [func]          dnssec-dsfromkey now emits the hash without spaces.
+                       [RT #31951]
+
 3423.  [bug]           "rndc signing -nsec3param" didn't accept the full
                        range of possible values.  Address portability issues.
                        [RT #31938]
index 86cf0b8b06df3a55c25b06cdbcdac1b7256401e9..da6bb63129daf8a746266a3209df9ae5ca52a0c4 100644 (file)
@@ -284,7 +284,9 @@ emit(unsigned int dtype, isc_boolean_t showall, char *lookaside,
                }
        }
 
-       result = dns_rdata_totext(&ds, (dns_name_t *) NULL, &textb);
+       result = dns_rdata_tofmttext(&ds, (dns_name_t *) NULL, 0, 0, 0, "",
+                                    &textb);
+
        if (result != ISC_R_SUCCESS)
                fatal("can't print rdata");
 
index fc853c0e33facc71c36dfad9319be612be0231d9..189c01188bbe99b9afa06a61c9704b1ab58d74da 100644 (file)
@@ -65,4 +65,4 @@ rm -f ns3/inline.example.db.signed
 rm -f ns3/lower.example.db ns3/upper.example.db ns3/upper.example.db.lower
 rm -f nosign.before
 rm -f signing.out*
-
+rm -f canonical?.*
index 6683360f3618fb2550370397991ea24e53e6952c..6887683e5ce80a9d54983371ac4e681c6881e897 100644 (file)
@@ -1703,7 +1703,20 @@ echo "I:check dnssec-dsfromkey from stdin ($n)"
 ret=0
 $DIG $DIGOPTS dnskey algroll. @10.53.0.2 | \
         $DSFROMKEY -f - algroll. > dig.out.ns2.test$n || ret=1
-diff -b dig.out.ns2.test$n ns1/dsset-algroll. > /dev/null 2>&1 || ret=1
+NF=`awk '{print NF}' dig.out.ns2.test$n | sort -u`
+[ "${NF}" = 7 ] || ret=1
+# make canonical
+awk '{
+       for (i=1;i<7;i++) printf("%s ", $i);
+       for (i=7;i<=NF;i++) printf("%s", $i);
+       printf("\n");
+}' < dig.out.ns2.test$n > canonical1.$n || ret=1
+awk '{
+       for (i=1;i<7;i++) printf("%s ", $i);
+       for (i=7;i<=NF;i++) printf("%s", $i);
+       printf("\n");
+}' < ns1/dsset-algroll. > canonical2.$n || ret=1
+diff -b canonical1.$n canonical2.$n > /dev/null 2>&1 || ret=1
 n=`expr $n + 1`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`