]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Upgrade uses of hmac-md5 to DEFAULT_HMAC
authorMark Andrews <marka@isc.org>
Tue, 5 Jul 2022 09:38:31 +0000 (19:38 +1000)
committerMark Andrews <marka@isc.org>
Thu, 7 Jul 2022 00:11:42 +0000 (10:11 +1000)
where the test is not hmac-md5 specific

35 files changed:
bin/tests/system/acl/ns2/named1.conf.in
bin/tests/system/acl/ns2/named2.conf.in
bin/tests/system/acl/ns2/named3.conf.in
bin/tests/system/acl/ns2/named4.conf.in
bin/tests/system/acl/ns2/named5.conf.in
bin/tests/system/acl/tests.sh
bin/tests/system/allow-query/ns2/named10.conf.in
bin/tests/system/allow-query/ns2/named11.conf.in
bin/tests/system/allow-query/ns2/named12.conf.in
bin/tests/system/allow-query/ns2/named30.conf.in
bin/tests/system/allow-query/ns2/named31.conf.in
bin/tests/system/allow-query/ns2/named32.conf.in
bin/tests/system/allow-query/ns2/named40.conf.in
bin/tests/system/allow-query/tests.sh
bin/tests/system/ans.pl
bin/tests/system/catz/ns1/named.conf.in
bin/tests/system/catz/ns2/named1.conf.in
bin/tests/system/catz/ns2/named2.conf.in
bin/tests/system/checkconf/bad-tsig.conf.in [moved from bin/tests/system/checkconf/bad-tsig.conf with 94% similarity]
bin/tests/system/checkconf/clean.sh
bin/tests/system/checkconf/good.conf.in [moved from bin/tests/system/checkconf/good.conf with 99% similarity]
bin/tests/system/checkconf/setup.sh
bin/tests/system/checkconf/tests.sh
bin/tests/system/notify/ns5/named.conf.in
bin/tests/system/notify/tests.sh
bin/tests/system/nsupdate/ns1/named.conf.in
bin/tests/system/nsupdate/ns2/named.conf.in
bin/tests/system/nsupdate/tests.sh
bin/tests/system/upforwd/ns1/named.conf.in
bin/tests/system/upforwd/tests.sh
bin/tests/system/xfer/ns2/named.conf.in
bin/tests/system/xfer/ns3/named.conf.in
bin/tests/system/xfer/ns4/named.conf.base
bin/tests/system/xfer/ns8/named.conf.in
bin/tests/system/xfer/tests.sh

index 8787c6afa2f9db70ffa7e82d6315c1438bb06b1b..682ba97f5778d69ab3394f7760b25fb51031c422 100644 (file)
@@ -35,12 +35,12 @@ options {
 };
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
 key two {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index a95b4c18dde8fd65640f14751aef93c625b59f1d..7b1cea6fcdde397004a3877cd3e441235de3369c 100644 (file)
@@ -35,12 +35,12 @@ options {
 };
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
 key two {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index 14cc3fec3f7b83e022ef88c92e971a70c7564d42..6b35ba5a98b9796194e193403a8ceb335b720748 100644 (file)
@@ -35,17 +35,17 @@ options {
 };
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
 key two {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
 key three {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index 77cf110a5464ac9a6b9eeafc75effa6d23aafe62..b23a1cab58ecec3e00ad6af43be6f107eb977d17 100644 (file)
@@ -35,12 +35,12 @@ options {
 };
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
 key two {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index 5ccabf9255b24fd6a26cf1936d7e68dce41859d1..52791aa2a1af1f2f8f79e875f89e581f3251c969 100644 (file)
@@ -37,12 +37,12 @@ options {
 };
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
 key two {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index 9ee39843ae160a8e237b6621650e398502356f3b..fe54ef57f14216dc77ff3779d377facdc8ccf715 100644 (file)
@@ -23,14 +23,14 @@ echo_i "testing basic ACL processing"
 # key "one" should fail
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.1 axfr -y "${DEFAULT_HMAC}:one:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
 
 
 # any other key should be fine
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.1 axfr -y "${DEFAULT_HMAC}:two:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
 
 copy_setports ns2/named2.conf.in ns2/named.conf
@@ -40,18 +40,18 @@ sleep 5
 # prefix 10/8 should fail
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.1 axfr -y "${DEFAULT_HMAC}:one:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
 
 # any other address should work, as long as it sends key "one"
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 127.0.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 127.0.0.1 axfr -y "${DEFAULT_HMAC}:two:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
 
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 127.0.0.1 axfr -y "${DEFAULT_HMAC}:one:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
 
 echo_i "testing nested ACL processing"
@@ -63,31 +63,31 @@ sleep 5
 # should succeed
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.2 axfr -y two:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.2 axfr -y "${DEFAULT_HMAC}:two:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
 
 # should succeed
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.2 axfr -y one:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.2 axfr -y "${DEFAULT_HMAC}:one:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
 
 # should succeed
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.1 axfr -y "${DEFAULT_HMAC}:two:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
 
 # should succeed
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.1 axfr -y "${DEFAULT_HMAC}:two:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
 
 # but only one or the other should fail
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 127.0.0.1 axfr -y "${DEFAULT_HMAC}:one:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
 
 t=`expr $t + 1`
@@ -109,31 +109,31 @@ sleep 5
 # should succeed
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.2 axfr -y two:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.2 axfr -y "${DEFAULT_HMAC}:two:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
 
 # should succeed
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.1 axfr -y "${DEFAULT_HMAC}:one:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
 
 # should fail
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.2 axfr -y one:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.2 axfr -y "${DEFAULT_HMAC}:one:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
 
 # should fail
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.1 axfr -y "${DEFAULT_HMAC}:two:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
 
 # should fail
 t=`expr $t + 1`
 $DIG $DIGOPTS tsigzone. \
-       @10.53.0.2 -b 10.53.0.3 axfr -y one:1234abcd8765 > dig.out.${t}
+       @10.53.0.2 -b 10.53.0.3 axfr -y "${DEFAULT_HMAC}:one:1234abcd8765" > dig.out.${t}
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
 
 echo_i "testing allow-query-on ACL processing"
index b91d19a940cfb17d81bc7dd4990095267374463d..ae485e82add7df41becf26fa704633dfe4dfaf36 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index 308c4ca19e145fc00041d7c862ac0b5d751e535b..8a5e806745eccc2cfc10ed1de6ff57fdbd838a8d 100644 (file)
  */
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
 key two {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234efgh8765";
 };
 
index 6b0fe552a4b28f099d94ec0098b4db083dba83f1..a10c6d0f98ff9b2075735eae88e1922318e356b9 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index aefc4740aa302dbd3d935b137492c1c5f24f9972..52981a7a0bb303780369cf7faa3610b84fd958aa 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index 27eccc2956c6c0f012914a0fc364ddad3303873a..f6278703d77482ae36c764cf431ac44c89048273 100644 (file)
  */
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
 key two {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234efgh8765";
 };
 
index adbb203de01c160401ffe8d2d61f4e88aeb492fe..6fd516bcedd6b4bd6e769a5700cdc4e2b439e4d4 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index 364f94b2fcadbaab156b234c4b55b511764d1ae0..de37915e678ae4d41c2083fdb2059a1cdea3c289 100644 (file)
@@ -16,12 +16,12 @@ acl accept { 10.53.0.2; };
 acl badaccept { 10.53.0.1; };
 
 key one {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
 key two {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234efgh8765";
 };
 
index bbffe07cc1cc754f108e924c2a5b0290f9a8c433..97a0859637ec1b3fee3836f6b5206ce08ccf7296 100644 (file)
@@ -200,7 +200,7 @@ rndc_reload ns2 10.53.0.2
 
 echo_i "test $n: key allowed - query allowed"
 ret=0
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y "${DEFAULT_HMAC}:one:1234abcd8765" a.normal.example a > dig.out.ns2.$n || ret=1
 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
@@ -213,7 +213,7 @@ rndc_reload ns2 10.53.0.2
 
 echo_i "test $n: key not allowed - query refused"
 ret=0
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y "${DEFAULT_HMAC}:two:1234efgh8765" a.normal.example a > dig.out.ns2.$n || ret=1
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
 grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
@@ -227,7 +227,7 @@ rndc_reload ns2 10.53.0.2
 
 echo_i "test $n: key disallowed - query refused"
 ret=0
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y "${DEFAULT_HMAC}:one:1234abcd8765" a.normal.example a > dig.out.ns2.$n || ret=1
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
 grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
@@ -366,7 +366,7 @@ rndc_reload ns2 10.53.0.2
 
 echo_i "test $n: views key allowed - query allowed"
 ret=0
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y "${DEFAULT_HMAC}:one:1234abcd8765" a.normal.example a > dig.out.ns2.$n || ret=1
 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
@@ -379,7 +379,7 @@ rndc_reload ns2 10.53.0.2
 
 echo_i "test $n: views key not allowed - query refused"
 ret=0
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y "${DEFAULT_HMAC}:two:1234efgh8765" a.normal.example a > dig.out.ns2.$n || ret=1
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
 grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
@@ -393,7 +393,7 @@ rndc_reload ns2 10.53.0.2
 
 echo_i "test $n: views key disallowed - query refused"
 ret=0
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y "${DEFAULT_HMAC}:one:1234abcd8765" a.normal.example a > dig.out.ns2.$n || ret=1
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
 grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
@@ -533,7 +533,7 @@ status=`expr $status + $ret`
 n=`expr $n + 1`
 echo_i "test $n: zone key allowed - query allowed"
 ret=0
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y "${DEFAULT_HMAC}:one:1234abcd8765" a.keyallow.example a > dig.out.ns2.$n || ret=1
 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
 grep '^a.keyallow.example' dig.out.ns2.$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
@@ -543,7 +543,7 @@ status=`expr $status + $ret`
 n=`expr $n + 1`
 echo_i "test $n: zone key not allowed - query refused"
 ret=0
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y "${DEFAULT_HMAC}:two:1234efgh8765" a.keyallow.example a > dig.out.ns2.$n || ret=1
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
 grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
 grep '^a.keyallow.example' dig.out.ns2.$n > /dev/null && ret=1
@@ -554,7 +554,7 @@ status=`expr $status + $ret`
 n=`expr $n + 1`
 echo_i "test $n: zone key disallowed - query refused"
 ret=0
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.keydisallow.example a > dig.out.ns2.$n || ret=1
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y "${DEFAULT_HMAC}:one:1234abcd8765" a.keydisallow.example a > dig.out.ns2.$n || ret=1
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
 grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
 grep '^a.keydisallow.example' dig.out.ns2.$n > /dev/null && ret=1
index 899a32596e52c0520292539e20d3ea6b292ef178..b74333b255d29d78e5c3bcb01e9462fb76e9d0eb 100644 (file)
@@ -95,6 +95,8 @@ my $mainport = int($ENV{'PORT'});
 if (!$mainport) { $mainport = 5300; }
 my $ctrlport = int($ENV{'EXTRAPORT1'});
 if (!$ctrlport) { $ctrlport = 5301; }
+my $hmac_algorithm = $ENV{'DEFAULT_HMAC'};
+if (!defined($hmac_algorithm)) { $hmac_algorithm = "hmac-sha256"; }
 
 # XXX: we should also be able to set the port numbers to listen on.
 my $ctlsock = IO::Socket::INET->new(LocalAddr => "$server_addr",
@@ -174,6 +176,7 @@ sub handleUDP {
                                } else {
                                        $tsig = Net::DNS::RR->new(
                                                        name => $key_name,
+                                                       algorithm => $hmac_algorithm,
                                                        type => 'TSIG',
                                                        key  => $key_data);
                                }
@@ -390,6 +393,7 @@ sub handleTCP {
                                if ($Net::DNS::VERSION < 0.69) {
                                        $tsig = Net::DNS::RR->new(
                                                   "$key_name TSIG $key_data");
+                                       $tsig->algorithm = $hmac_algorithm;
                                } elsif ($Net::DNS::VERSION >= 0.81 &&
                                         $continuation) {
                                } elsif ($Net::DNS::VERSION >= 0.75 &&
@@ -398,6 +402,7 @@ sub handleTCP {
                                } else {
                                        $tsig = Net::DNS::RR->new(
                                                        name => $key_name,
+                                                       algorithm => $hmac_algorithm,
                                                        type => 'TSIG',
                                                        key  => $key_data);
                                }
index 142128131ce0ef1240cb8766ee936e67c36e1243..e5d688cf516b118f391284648f43bef27a14c7f3 100644 (file)
@@ -122,5 +122,5 @@ view "ch" ch {
 
 key tsig_key. {
        secret "LSAnCU+Z";
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
 };
index a587b383afab20269f872558864057238883cfdf..ba21963625ec533e9d290fa322b564f5e949a1a1 100644 (file)
@@ -165,5 +165,5 @@ view "ch" ch {
 
 key tsig_key. {
        secret "LSAnCU+Z";
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
 };
index 62b76a600e3d413b03c2b7d118b196704752e9b3..cd5f2b97c7f7c3f5d102ed9bb2eed7c7a1ab0790 100644 (file)
@@ -122,5 +122,5 @@ view "ch" ch {
 
 key tsig_key. {
        secret "LSAnCU+Z";
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
 };
similarity index 94%
rename from bin/tests/system/checkconf/bad-tsig.conf
rename to bin/tests/system/checkconf/bad-tsig.conf.in
index 4af25b0f1c8c8848df1a2a7514439dd8d2ed62d4..3e3023c5df59d9e3480860d1e8eb32e79673fe60 100644 (file)
@@ -13,7 +13,6 @@
 
 /* Bad secret */
 key "badtsig" {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "jEdD+BPKg==";
 };
-
index 0d6001da767045791f3fa235e80cd3ea0682c439..3b424be321cfb5732e4a6a6efae2d5cf18fd0073 100644 (file)
@@ -16,10 +16,11 @@ rm -f bad-kasp-keydir2.conf
 rm -f bad-kasp-keydir3.conf
 rm -f bad-kasp-keydir4.conf
 rm -f bad-kasp-keydir5.conf
+rm -f bad-tsig.conf
 rm -f checkconf.out*
 rm -f diff.out*
 rm -f good-kasp.conf.in
 rm -f good-server-christmas-tree.conf
-rm -f good.conf.in good.conf.out badzero.conf *.out
+rm -f good.conf good.conf.raw good.conf.out badzero.conf *.out
 rm -f ns*/named.lock
 rm -rf test.keydir
similarity index 99%
rename from bin/tests/system/checkconf/good.conf
rename to bin/tests/system/checkconf/good.conf.in
index 100ec3a827f19aca8fffbde932b96f23b5478ec2..1c136c703e276f1e0ebdfa3a0745a1f5f74decb2 100644 (file)
@@ -267,6 +267,6 @@ dyndb "name" "library.so" {
        system;
 };
 key "mykey" {
-       algorithm "hmac-md5";
+       algorithm "@DEFAULT_HMAC@";
        secret "qwertyuiopasdfgh";
 };
index 7d83eb546332b027dedf4fa5bff96124107710d5..77707226c987e4daf0c5ee8fb3cfa611984fad71 100644 (file)
@@ -17,4 +17,6 @@ copy_setports bad-kasp-keydir2.conf.in bad-kasp-keydir2.conf
 copy_setports bad-kasp-keydir3.conf.in bad-kasp-keydir3.conf
 copy_setports bad-kasp-keydir4.conf.in bad-kasp-keydir4.conf
 copy_setports bad-kasp-keydir5.conf.in bad-kasp-keydir5.conf
+copy_setports bad-tsig.conf.in bad-tsig.conf
+copy_setports good.conf.in good.conf
 cp -f good-server-christmas-tree.conf.in good-server-christmas-tree.conf
index e1131dab514e7c71351ff137a154d9dcb9da9b20..5d6108ecd24ced2de0ac32ae9d74088b461bbdc4 100644 (file)
@@ -26,11 +26,11 @@ status=`expr $status + $ret`
 n=`expr $n + 1`
 echo_i "checking that named-checkconf prints a known good config ($n)"
 ret=0
-awk 'BEGIN { ok = 0; } /cut here/ { ok = 1; getline } ok == 1 { print }' good.conf > good.conf.in
-[ -s good.conf.in ] || ret=1
-$CHECKCONF -p good.conf.in  > checkconf.out$n || ret=1
-grep -v '^good.conf.in:' < checkconf.out$n > good.conf.out 2>&1 || ret=1
-cmp good.conf.in good.conf.out || ret=1
+awk 'BEGIN { ok = 0; } /cut here/ { ok = 1; getline } ok == 1 { print }' good.conf > good.conf.raw
+[ -s good.conf.raw ] || ret=1
+$CHECKCONF -p good.conf.raw  > checkconf.out$n || ret=1
+grep -v '^good.conf.raw:' < checkconf.out$n > good.conf.out 2>&1 || ret=1
+cmp good.conf.raw good.conf.out || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
@@ -38,10 +38,10 @@ n=`expr $n + 1`
 echo_i "checking that named-checkconf -x removes secrets ($n)"
 ret=0
 # ensure there is a secret and that it is not the check string.
-grep 'secret "' good.conf.in > /dev/null || ret=1
-grep 'secret "????????????????"' good.conf.in > /dev/null 2>&1 && ret=1
-$CHECKCONF -p -x good.conf.in > checkconf.out$n || ret=1
-grep -v '^good.conf.in:' < checkconf.out$n > good.conf.out 2>&1 || ret=1
+grep 'secret "' good.conf.raw > /dev/null || ret=1
+grep 'secret "????????????????"' good.conf.raw > /dev/null 2>&1 && ret=1
+$CHECKCONF -p -x good.conf.raw > checkconf.out$n || ret=1
+grep -v '^good.conf.raw:' < checkconf.out$n > good.conf.out 2>&1 || ret=1
 grep 'secret "????????????????"' good.conf.out > /dev/null 2>&1 || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
index 5cab276526ed8bf5fa10f65b0958832d4cb8ed04..4660fa216998075f414601c4b207481d73486958 100644 (file)
  */
 
 key "a" {
-       algorithm "hmac-md5";
+       algorithm @DEFAULT_HMAC@;
        secret "aaaaaaaaaaaaaaaaaaaa";
 };
 
 key "b" {
-       algorithm "hmac-md5";
+       algorithm @DEFAULT_HMAC@;
        secret "bbbbbbbbbbbbbbbbbbbb";
 };
 
 key "c" {
-       algorithm "hmac-md5";
+       algorithm @DEFAULT_HMAC@;
        secret "cccccccccccccccccccc";
 };
 
index 04fd34b47ff00fb52754a850ee7a737742ee404c..5f4ad1c68161ff62f7efeb0cfb96a2e103151632 100644 (file)
@@ -179,7 +179,7 @@ test_start "checking notify to multiple views using tsig"
 $NSUPDATE << EOF
 server 10.53.0.5 ${PORT}
 zone x21
-key a aaaaaaaaaaaaaaaaaaaa
+key $DEFAULT_HMAC:a aaaaaaaaaaaaaaaaaaaa
 update add added.x21 0 in txt "test string"
 send
 EOF
@@ -187,9 +187,9 @@ fnb="dig.out.b.ns5.test$n"
 fnc="dig.out.c.ns5.test$n"
 for i in 1 2 3 4 5 6 7 8 9
 do
-       dig_plus_opts added.x21. -y b:bbbbbbbbbbbbbbbbbbbb @10.53.0.5 \
+       dig_plus_opts added.x21. -y "${DEFAULT_HMAC}:b:bbbbbbbbbbbbbbbbbbbb" @10.53.0.5 \
                txt > "$fnb" || ret=1
-       dig_plus_opts added.x21. -y c:cccccccccccccccccccc @10.53.0.5 \
+       dig_plus_opts added.x21. -y "${DEFAULT_HMAC}:c:cccccccccccccccccccc" @10.53.0.5 \
                txt > "$fnc" || ret=1
        grep "test string" "$fnb" > /dev/null &&
        grep "test string" "$fnc" > /dev/null &&
index 2b67360c76c52aec44efce976233f29f33ae28fc..36e7b5910afd3578d97f222b22b048362e02e65f 100644 (file)
@@ -39,17 +39,17 @@ controls {
 };
 
 key altkey {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
 key restricted.example.nil {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
 key zonesub-key.example.nil {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234subk8765";
 };
 
index c85eef52c9a39ab15d8067539efac3ed3ba27429..356382a5838c17ee3ddbcd5a046a412103255820 100644 (file)
@@ -34,7 +34,7 @@ controls {
 };
 
 key altkey {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index a7a37c55d1259728072f0af627e5e2a74a6cf0e0..95bb5befd15e84e8a64bff7b3f2d5711badebb01 100755 (executable)
@@ -690,7 +690,7 @@ echo_i "check that 'update-policy subdomain' is properly enforced ($n)"
 # and thus this UPDATE should succeed.
 $NSUPDATE -d <<END > nsupdate.out1-$n 2>&1 || ret=1
 server 10.53.0.1 ${PORT}
-key restricted.example.nil 1234abcd8765
+key $DEFAULT_HMAC:restricted.example.nil 1234abcd8765
 update add restricted.example.nil 0 IN TXT everywhere.
 send
 END
@@ -700,7 +700,7 @@ grep "TXT.*everywhere" dig.out.1.test$n > /dev/null || ret=1
 # thus this UPDATE should fail.
 $NSUPDATE -d <<END > nsupdate.out2-$n 2>&1 && ret=1
 server 10.53.0.1 ${PORT}
-key restricted.example.nil 1234abcd8765
+key $DEFAULT_HMAC:restricted.example.nil 1234abcd8765
 update add example.nil 0 IN TXT everywhere.
 send
 END
@@ -715,7 +715,7 @@ echo_i "check that 'update-policy zonesub' is properly enforced ($n)"
 # the A record update should be rejected as it is not in the type list
 $NSUPDATE -d <<END > nsupdate.out1-$n 2>&1 && ret=1
 server 10.53.0.1 ${PORT}
-key zonesub-key.example.nil 1234subk8765
+key $DEFAULT_HMAC:zonesub-key.example.nil 1234subk8765
 update add zonesub.example.nil 0 IN A 1.2.3.4
 send
 END
@@ -725,7 +725,7 @@ grep "ANSWER: 0," dig.out.1.test$n > /dev/null || ret=1
 # the TXT record update should be accepted as it is in the type list
 $NSUPDATE -d <<END > nsupdate.out2-$n 2>&1 || ret=1
 server 10.53.0.1 ${PORT}
-key zonesub-key.example.nil 1234subk8765
+key $DEFAULT_HMAC:zonesub-key.example.nil 1234subk8765
 update add zonesub.example.nil 0 IN TXT everywhere.
 send
 END
index c2b57ddb12de8688d78bb843db9bec9a4ea76409..83ba6040c474b226d16681725bf387e177430b13 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 key "update.example." {
-       algorithm "hmac-md5";
+       algorithm @DEFAULT_HMAC@;
        secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
 };
 
index a6de3124de3155a7add737723224936f7e34aeaf..6d53af1c61094b12486261f56aa0867752500d63 100644 (file)
@@ -80,7 +80,7 @@ if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
 
 echo_i "updating zone (signed) ($n)"
 ret=0
-$NSUPDATE -y update.example:c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K -- - <<EOF || ret=1
+$NSUPDATE -y "${DEFAULT_HMAC}:update.example:c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K" -- - <<EOF || ret=1
 server 10.53.0.3 ${PORT}
 update add updated.example. 600 A 10.10.10.1
 update add updated.example. 600 TXT Foo
index 642b4bc15f2154ef61d3be9fffb74f71bb487643..39030a4df7b7bffdbb32e62fdfe4ff49683c3f67 100644 (file)
@@ -35,7 +35,7 @@ controls {
 };
 
 key tsigzone. {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index c0bb9873a0ccb742683e701f707e9e91a8a7daa4..76f19b56141571dbeed221958973acacd68b75e1 100644 (file)
@@ -33,7 +33,7 @@ controls {
 };
 
 key tsigzone. {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index 35311e1221fb39757ea01f82ebf1ed0da9db0fec..80782329b86216526b9cdc403acc5f42b1bcd065 100644 (file)
@@ -31,12 +31,12 @@ key rndc_key {
 
 key unused_key. {
        secret "1234abcd8765";
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
 };
 
 key tsig_key. {
        secret "LSAnCU+Z";
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
 };
 
 controls {
index 22b32727bc1eca49344d905ee1ad0d81aef65fef..6acd054196d91971338e7d297d65d5e320a40659 100644 (file)
@@ -31,7 +31,7 @@ options {
 };
 
 key key1. {
-       algorithm hmac-md5;
+       algorithm @DEFAULT_HMAC@;
        secret "1234abcd8765";
 };
 
index 9c6fcba9747d9e604b4bcf8c75d7c693124a6ec7..8b54d8e6123a9e29f8b87bec6a7afff17f3cafa3 100755 (executable)
@@ -48,14 +48,14 @@ status=$((status+tmp))
 n=$((n+1))
 echo_i "testing TSIG signed zone transfers ($n)"
 tmp=0
-$DIG $DIGOPTS tsigzone. @10.53.0.2 axfr -y tsigzone.:1234abcd8765 > dig.out.ns2.test$n || tmp=1
+$DIG $DIGOPTS tsigzone. @10.53.0.2 axfr -y "${DEFAULT_HMAC}:tsigzone.:1234abcd8765" > dig.out.ns2.test$n || tmp=1
 grep "^;" dig.out.ns2.test$n | cat_i
 
 #
 # Spin to allow the zone to transfer.
 #
 wait_for_xfer_tsig () {
-       $DIG $DIGOPTS tsigzone. @10.53.0.3 axfr -y tsigzone.:1234abcd8765 > dig.out.ns3.test$n || return 1
+       $DIG $DIGOPTS tsigzone. @10.53.0.3 axfr -y "${DEFAULT_HMAC}:tsigzone.:1234abcd8765" > dig.out.ns3.test$n || return 1
        grep "^;" dig.out.ns3.test$n > /dev/null && return 1
        return 0
 }
@@ -414,7 +414,7 @@ echo_i "bad message id ($n)"
 sendcmd < ans5/badmessageid
 
 # Uncomment to see AXFR stream with mismatching IDs.
-# $DIG $DIGOPTS @10.53.0.5 -y tsig_key:LSAnCU+Z nil. AXFR +all
+# $DIG $DIGOPTS @10.53.0.5 -y "${DEFAULT_HMAC}:tsig_key:LSAnCU+Z" nil. AXFR +all
 
 $RNDCCMD 10.53.0.4 retransfer nil | sed 's/^/ns4 /' | cat_i
 
@@ -465,7 +465,7 @@ test ${expire:-0} -gt 0 -a ${expire:-0} -lt 1814400 || {
 n=$((n+1))
 echo_i "test smaller transfer TCP message size ($n)"
 $DIG $DIGOPTS example. @10.53.0.8 axfr \
-       -y key1.:1234abcd8765 > dig.out.msgsize.test$n || status=1
+       -y "${DEFAULT_HMAC}:key1.:1234abcd8765" > dig.out.msgsize.test$n || status=1
 
 bytes=`wc -c < dig.out.msgsize.test$n`
 if [ $bytes -ne 459357 ]; then