]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Upgrade uses of hmac-sha1 to DEFAULT_HMAC
authorMark Andrews <marka@isc.org>
Tue, 5 Jul 2022 08:53:53 +0000 (18:53 +1000)
committerMichal Nowak <mnowak@isc.org>
Mon, 3 Oct 2022 11:19:35 +0000 (13:19 +0200)
where the test is not hmac-sha1 specific

(cherry picked from commit c533e8bc5ba3278c8252b51c13f7b1489a828a56)

16 files changed:
bin/tests/system/checkconf/bad-kasp-keydir1.conf.in [moved from bin/tests/system/checkconf/bad-kasp-keydir1.conf with 95% similarity]
bin/tests/system/checkconf/bad-kasp-keydir2.conf.in [moved from bin/tests/system/checkconf/bad-kasp-keydir2.conf with 94% similarity]
bin/tests/system/checkconf/bad-kasp-keydir3.conf.in [moved from bin/tests/system/checkconf/bad-kasp-keydir3.conf with 95% similarity]
bin/tests/system/checkconf/bad-kasp-keydir4.conf.in [moved from bin/tests/system/checkconf/bad-kasp-keydir4.conf with 95% similarity]
bin/tests/system/checkconf/bad-kasp-keydir5.conf.in [moved from bin/tests/system/checkconf/bad-kasp-keydir5.conf with 95% similarity]
bin/tests/system/checkconf/clean.sh
bin/tests/system/checkzone/clean.sh
bin/tests/system/checkzone/setup.sh
bin/tests/system/checkzone/zones/bad-tsig.db.in [moved from bin/tests/system/checkzone/zones/bad-tsig.db with 84% similarity]
bin/tests/system/kasp/ns4/named.conf.in
bin/tests/system/kasp/tests.sh
bin/tests/system/keymgr2kasp/ns4/named.conf.in
bin/tests/system/keymgr2kasp/ns4/named2.conf.in
bin/tests/system/keymgr2kasp/tests.sh
bin/tests/system/rndc/ns7/named.conf.in
bin/tests/system/rndc/tests.sh

similarity index 95%
rename from bin/tests/system/checkconf/bad-kasp-keydir1.conf
rename to bin/tests/system/checkconf/bad-kasp-keydir1.conf.in
index eea10308b0d042668a7c6a92b069cdb4f5e451dc..b0deaeae336d66641f5f1a60cea8c1cbb35ed1c5 100644 (file)
 
 
 key "keyforview1" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "YPfMoAk6h+3iN8MDRQC004iSNHY=";
 };
 
 key "keyforview2" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "4xILSZQnuO1UKubXHkYUsvBRPu8=";
 };
 
similarity index 94%
rename from bin/tests/system/checkconf/bad-kasp-keydir2.conf
rename to bin/tests/system/checkconf/bad-kasp-keydir2.conf.in
index 2ccf4397d76949ed62d64a21f73078134e5e8a62..699c193aaa0f288dd9b758ad9ba738265f653849 100644 (file)
  */
 
 key "keyforview1" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "YPfMoAk6h+3iN8MDRQC004iSNHY=";
 };
 
 key "keyforview2" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "4xILSZQnuO1UKubXHkYUsvBRPu8=";
 };
 
similarity index 95%
rename from bin/tests/system/checkconf/bad-kasp-keydir3.conf
rename to bin/tests/system/checkconf/bad-kasp-keydir3.conf.in
index e0578774383c722bffac1234313d9416e2731395..0dbd7e2265170a3b5bf65c725cf0ff0fe4e9ba25 100644 (file)
  */
 
 key "keyforview1" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "YPfMoAk6h+3iN8MDRQC004iSNHY=";
 };
 
 key "keyforview2" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "4xILSZQnuO1UKubXHkYUsvBRPu8=";
 };
 
similarity index 95%
rename from bin/tests/system/checkconf/bad-kasp-keydir4.conf
rename to bin/tests/system/checkconf/bad-kasp-keydir4.conf.in
index 44f867f33e67867b7e7c0ae13d0c61df97709614..af4a8f907b20b0f35d0aaa6a3275aadf881b43b9 100644 (file)
  */
 
 key "keyforview1" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "YPfMoAk6h+3iN8MDRQC004iSNHY=";
 };
 
 key "keyforview2" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "4xILSZQnuO1UKubXHkYUsvBRPu8=";
 };
 
similarity index 95%
rename from bin/tests/system/checkconf/bad-kasp-keydir5.conf
rename to bin/tests/system/checkconf/bad-kasp-keydir5.conf.in
index 9373a079c76c4fdb8f42855b62d802a4d3680ae8..1cca6083263a297579c80266934c16d7bbea3e39 100644 (file)
  */
 
 key "keyforview1" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "YPfMoAk6h+3iN8MDRQC004iSNHY=";
 };
 
 key "keyforview2" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "4xILSZQnuO1UKubXHkYUsvBRPu8=";
 };
 
index e4d367f2c453b8f510930245545968849f8431fe..0d6001da767045791f3fa235e80cd3ea0682c439 100644 (file)
 # See the COPYRIGHT file distributed with this work for additional
 # information regarding copyright ownership.
 
-rm -f good.conf.in good.conf.out badzero.conf *.out
-rm -f good-kasp.conf.in
-rm -rf test.keydir
+rm -f bad-kasp-keydir1.conf
+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 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 ns*/named.lock
+rm -rf test.keydir
index 045af7095ae85d7cebb92982e10de82befff4591..4ad252e3929787909acaaca9acd412b997173d79 100644 (file)
@@ -11,3 +11,4 @@
 
 rm -f test.* good1.db.map good1.db.raw named-compilezone
 rm -f ns*/named.lock
+rm -f zones/bad-tsig.db
index cecfe1830a6334d11d235e3059efb08c3ea6da75..5bdb0e6c1d8dc682e40cdf6ccdc7e17d86526b3f 100644 (file)
@@ -18,3 +18,5 @@ ln -s $CHECKZONE named-compilezone
         zones/good1.db > /dev/null 2>&1
 ./named-compilezone -D -F map -o good1.db.map example \
         zones/good1.db > /dev/null 2>&1
+
+copy_setports zones/bad-tsig.db.in zones/bad-tsig.db
similarity index 84%
rename from bin/tests/system/checkzone/zones/bad-tsig.db
rename to bin/tests/system/checkzone/zones/bad-tsig.db.in
index 53c2f8c114717243a1c5c8a6623994e860a20af4..daef06c3943ea562ce340a38e638c7cd6fa7320d 100644 (file)
@@ -14,4 +14,4 @@ $TTL 600
                NS      ns
 ns             A       192.0.2.1
 
-tsig           TSIG    hmac-sha1. 1516135665 300 20 thBt8DheAD7qpqSFTiGK999sxGg= 54994 NOERROR 0
+tsig           TSIG    @DEFAULT_HMAC@ 1516135665 300 20 thBt8DheAD7qpqSFTiGK999sxGg= 54994 NOERROR 0
index 66e6a9c58c148117a63a1d4ee2264145d15866fd..fff45ab698582a938b437b8cc3a4a532d736c769 100644 (file)
@@ -38,17 +38,17 @@ key "sha256" {
 };
 
 key "keyforview1" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "YPfMoAk6h+3iN8MDRQC004iSNHY=";
 };
 
 key "keyforview2" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "4xILSZQnuO1UKubXHkYUsvBRPu8=";
 };
 
 key "keyforview3" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "C1Azf+gGPMmxrUg/WQINP6eV9Y0=";
 };
 
index ff4d32cc7bd467f766e626261667d22477653583..4a62dbc47fdefbfcceb5799cfa00ec97b213fd61 100644 (file)
@@ -1882,7 +1882,7 @@ dnssec_verify
 # Test with views.
 set_zone "example.net"
 set_server "ns4" "10.53.0.4"
-TSIG="hmac-sha1:keyforview1:$VIEW1"
+TSIG="$DEFAULT_HMAC:keyforview1:$VIEW1"
 wait_for_nsec
 check_keys
 check_dnssecstatus "$SERVER" "$POLICY" "$ZONE" "example1"
@@ -1909,7 +1909,7 @@ check_signatures TXT "dig.out.$DIR.test$n.txt" "ZSK"
 test "$ret" -eq 0 || echo_i "failed"
 status=$((status+ret))
 
-TSIG="hmac-sha1:keyforview2:$VIEW2"
+TSIG="$DEFAULT_HMAC:keyforview2:$VIEW2"
 wait_for_nsec
 check_keys
 check_dnssecstatus "$SERVER" "$POLICY" "$ZONE" "example2"
@@ -1934,7 +1934,7 @@ check_signatures TXT "dig.out.$DIR.test$n.txt" "ZSK"
 test "$ret" -eq 0 || echo_i "failed"
 status=$((status+ret))
 
-TSIG="hmac-sha1:keyforview3:$VIEW3"
+TSIG="$DEFAULT_HMAC:keyforview3:$VIEW3"
 wait_for_nsec
 check_keys
 check_dnssecstatus "$SERVER" "$POLICY" "$ZONE" "example3"
index 701c0f7ea64510b063d9806c9f143e9da90dc312..e478404eefaf8e1a126ef6585b4ed0a7e4087cf4 100644 (file)
@@ -36,12 +36,12 @@ controls {
 };
 
 key "external" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "YPfMoAk6h+3iN8MDRQC004iSNHY=";
 };
 
 key "internal" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "4xILSZQnuO1UKubXHkYUsvBRPu8=";
 };
 
index 46165376bc621a07551874b440a17a94a5a0f8b6..606b14cd0a5dd516977c6f0bf50af6cdff4c4ba2 100644 (file)
@@ -57,12 +57,12 @@ dnssec-policy "rsasha256" {
 };
 
 key "external" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "YPfMoAk6h+3iN8MDRQC004iSNHY=";
 };
 
 key "internal" {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "4xILSZQnuO1UKubXHkYUsvBRPu8=";
 };
 
index a75dd806390854e5a7258217f9594a74453cb97a..705054f542712257960d3ef1b266a32558dedb23 100644 (file)
@@ -957,7 +957,7 @@ set_server "ns4" "10.53.0.4"
 init_view_migration
 set_keyalgorithm "KEY1" "8" "RSASHA256" "2048"
 set_keyalgorithm "KEY2" "8" "RSASHA256" "1024"
-TSIG="hmac-sha1:external:$VIEW1"
+TSIG="$DEFAULT_HMAC:external:$VIEW1"
 wait_for_nsec
 # Make sure the zone is signed with legacy keys.
 check_keys
@@ -987,7 +987,7 @@ set_server "ns4" "10.53.0.4"
 init_view_migration
 set_keyalgorithm "KEY1" "8" "RSASHA256" "2048"
 set_keyalgorithm "KEY2" "8" "RSASHA256" "1024"
-TSIG="hmac-sha1:internal:$VIEW2"
+TSIG="$DEFAULT_HMAC:internal:$VIEW2"
 wait_for_nsec
 # Make sure the zone is signed with legacy keys.
 check_keys
@@ -1052,7 +1052,7 @@ set_keystate     "KEY3" "STATE_DNSKEY" "rumoured"
 set_keystate     "KEY3" "STATE_ZRRSIG" "hidden"
 
 # Various signing policy checks (external).
-TSIG="hmac-sha1:external:$VIEW1"
+TSIG="$DEFAULT_HMAC:external:$VIEW1"
 check_keys
 wait_for_done_signing
 check_dnssecstatus "$SERVER" "$POLICY" "$ZONE" "ext"
@@ -1113,7 +1113,7 @@ check_apex
 dnssec_verify
 
 # Various signing policy checks (internal).
-TSIG="hmac-sha1:internal:$VIEW2"
+TSIG="$DEFAULT_HMAC:internal:$VIEW2"
 check_keys
 wait_for_done_signing
 check_dnssecstatus "$SERVER" "$POLICY" "$ZONE" "int"
index b72122353a5ae094f301bbb0db171855a58a6250..adca73113af3ea93f80d28697612cea8b850ddbc 100644 (file)
@@ -24,12 +24,12 @@ key rndc_key {
 };
 
 key int {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "FrSt77yPTFx6hTs4i2tKLB9LmE0=";
 };
 
 key ext {
-       algorithm "hmac-sha1";
+       algorithm @DEFAULT_HMAC@;
        secret "FrSt77yPTFx6hTs4i2tKLB9LmE0=";
 };
 
index b40b50ed6b5cff75ec6be9b0dd767515bf8e6ec2..20f3925bf1ec93399675a4bc265f97263b8a94d5 100644 (file)
@@ -766,10 +766,10 @@ status=$((status+ret))
 n=$((n+1))
 echo_i "checking initial in-view zone file is loaded ($n)"
 ret=0
-TSIG="hmac-sha1:int:FrSt77yPTFx6hTs4i2tKLB9LmE0="
+TSIG="$DEFAULT_HMAC:int:FrSt77yPTFx6hTs4i2tKLB9LmE0="
 $DIGCMD @10.53.0.7 -y "$TSIG" text1.test. TXT > dig.out.1.test$n
 grep 'include 1' dig.out.1.test$n >/dev/null || ret=1
-TSIG="hmac-sha1:ext:FrSt77yPTFx6hTs4i2tKLB9LmE0="
+TSIG="$DEFAULT_HMAC:ext:FrSt77yPTFx6hTs4i2tKLB9LmE0="
 $DIGCMD @10.53.0.7 -y "$TSIG" text1.test. TXT > dig.out.2.test$n
 grep 'include 1' dig.out.2.test$n >/dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
@@ -777,7 +777,7 @@ status=$((status+ret))
 
 echo_i "update in-view zone ($n)"
 ret=0
-TSIG="hmac-sha1:int:FrSt77yPTFx6hTs4i2tKLB9LmE0="
+TSIG="$DEFAULT_HMAC:int:FrSt77yPTFx6hTs4i2tKLB9LmE0="
 $NSUPDATE -p ${PORT} -y "$TSIG" > /dev/null 2>&1 <<END || ret=1
 server 10.53.0.7
 zone test.
@@ -792,7 +792,7 @@ status=$((status+ret))
 
 echo_i "checking update ($n)"
 ret=0
-TSIG="hmac-sha1:int:FrSt77yPTFx6hTs4i2tKLB9LmE0="
+TSIG="$DEFAULT_HMAC:int:FrSt77yPTFx6hTs4i2tKLB9LmE0="
 $DIGCMD @10.53.0.7 -y "$TSIG" text2.test. TXT > dig.out.1.test$n
 grep 'addition 1' dig.out.1.test$n >/dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
@@ -822,10 +822,10 @@ wait_for_log 3 "all zones loaded" ns7/named.run
 n=$((n+1))
 echo_i "checking zone file edits are loaded ($n)"
 ret=0
-TSIG="hmac-sha1:int:FrSt77yPTFx6hTs4i2tKLB9LmE0="
+TSIG="$DEFAULT_HMAC:int:FrSt77yPTFx6hTs4i2tKLB9LmE0="
 $DIGCMD @10.53.0.7 -y "$TSIG" text1.test. TXT > dig.out.1.test$n
 grep 'include 2' dig.out.1.test$n >/dev/null || ret=1
-TSIG="hmac-sha1:ext:FrSt77yPTFx6hTs4i2tKLB9LmE0="
+TSIG="$DEFAULT_HMAC:ext:FrSt77yPTFx6hTs4i2tKLB9LmE0="
 $DIGCMD @10.53.0.7 -y "$TSIG" text1.test. TXT > dig.out.2.test$n
 grep 'include 2' dig.out.2.test$n >/dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi