01c5de4
From 14ad3e0b42bc999072d30268396412bec158a22d Mon Sep 17 00:00:00 2001
899014a
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
899014a
Date: Thu, 2 Aug 2018 23:46:45 +0200
ad7b3b8
Subject: [PATCH] FIPS tests changes
899014a
MIME-Version: 1.0
899014a
Content-Type: text/plain; charset=UTF-8
899014a
Content-Transfer-Encoding: 8bit
899014a
ad7b3b8
Squashed commit of the following:
ad7b3b8
899014a
commit 09e5eb48698d4fef2fc1031870de86c553b6bfaa
899014a
Author: Petr Menšík <pemensik@redhat.com>
899014a
Date:   Wed Mar 7 20:35:13 2018 +0100
899014a
899014a
    Fix nsupdate test. Do not use md5 by default for rndc, skip gracefully md5 if not available.
899014a
899014a
commit ab303db70082db76ecf36493d0b82ef3e8750cad
899014a
Author: Petr Menšík <pemensik@redhat.com>
899014a
Date:   Wed Mar 7 18:11:10 2018 +0100
899014a
899014a
    Changed root key to be RSASHA256
899014a
899014a
    Change bad trusted key to be the same algorithm.
899014a
899014a
commit 88ab07c0e14cc71247e1f9d11a1ea832b64c1ee8
899014a
Author: Petr Menšík <pemensik@redhat.com>
899014a
Date:   Wed Mar 7 16:56:17 2018 +0100
899014a
899014a
    Change used key to not use hmac-md5
899014a
899014a
    Fix upforwd test, do not use hmac-md5
899014a
899014a
commit aec891571626f053acfb4d0a247240cbc21a84e9
899014a
Author: Petr Menšík <pemensik@redhat.com>
899014a
Date:   Wed Mar 7 15:54:11 2018 +0100
899014a
899014a
    Increase bitsize of DSA key to pass FIPS 140-2 mode.
899014a
899014a
commit bca8e164fa0d9aff2f946b8b4eb0f1f7e0bf6696
899014a
Author: Petr Menšík <pemensik@redhat.com>
899014a
Date:   Wed Mar 7 15:41:08 2018 +0100
899014a
899014a
    Fix tsig and rndc tests for disabled md5
899014a
899014a
    Use hmac-sha256 instead of hmac-md5.
899014a
899014a
commit 0d314c1ab6151aa13574a21ad22f28d3b7f42a67
899014a
Author: Petr Menšík <pemensik@redhat.com>
899014a
Date:   Wed Mar 7 13:21:00 2018 +0100
899014a
899014a
    Add md5 availability detection to featuretest
899014a
899014a
commit f389a918803e2853e4b55fed62765dc4a492e34f
899014a
Author: Petr Menšík <pemensik@redhat.com>
899014a
Date:   Wed Mar 7 10:44:23 2018 +0100
899014a
899014a
    Change tests to not use hmac-md5 algorithms if not required
899014a
899014a
    Use hmac-sha256 instead of default hmac-md5 for allow-query
899014a
---
1e41691
 bin/tests/system/acl/ns2/named1.conf.in       |  4 +-
1e41691
 bin/tests/system/acl/ns2/named2.conf.in       |  4 +-
1e41691
 bin/tests/system/acl/ns2/named3.conf.in       |  6 +-
1e41691
 bin/tests/system/acl/ns2/named4.conf.in       |  4 +-
1e41691
 bin/tests/system/acl/ns2/named5.conf.in       |  4 +-
1e41691
 bin/tests/system/acl/tests.sh                 | 32 ++++-----
1e41691
 .../system/allow-query/ns2/named10.conf.in    |  2 +-
1e41691
 .../system/allow-query/ns2/named11.conf.in    |  4 +-
1e41691
 .../system/allow-query/ns2/named12.conf.in    |  2 +-
1e41691
 .../system/allow-query/ns2/named30.conf.in    |  2 +-
1e41691
 .../system/allow-query/ns2/named31.conf.in    |  4 +-
1e41691
 .../system/allow-query/ns2/named32.conf.in    |  2 +-
1e41691
 .../system/allow-query/ns2/named40.conf.in    |  4 +-
1e41691
 bin/tests/system/allow-query/tests.sh         | 18 ++---
1e41691
 bin/tests/system/catz/ns1/named.conf.in       |  2 +-
1e41691
 bin/tests/system/catz/ns2/named.conf.in       |  2 +-
1e41691
 bin/tests/system/checkconf/bad-tsig.conf      |  2 +-
1e41691
 bin/tests/system/checkconf/good.conf          |  2 +-
2a46633
 bin/tests/system/digdelv/ns2/example.db       | 15 +++--
843e5f5
 bin/tests/system/digdelv/tests.sh             | 20 +++---
1e41691
 bin/tests/system/dlv/ns1/sign.sh              |  4 +-
1e41691
 bin/tests/system/dlv/ns2/sign.sh              |  4 +-
745f43a
 bin/tests/system/dlv/ns6/sign.sh              | 66 ++++++++++---------
2a46633
 bin/tests/system/dnssec/ns2/sign.sh           |  8 +--
1e41691
 bin/tests/system/dnssec/ns5/trusted.conf.bad  |  2 +-
2a46633
 bin/tests/system/dnssec/tests.sh              |  4 +-
1e41691
 bin/tests/system/feature-test.c               | 14 ++++
1e41691
 bin/tests/system/filter-aaaa/ns1/sign.sh      |  4 +-
1e41691
 bin/tests/system/filter-aaaa/ns4/sign.sh      |  4 +-
1e41691
 bin/tests/system/notify/ns5/named.conf.in     |  6 +-
1e41691
 bin/tests/system/notify/tests.sh              |  6 +-
1e41691
 bin/tests/system/nsupdate/ns1/named.conf.in   |  2 +-
1e41691
 bin/tests/system/nsupdate/ns2/named.conf.in   |  2 +-
1e41691
 bin/tests/system/nsupdate/setup.sh            |  7 +-
745f43a
 bin/tests/system/nsupdate/tests.sh            | 11 +++-
1e41691
 bin/tests/system/rndc/setup.sh                |  2 +-
1e41691
 bin/tests/system/rndc/tests.sh                | 23 ++++---
1e41691
 bin/tests/system/tsig/ns1/named.conf.in       | 10 +--
1e41691
 bin/tests/system/tsig/setup.sh                |  5 ++
745f43a
 bin/tests/system/tsig/tests.sh                | 65 +++++++++++-------
1e41691
 bin/tests/system/tsiggss/setup.sh             |  2 +-
1e41691
 bin/tests/system/upforwd/ns1/named.conf.in    |  2 +-
1e41691
 bin/tests/system/upforwd/tests.sh             |  2 +-
01c5de4
 43 files changed, 220 insertions(+), 170 deletions(-)
899014a
899014a
diff --git a/bin/tests/system/acl/ns2/named1.conf.in b/bin/tests/system/acl/ns2/named1.conf.in
01c5de4
index 9999ada..e3f8d0e 100644
899014a
--- a/bin/tests/system/acl/ns2/named1.conf.in
899014a
+++ b/bin/tests/system/acl/ns2/named1.conf.in
899014a
@@ -33,12 +33,12 @@ options {
899014a
 };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
 key two {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/acl/ns2/named2.conf.in b/bin/tests/system/acl/ns2/named2.conf.in
01c5de4
index f8ec34e..d2d6ad3 100644
899014a
--- a/bin/tests/system/acl/ns2/named2.conf.in
899014a
+++ b/bin/tests/system/acl/ns2/named2.conf.in
899014a
@@ -33,12 +33,12 @@ options {
899014a
 };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
 key two {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/acl/ns2/named3.conf.in b/bin/tests/system/acl/ns2/named3.conf.in
01c5de4
index 2acb813..6a00344 100644
899014a
--- a/bin/tests/system/acl/ns2/named3.conf.in
899014a
+++ b/bin/tests/system/acl/ns2/named3.conf.in
899014a
@@ -33,17 +33,17 @@ options {
899014a
 };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
 key two {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
 key three {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/acl/ns2/named4.conf.in b/bin/tests/system/acl/ns2/named4.conf.in
01c5de4
index bca3ee1..5913420 100644
899014a
--- a/bin/tests/system/acl/ns2/named4.conf.in
899014a
+++ b/bin/tests/system/acl/ns2/named4.conf.in
899014a
@@ -33,12 +33,12 @@ options {
899014a
 };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
 key two {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/acl/ns2/named5.conf.in b/bin/tests/system/acl/ns2/named5.conf.in
01c5de4
index 9ef8171..5ae8d38 100644
899014a
--- a/bin/tests/system/acl/ns2/named5.conf.in
899014a
+++ b/bin/tests/system/acl/ns2/named5.conf.in
899014a
@@ -34,12 +34,12 @@ options {
899014a
 };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
 key two {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/acl/tests.sh b/bin/tests/system/acl/tests.sh
01c5de4
index 2ee34a0..a73a54e 100644
899014a
--- a/bin/tests/system/acl/tests.sh
899014a
+++ b/bin/tests/system/acl/tests.sh
899014a
@@ -22,14 +22,14 @@ echo_i "testing basic ACL processing"
899014a
 # key "one" should fail
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 
899014a
 # any other key should be fine
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 copy_setports ns2/named2.conf.in ns2/named.conf
899014a
@@ -39,18 +39,18 @@ sleep 5
899014a
 # prefix 10/8 should fail
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 # any other address should work, as long as it sends key "one"
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 127.0.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 127.0.0.1 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 127.0.0.1 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 echo_i "testing nested ACL processing"
899014a
@@ -62,31 +62,31 @@ sleep 5
899014a
 # should succeed
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.2 axfr -y two:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.2 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 # should succeed
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.2 axfr -y one:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.2 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 # should succeed
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 # should succeed
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 # but only one or the other should fail
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 127.0.0.1 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 t=`expr $t + 1`
899014a
@@ -97,7 +97,7 @@ grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $tt failed" ; status=1
899014a
 # and other values? right out
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 127.0.0.1 axfr -y three:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 127.0.0.1 axfr -y hmac-sha256:three:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 # now we only allow 10.53.0.1 *and* key one, or 10.53.0.2 *and* key two
899014a
@@ -108,31 +108,31 @@ sleep 5
899014a
 # should succeed
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.2 axfr -y two:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.2 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 # should succeed
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 # should fail
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.2 axfr -y one:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.2 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 # should fail
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.1 axfr -y hmac-sha256:two:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 # should fail
899014a
 t=`expr $t + 1`
899014a
 $DIG $DIGOPTS tsigzone. \
899014a
-	@10.53.0.2 -b 10.53.0.3 axfr -y one:1234abcd8765 > dig.out.${t}
899014a
+	@10.53.0.2 -b 10.53.0.3 axfr -y hmac-sha256:one:1234abcd8765 > dig.out.${t}
899014a
 grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo_i "test $t failed" ; status=1; }
899014a
 
899014a
 echo_i "testing allow-query-on ACL processing"
899014a
diff --git a/bin/tests/system/allow-query/ns2/named10.conf.in b/bin/tests/system/allow-query/ns2/named10.conf.in
01c5de4
index a579f32..3b8f853 100644
899014a
--- a/bin/tests/system/allow-query/ns2/named10.conf.in
899014a
+++ b/bin/tests/system/allow-query/ns2/named10.conf.in
899014a
@@ -12,7 +12,7 @@
899014a
 controls { /* empty */ };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/allow-query/ns2/named11.conf.in b/bin/tests/system/allow-query/ns2/named11.conf.in
01c5de4
index 166afa1..997ece9 100644
899014a
--- a/bin/tests/system/allow-query/ns2/named11.conf.in
899014a
+++ b/bin/tests/system/allow-query/ns2/named11.conf.in
899014a
@@ -12,12 +12,12 @@
899014a
 controls { /* empty */ };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
 key two {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234efgh8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/allow-query/ns2/named12.conf.in b/bin/tests/system/allow-query/ns2/named12.conf.in
01c5de4
index 25271a5..a9cb65d 100644
899014a
--- a/bin/tests/system/allow-query/ns2/named12.conf.in
899014a
+++ b/bin/tests/system/allow-query/ns2/named12.conf.in
899014a
@@ -12,7 +12,7 @@
899014a
 controls { /* empty */ };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/allow-query/ns2/named30.conf.in b/bin/tests/system/allow-query/ns2/named30.conf.in
01c5de4
index c7c8254..f165e65 100644
899014a
--- a/bin/tests/system/allow-query/ns2/named30.conf.in
899014a
+++ b/bin/tests/system/allow-query/ns2/named30.conf.in
899014a
@@ -12,7 +12,7 @@
899014a
 controls { /* empty */ };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/allow-query/ns2/named31.conf.in b/bin/tests/system/allow-query/ns2/named31.conf.in
01c5de4
index 567bbcc..4fd2035 100644
899014a
--- a/bin/tests/system/allow-query/ns2/named31.conf.in
899014a
+++ b/bin/tests/system/allow-query/ns2/named31.conf.in
899014a
@@ -12,12 +12,12 @@
899014a
 controls { /* empty */ };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
 key two {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234efgh8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/allow-query/ns2/named32.conf.in b/bin/tests/system/allow-query/ns2/named32.conf.in
01c5de4
index b75161f..7b254e6 100644
899014a
--- a/bin/tests/system/allow-query/ns2/named32.conf.in
899014a
+++ b/bin/tests/system/allow-query/ns2/named32.conf.in
899014a
@@ -12,7 +12,7 @@
899014a
 controls { /* empty */ };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/allow-query/ns2/named40.conf.in b/bin/tests/system/allow-query/ns2/named40.conf.in
01c5de4
index 9e17818..22f5001 100644
899014a
--- a/bin/tests/system/allow-query/ns2/named40.conf.in
899014a
+++ b/bin/tests/system/allow-query/ns2/named40.conf.in
899014a
@@ -16,12 +16,12 @@ acl accept { 10.53.0.2; };
899014a
 acl badaccept { 10.53.0.1; };
899014a
 
899014a
 key one {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
 key two {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "1234efgh8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/allow-query/tests.sh b/bin/tests/system/allow-query/tests.sh
01c5de4
index 791a1a4..95cd971 100644
899014a
--- a/bin/tests/system/allow-query/tests.sh
899014a
+++ b/bin/tests/system/allow-query/tests.sh
899014a
@@ -190,7 +190,7 @@ rndc_reload
899014a
 
899014a
 echo_i "test $n: key allowed - query allowed"
899014a
 ret=0
899014a
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
899014a
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
899014a
 if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
@@ -203,7 +203,7 @@ rndc_reload
899014a
 
899014a
 echo_i "test $n: key not allowed - query refused"
899014a
 ret=0
899014a
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
899014a
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
899014a
 if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
@@ -216,7 +216,7 @@ rndc_reload
899014a
 
899014a
 echo_i "test $n: key disallowed - query refused"
899014a
 ret=0
899014a
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
899014a
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
899014a
 if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
@@ -349,7 +349,7 @@ rndc_reload
899014a
 
899014a
 echo_i "test $n: views key allowed - query allowed"
899014a
 ret=0
899014a
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
899014a
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
899014a
 if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
@@ -362,7 +362,7 @@ rndc_reload
899014a
 
899014a
 echo_i "test $n: views key not allowed - query refused"
899014a
 ret=0
899014a
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
899014a
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
899014a
 if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
@@ -375,7 +375,7 @@ rndc_reload
899014a
 
899014a
 echo_i "test $n: views key disallowed - query refused"
899014a
 ret=0
899014a
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
899014a
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
899014a
 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
899014a
 if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
@@ -508,7 +508,7 @@ status=`expr $status + $ret`
899014a
 n=`expr $n + 1`
899014a
 echo_i "test $n: zone key allowed - query allowed"
899014a
 ret=0
899014a
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
899014a
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
899014a
 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
899014a
 grep '^a.keyallow.example' dig.out.ns2.$n > /dev/null || ret=1
899014a
 if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
@@ -518,7 +518,7 @@ status=`expr $status + $ret`
899014a
 n=`expr $n + 1`
899014a
 echo_i "test $n: zone key not allowed - query refused"
899014a
 ret=0
899014a
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
899014a
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:two:1234efgh8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
899014a
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
899014a
 grep '^a.keyallow.example' dig.out.ns2.$n > /dev/null && ret=1
899014a
 if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
@@ -528,7 +528,7 @@ status=`expr $status + $ret`
899014a
 n=`expr $n + 1`
899014a
 echo_i "test $n: zone key disallowed - query refused"
899014a
 ret=0
899014a
-$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.keydisallow.example a > dig.out.ns2.$n || ret=1
899014a
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y hmac-sha256:one:1234abcd8765 a.keydisallow.example a > dig.out.ns2.$n || ret=1
899014a
 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
899014a
 grep '^a.keydisallow.example' dig.out.ns2.$n > /dev/null && ret=1
899014a
 if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
diff --git a/bin/tests/system/catz/ns1/named.conf.in b/bin/tests/system/catz/ns1/named.conf.in
01c5de4
index 6856ec7..0ac1fa3 100644
899014a
--- a/bin/tests/system/catz/ns1/named.conf.in
899014a
+++ b/bin/tests/system/catz/ns1/named.conf.in
899014a
@@ -61,5 +61,5 @@ zone "catalog4.example" {
899014a
 
899014a
 key tsig_key. {
899014a
 	secret "LSAnCU+Z";
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 };
899014a
diff --git a/bin/tests/system/catz/ns2/named.conf.in b/bin/tests/system/catz/ns2/named.conf.in
01c5de4
index dd3a9dc..77b8d96 100644
899014a
--- a/bin/tests/system/catz/ns2/named.conf.in
899014a
+++ b/bin/tests/system/catz/ns2/named.conf.in
899014a
@@ -70,5 +70,5 @@ zone "catalog4.example" {
899014a
 
899014a
 key tsig_key. {
899014a
 	secret "LSAnCU+Z";
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 };
899014a
diff --git a/bin/tests/system/checkconf/bad-tsig.conf b/bin/tests/system/checkconf/bad-tsig.conf
01c5de4
index 338dddb..90cd424 100644
899014a
--- a/bin/tests/system/checkconf/bad-tsig.conf
899014a
+++ b/bin/tests/system/checkconf/bad-tsig.conf
899014a
@@ -11,7 +11,7 @@
899014a
 
899014a
 /* Bad secret */
899014a
 key "badtsig" {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha256;
899014a
 	secret "jEdD+BPKg==";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/checkconf/good.conf b/bin/tests/system/checkconf/good.conf
01c5de4
index 2282f87..1359cf3 100644
899014a
--- a/bin/tests/system/checkconf/good.conf
899014a
+++ b/bin/tests/system/checkconf/good.conf
745f43a
@@ -159,6 +159,6 @@ dyndb "name" "library.so" {
899014a
 	system;
899014a
 };
899014a
 key "mykey" {
899014a
-	algorithm "hmac-md5";
899014a
+	algorithm "hmac-sha256";
899014a
 	secret "qwertyuiopasdfgh";
899014a
 };
899014a
diff --git a/bin/tests/system/digdelv/ns2/example.db b/bin/tests/system/digdelv/ns2/example.db
01c5de4
index b66207a..359b220 100644
899014a
--- a/bin/tests/system/digdelv/ns2/example.db
899014a
+++ b/bin/tests/system/digdelv/ns2/example.db
899014a
@@ -38,12 +38,15 @@ foo			SSHFP	2 1 123456789abcdef67890123456789abcdef67890
899014a
 ;;
899014a
 ;; we are not testing DNSSEC behavior, so we don't care about the semantics
899014a
 ;; of the following records.
899014a
-dnskey                  300     DNSKEY  256 3 1 (
899014a
-                                        AQPTpWyReB/e9Ii6mVGnakS8hX2zkh/iUYAg
899014a
-                                        +Ge4noWROpTWOIBvm76zeJPWs4Zfqa1IsswD
899014a
-                                        Ix5Mqeg0zwclz59uecKsKyx5w9IhtZ8plc4R
899014a
-                                        b9VIE5x7KNHAYTvTO5d4S8M=
899014a
-                                        )
899014a
+dnskey                  300     DNSKEY 256 3 8 (
899014a
+                    AwEAAaWmCoDpj2K59zcpqnmnQM7IC/XbjS6jIP7uTBR4X7p1bdQJzAeo
899014a
+                    EnMhnpnxPp0j+20eZm4847DB2U+HuHy79Mvqd3aozTmfBJvzjKs9qyba
899014a
+                    zY/ZHn6BDYxNJiFfjSS/VJ1KuQPDbpCzhm2hbvT5s9nSOaG0WyRk+d+R
899014a
+                    qEca11E7ZKkmmNiGlyzMAgfmTTBwgxWBAAhvd9nU1GqD6eQ6Z63hpTc/
899014a
+                    KDIHnFTo7pOcZ4z5urIKUMCMcFytedETlEoR5CIWGPdQq2eIEEMfn5ld
899014a
+                    QqdEZRHVErD9og8aluJ2s767HZb8LzjCfYgBFoT9/n48T75oZLEKtSkG
899014a
+                    /idCeeQlaLU=
899014a
+                    )
899014a
 
899014a
 ; TTL of 3 weeks
899014a
 weeks		1814400	A	10.53.0.2
899014a
diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh
01c5de4
index 2109001..ded5557 100644
899014a
--- a/bin/tests/system/digdelv/tests.sh
899014a
+++ b/bin/tests/system/digdelv/tests.sh
745f43a
@@ -155,7 +155,7 @@ if [ -x "$DIG" ] ; then
899014a
   echo_i "checking dig +rrcomments works for DNSKEY($n)"
899014a
   ret=0
899014a
   $DIG $DIGOPTS +tcp @10.53.0.3 +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1
899014a
-  grep "; ZSK; alg = RSAMD5 ; key id = 30795" < dig.out.test$n > /dev/null || ret=1
899014a
+  grep "; ZSK; alg = RSASHA256 ; key id = 36895$" < dig.out.test$n > /dev/null || ret=1
2a46633
   check_ttl_range dig.out.test$n "DNSKEY" 300 || ret=1
899014a
   if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
   status=`expr $status + $ret`
745f43a
@@ -164,7 +164,7 @@ if [ -x "$DIG" ] ; then
899014a
   echo_i "checking dig +short +rrcomments works for DNSKEY ($n)"
899014a
   ret=0
899014a
   $DIG $DIGOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1
899014a
-  grep "; ZSK; alg = RSAMD5 ; key id = 30795" < dig.out.test$n > /dev/null || ret=1
899014a
+  grep "; ZSK; alg = RSASHA256 ; key id = 36895$" < dig.out.test$n > /dev/null || ret=1
899014a
   if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
   status=`expr $status + $ret`
899014a
 
745f43a
@@ -172,7 +172,7 @@ if [ -x "$DIG" ] ; then
899014a
   echo_i "checking dig +short +nosplit works($n)"
899014a
   ret=0
899014a
   $DIG $DIGOPTS +tcp @10.53.0.3 +short +nosplit DNSKEY dnskey.example > dig.out.test$n || ret=1
899014a
-  grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=$" < dig.out.test$n > /dev/null || ret=1
899014a
+  grep "T9/n48T75oZLEKtSkG/idCeeQlaLU=$" < dig.out.test$n > /dev/null || ret=1
899014a
   if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
   status=`expr $status + $ret`
899014a
 
745f43a
@@ -180,7 +180,7 @@ if [ -x "$DIG" ] ; then
899014a
   echo_i "checking dig +short +rrcomments works($n)"
899014a
   ret=0
899014a
   $DIG $DIGOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1
899014a
-  grep "S8M=  ; ZSK; alg = RSAMD5 ; key id = 30795$" < dig.out.test$n > /dev/null || ret=1
899014a
+  grep "aLU=  ; ZSK; alg = RSASHA256 ; key id = 36895$" < dig.out.test$n > /dev/null || ret=1
899014a
   if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
   status=`expr $status + $ret`
899014a
 
745f43a
@@ -197,7 +197,7 @@ if [ -x "$DIG" ] ; then
899014a
   echo_i "checking dig +short +rrcomments works($n)"
899014a
   ret=0
899014a
   $DIG $DIGOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1
899014a
-  grep "S8M=  ; ZSK; alg = RSAMD5 ; key id = 30795$" < dig.out.test$n > /dev/null || ret=1
899014a
+  grep "aLU=  ; ZSK; alg = RSASHA256 ; key id = 36895$" < dig.out.test$n > /dev/null || ret=1
899014a
   if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
   status=`expr $status + $ret`
899014a
 
01c5de4
@@ -827,7 +827,7 @@ if [ -x ${DELV} ] ; then
899014a
   echo_i "checking delv +rrcomments works for DNSKEY($n)"
899014a
   ret=0
899014a
   $DELV $DELVOPTS +tcp @10.53.0.3 +rrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1
899014a
-  grep "; ZSK; alg = RSAMD5 ; key id = 30795" < delv.out.test$n > /dev/null || ret=1
899014a
+  grep "; ZSK; alg = RSASHA256 ; key id = 36895" < delv.out.test$n > /dev/null || ret=1
2a46633
   check_ttl_range delv.out.test$n "DNSKEY" 300 || ret=1
899014a
   if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
   status=`expr $status + $ret`
01c5de4
@@ -836,7 +836,7 @@ if [ -x ${DELV} ] ; then
899014a
   echo_i "checking delv +short +rrcomments works for DNSKEY ($n)"
899014a
   ret=0
899014a
   $DELV $DELVOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1
899014a
-  grep "; ZSK; alg = RSAMD5 ; key id = 30795" < delv.out.test$n > /dev/null || ret=1
899014a
+  grep "; ZSK; alg = RSASHA256 ; key id = 36895" < delv.out.test$n > /dev/null || ret=1
899014a
   if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
   status=`expr $status + $ret`
899014a
 
01c5de4
@@ -844,7 +844,7 @@ if [ -x ${DELV} ] ; then
899014a
   echo_i "checking delv +short +rrcomments works ($n)"
899014a
   ret=0
899014a
   $DELV $DELVOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1
899014a
-  grep "S8M=  ; ZSK; alg = RSAMD5 ; key id = 30795$" < delv.out.test$n > /dev/null || ret=1
899014a
+  grep "aLU=  ; ZSK; alg = RSASHA256 ; key id = 36895$" < delv.out.test$n > /dev/null || ret=1
899014a
   if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
   status=`expr $status + $ret`
899014a
 
01c5de4
@@ -852,7 +852,7 @@ if [ -x ${DELV} ] ; then
899014a
   echo_i "checking delv +short +nosplit works ($n)"
899014a
   ret=0
899014a
   $DELV $DELVOPTS +tcp @10.53.0.3 +short +nosplit DNSKEY dnskey.example > delv.out.test$n || ret=1
899014a
-  grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=" < delv.out.test$n > /dev/null || ret=1
899014a
+  grep "T9/n48T75oZLEKtSkG/idCeeQlaLU=" < delv.out.test$n > /dev/null || ret=1
899014a
   if test `wc -l < delv.out.test$n` != 1 ; then ret=1 ; fi
899014a
   f=`awk '{print NF}' < delv.out.test$n`
899014a
   test "${f:-0}" -eq 14 || ret=1
01c5de4
@@ -863,7 +863,7 @@ if [ -x ${DELV} ] ; then
899014a
   echo_i "checking delv +short +nosplit +norrcomments works ($n)"
899014a
   ret=0
899014a
   $DELV $DELVOPTS +tcp @10.53.0.3 +short +nosplit +norrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1
899014a
-  grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=$" < delv.out.test$n > /dev/null || ret=1
899014a
+  grep "T9/n48T75oZLEKtSkG/idCeeQlaLU=$" < delv.out.test$n > /dev/null || ret=1
899014a
   if test `wc -l < delv.out.test$n` != 1 ; then ret=1 ; fi
899014a
   f=`awk '{print NF}' < delv.out.test$n`
899014a
   test "${f:-0}" -eq 4 || ret=1
899014a
diff --git a/bin/tests/system/dlv/ns1/sign.sh b/bin/tests/system/dlv/ns1/sign.sh
01c5de4
index 14ca5db..3f522d0 100755
899014a
--- a/bin/tests/system/dlv/ns1/sign.sh
899014a
+++ b/bin/tests/system/dlv/ns1/sign.sh
899014a
@@ -23,8 +23,8 @@ infile=root.db.in
899014a
 zonefile=root.db
899014a
 outfile=root.signed
899014a
 
2a46633
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
2a46633
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
diff --git a/bin/tests/system/dlv/ns2/sign.sh b/bin/tests/system/dlv/ns2/sign.sh
01c5de4
index d870798..b0ab372 100755
899014a
--- a/bin/tests/system/dlv/ns2/sign.sh
899014a
+++ b/bin/tests/system/dlv/ns2/sign.sh
899014a
@@ -24,8 +24,8 @@ zonefile=druz.db
899014a
 outfile=druz.pre
899014a
 dlvzone=utld.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` 
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null` 
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
diff --git a/bin/tests/system/dlv/ns6/sign.sh b/bin/tests/system/dlv/ns6/sign.sh
01c5de4
index ba39f90..f20a2dd 100755
899014a
--- a/bin/tests/system/dlv/ns6/sign.sh
899014a
+++ b/bin/tests/system/dlv/ns6/sign.sh
899014a
@@ -16,13 +16,15 @@ SYSTESTDIR=dlv
899014a
 
899014a
 echo_i "dlv/ns6/sign.sh"
899014a
 
899014a
+bits=1024
899014a
+
899014a
 zone=grand.child1.utld.
899014a
 infile=child.db.in
899014a
 zonefile=grand.child1.utld.db
899014a
 outfile=grand.child1.signed
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -36,8 +38,8 @@ zonefile=grand.child3.utld.db
899014a
 outfile=grand.child3.signed
899014a
 dlvzone=dlv.utld.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -51,8 +53,8 @@ zonefile=grand.child4.utld.db
899014a
 outfile=grand.child4.signed
899014a
 dlvzone=dlv.utld.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -66,8 +68,8 @@ zonefile=grand.child5.utld.db
899014a
 outfile=grand.child5.signed
899014a
 dlvzone=dlv.utld.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -81,8 +83,8 @@ zonefile=grand.child7.utld.db
899014a
 outfile=grand.child7.signed
899014a
 dlvzone=dlv.utld.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -96,8 +98,8 @@ zonefile=grand.child8.utld.db
899014a
 outfile=grand.child8.signed
899014a
 dlvzone=dlv.utld.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -111,8 +113,8 @@ zonefile=grand.child9.utld.db
899014a
 outfile=grand.child9.signed
899014a
 dlvzone=dlv.utld.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -125,8 +127,8 @@ zonefile=grand.child10.utld.db
899014a
 outfile=grand.child10.signed
899014a
 dlvzone=dlv.utld.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -138,8 +140,8 @@ infile=child.db.in
899014a
 zonefile=grand.child1.druz.db
899014a
 outfile=grand.child1.druz.signed
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -153,8 +155,8 @@ zonefile=grand.child3.druz.db
899014a
 outfile=grand.child3.druz.signed
899014a
 dlvzone=dlv.druz.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -168,8 +170,8 @@ zonefile=grand.child4.druz.db
899014a
 outfile=grand.child4.druz.signed
899014a
 dlvzone=dlv.druz.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -183,8 +185,8 @@ zonefile=grand.child5.druz.db
899014a
 outfile=grand.child5.druz.signed
899014a
 dlvzone=dlv.druz.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -198,8 +200,8 @@ zonefile=grand.child7.druz.db
899014a
 outfile=grand.child7.druz.signed
899014a
 dlvzone=dlv.druz.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -213,8 +215,8 @@ zonefile=grand.child8.druz.db
899014a
 outfile=grand.child8.druz.signed
899014a
 dlvzone=dlv.druz.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -228,8 +230,8 @@ zonefile=grand.child9.druz.db
899014a
 outfile=grand.child9.druz.signed
899014a
 dlvzone=dlv.druz.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
@@ -242,8 +244,8 @@ zonefile=grand.child10.druz.db
899014a
 outfile=grand.child10.druz.signed
899014a
 dlvzone=dlv.druz.
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
diff --git a/bin/tests/system/dnssec/ns2/sign.sh b/bin/tests/system/dnssec/ns2/sign.sh
01c5de4
index e28b3f1..29c169b 100644
899014a
--- a/bin/tests/system/dnssec/ns2/sign.sh
899014a
+++ b/bin/tests/system/dnssec/ns2/sign.sh
2a46633
@@ -126,8 +126,8 @@ zone=in-addr.arpa.
899014a
 infile=in-addr.arpa.db.in
899014a
 zonefile=in-addr.arpa.db
899014a
 
899014a
-keyname1=`$KEYGEN -q -r $RANDFILE -a DSA -b 768 -n zone $zone`
899014a
-keyname2=`$KEYGEN -q -r $RANDFILE -a DSA -b 768 -n zone $zone`
899014a
+keyname1=`$KEYGEN -q -r $RANDFILE -a DSA -b 1024 -n zone $zone`
899014a
+keyname2=`$KEYGEN -q -r $RANDFILE -a DSA -b 1024 -n zone $zone`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 $SIGNER -P -g -r $RANDFILE -o $zone -k $keyname1 $zonefile $keyname2 > /dev/null
2a46633
@@ -138,7 +138,7 @@ privzone=private.secure.example
899014a
 privinfile=private.secure.example.db.in
899014a
 privzonefile=private.secure.example.db
899014a
 
899014a
-privkeyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $privzone`
899014a
+privkeyname=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 1024 -n zone $privzone`
899014a
 
899014a
 cat $privinfile $privkeyname.key >$privzonefile
899014a
 
2a46633
@@ -152,7 +152,7 @@ dlvinfile=dlv.db.in
899014a
 dlvzonefile=dlv.db
2a46633
 dlvsetfile=dlvset-${privzone}${TP}
899014a
 
899014a
-dlvkeyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $dlvzone`
899014a
+dlvkeyname=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 1024 -n zone $dlvzone`
899014a
 
899014a
 cat $dlvinfile $dlvkeyname.key $dlvsetfile > $dlvzonefile
899014a
 
899014a
diff --git a/bin/tests/system/dnssec/ns5/trusted.conf.bad b/bin/tests/system/dnssec/ns5/trusted.conf.bad
01c5de4
index 75cf699..b4d848c 100644
899014a
--- a/bin/tests/system/dnssec/ns5/trusted.conf.bad
899014a
+++ b/bin/tests/system/dnssec/ns5/trusted.conf.bad
899014a
@@ -10,5 +10,5 @@
899014a
  */
899014a
 
899014a
 trusted-keys {
899014a
-    "." 256 3 1 "AQO6Cl+slAf+iuieDim9L3kujFHQD7s/IOj03ClMOpKYcTXtK4mRpuULVfvWxDi9Ew/gj0xLnnX7z9OJHIxLI+DSrAHd8Dm0XfBEAtVtJSn70GaPZgnLMw1rk5ap2DsEoWk=";
899014a
+    "." 256 3 8 "AwEAAarwAdjV4gIhpBCjXVAScRFEx3co7k8smJdxrnqoGsl5NB7EZ9jRdgvCXbJn6v8y9jlNWVHvaC8ilhfhLh0A1vLWiWv4ijd/12xcnrY7xpG7Cu3YkxUxaXJ7Jdg/Iw1+9mGgXF1v4UbCIcw/3U3cxyk7OxYg+VSb5KBAQSR0upxV";
899014a
 };
899014a
diff --git a/bin/tests/system/dnssec/tests.sh b/bin/tests/system/dnssec/tests.sh
01c5de4
index 3e8e4d5..da692f9 100644
899014a
--- a/bin/tests/system/dnssec/tests.sh
899014a
+++ b/bin/tests/system/dnssec/tests.sh
745f43a
@@ -3257,8 +3257,8 @@ do
899014a
 	   alg=`expr $alg + 1`
899014a
 	   continue;;
899014a
 	3) size="-b 512";;
899014a
-	5) size="-b 512";;
899014a
-	6) size="-b 512";;
899014a
+	5) size="-b 1024";;
899014a
+	6) size="-b 1024";;
899014a
 	7) size="-b 512";;
899014a
 	8) size="-b 512";;
899014a
 	10) size="-b 1024";;
899014a
diff --git a/bin/tests/system/feature-test.c b/bin/tests/system/feature-test.c
01c5de4
index 5e473ab..b08692e 100644
899014a
--- a/bin/tests/system/feature-test.c
899014a
+++ b/bin/tests/system/feature-test.c
899014a
@@ -19,6 +19,7 @@
899014a
 #include <isc/print.h>
899014a
 #include <isc/util.h>
899014a
 #include <isc/net.h>
899014a
+#include <isc/md5.h>
899014a
 #include <dns/edns.h>
899014a
 
899014a
 #ifdef WIN32
843e5f5
@@ -47,6 +48,7 @@ usage() {
01c5de4
 	fprintf(stderr, "\t--have-geoip\n");
01c5de4
 	fprintf(stderr, "\t--have-libxml2\n");
01c5de4
 	fprintf(stderr, "\t--ipv6only=no\n");
01c5de4
+	fprintf(stderr, "\t--md5\n");
01c5de4
 	fprintf(stderr, "\t--rpz-log-qtype-qclass\n");
01c5de4
 	fprintf(stderr, "\t--rpz-nsdname\n");
01c5de4
 	fprintf(stderr, "\t--rpz-nsip\n");
01c5de4
@@ -194,6 +196,18 @@ main(int argc, char **argv) {
899014a
 #endif
899014a
 	}
899014a
 
899014a
+	if (strcmp(argv[1], "--md5") == 0) {
899014a
+#ifdef PK11_MD5_DISABLE
899014a
+		return (1);
899014a
+#else
899014a
+		if (isc_md5_available()) {
899014a
+			return (0);
899014a
+		} else {
899014a
+			return (1);
899014a
+		}
899014a
+#endif
899014a
+	}
899014a
+
899014a
 	if (strcmp(argv[1], "--rpz-nsip") == 0) {
899014a
 #ifdef ENABLE_RPZ_NSIP
899014a
 		return (0);
899014a
diff --git a/bin/tests/system/filter-aaaa/ns1/sign.sh b/bin/tests/system/filter-aaaa/ns1/sign.sh
01c5de4
index 479f98c..4d4a765 100755
899014a
--- a/bin/tests/system/filter-aaaa/ns1/sign.sh
899014a
+++ b/bin/tests/system/filter-aaaa/ns1/sign.sh
899014a
@@ -21,8 +21,8 @@ infile=signed.db.in
899014a
 zonefile=signed.db.signed
899014a
 outfile=signed.db.signed
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
diff --git a/bin/tests/system/filter-aaaa/ns4/sign.sh b/bin/tests/system/filter-aaaa/ns4/sign.sh
01c5de4
index 479f98c..4d4a765 100755
899014a
--- a/bin/tests/system/filter-aaaa/ns4/sign.sh
899014a
+++ b/bin/tests/system/filter-aaaa/ns4/sign.sh
899014a
@@ -21,8 +21,8 @@ infile=signed.db.in
899014a
 zonefile=signed.db.signed
899014a
 outfile=signed.db.signed
899014a
 
899014a
-keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
-keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null`
899014a
+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null`
899014a
+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null`
899014a
 
899014a
 cat $infile $keyname1.key $keyname2.key >$zonefile
899014a
 
899014a
diff --git a/bin/tests/system/notify/ns5/named.conf.in b/bin/tests/system/notify/ns5/named.conf.in
01c5de4
index 157ef16..b802288 100644
899014a
--- a/bin/tests/system/notify/ns5/named.conf.in
899014a
+++ b/bin/tests/system/notify/ns5/named.conf.in
899014a
@@ -10,17 +10,17 @@
899014a
  */
899014a
 
899014a
 key "a" {
899014a
-	algorithm "hmac-md5";
899014a
+	algorithm "hmac-sha256";
899014a
 	secret "aaaaaaaaaaaaaaaaaaaa";
899014a
 };
899014a
 
899014a
 key "b" {
899014a
-	algorithm "hmac-md5";
899014a
+	algorithm "hmac-sha256";
899014a
 	secret "bbbbbbbbbbbbbbbbbbbb";
899014a
 };
899014a
 
899014a
 key "c" {
899014a
-	algorithm "hmac-md5";
899014a
+	algorithm "hmac-sha256";
899014a
 	secret "cccccccccccccccccccc";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/notify/tests.sh b/bin/tests/system/notify/tests.sh
01c5de4
index f9fd3f5..916af75 100644
899014a
--- a/bin/tests/system/notify/tests.sh
899014a
+++ b/bin/tests/system/notify/tests.sh
1e41691
@@ -212,16 +212,16 @@ ret=0
899014a
 $NSUPDATE << EOF
899014a
 server 10.53.0.5 ${PORT}
899014a
 zone x21
899014a
-key a aaaaaaaaaaaaaaaaaaaa
899014a
+key hmac-sha256:a aaaaaaaaaaaaaaaaaaaa
899014a
 update add added.x21 0 in txt "test string"
899014a
 send
899014a
 EOF
899014a
 
899014a
 for i in 1 2 3 4 5 6 7 8 9
899014a
 do
899014a
-	$DIG $DIGOPTS added.x21. -y b:bbbbbbbbbbbbbbbbbbbb @10.53.0.5 \
899014a
+	$DIG $DIGOPTS added.x21. -y hmac-sha256:b:bbbbbbbbbbbbbbbbbbbb @10.53.0.5 \
899014a
 		txt > dig.out.b.ns5.test$n || ret=1
899014a
-	$DIG $DIGOPTS added.x21. -y c:cccccccccccccccccccc @10.53.0.5 \
899014a
+	$DIG $DIGOPTS added.x21. -y hmac-sha256:c:cccccccccccccccccccc @10.53.0.5 \
899014a
 		txt > dig.out.c.ns5.test$n || ret=1
899014a
 	grep "test string" dig.out.b.ns5.test$n > /dev/null &&
899014a
 	grep "test string" dig.out.c.ns5.test$n > /dev/null &&
899014a
diff --git a/bin/tests/system/nsupdate/ns1/named.conf.in b/bin/tests/system/nsupdate/ns1/named.conf.in
01c5de4
index b0ded3a..cb80269 100644
899014a
--- a/bin/tests/system/nsupdate/ns1/named.conf.in
899014a
+++ b/bin/tests/system/nsupdate/ns1/named.conf.in
899014a
@@ -32,7 +32,7 @@ controls {
899014a
 };
899014a
 
899014a
 key altkey {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha512;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/nsupdate/ns2/named.conf.in b/bin/tests/system/nsupdate/ns2/named.conf.in
01c5de4
index e6e2382..b0a94e0 100644
899014a
--- a/bin/tests/system/nsupdate/ns2/named.conf.in
899014a
+++ b/bin/tests/system/nsupdate/ns2/named.conf.in
1e41691
@@ -33,7 +33,7 @@ controls {
899014a
 };
899014a
 
899014a
 key altkey {
899014a
-	algorithm hmac-md5;
899014a
+	algorithm hmac-sha512;
899014a
 	secret "1234abcd8765";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/nsupdate/setup.sh b/bin/tests/system/nsupdate/setup.sh
01c5de4
index 6fbf1d7..a712b17 100644
899014a
--- a/bin/tests/system/nsupdate/setup.sh
899014a
+++ b/bin/tests/system/nsupdate/setup.sh
745f43a
@@ -53,7 +53,12 @@ EOF
899014a
 
899014a
 $DDNSCONFGEN -q -r $RANDFILE -z example.nil > ns1/ddns.key
899014a
 
899014a
-$DDNSCONFGEN -q -r $RANDFILE -a hmac-md5 -k md5-key -z keytests.nil > ns1/md5.key
899014a
+if $FEATURETEST --md5; then
899014a
+	$DDNSCONFGEN -q -r $RANDFILE -a hmac-md5 -k md5-key -z keytests.nil > ns1/md5.key
899014a
+else
899014a
+	echo -n > ns1/md5.key
899014a
+fi
899014a
+
899014a
 $DDNSCONFGEN -q -r $RANDFILE -a hmac-sha1 -k sha1-key -z keytests.nil > ns1/sha1.key
899014a
 $DDNSCONFGEN -q -r $RANDFILE -a hmac-sha224 -k sha224-key -z keytests.nil > ns1/sha224.key
899014a
 $DDNSCONFGEN -q -r $RANDFILE -a hmac-sha256 -k sha256-key -z keytests.nil > ns1/sha256.key
899014a
diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh
01c5de4
index 6b2c8f6..96ad95e 100755
899014a
--- a/bin/tests/system/nsupdate/tests.sh
899014a
+++ b/bin/tests/system/nsupdate/tests.sh
01c5de4
@@ -788,7 +788,14 @@ fi
899014a
 n=`expr $n + 1`
899014a
 ret=0
899014a
 echo_i "check TSIG key algorithms ($n)"
899014a
-for alg in md5 sha1 sha224 sha256 sha384 sha512; do
899014a
+if $FEATURETEST --md5
899014a
+then
899014a
+	ALGS="md5 sha1 sha224 sha256 sha384 sha512"
899014a
+else
899014a
+	ALGS="sha1 sha224 sha256 sha384 sha512"
899014a
+	echo_i "skipping disabled md5 algorithm"
899014a
+fi
899014a
+for alg in $ALGS; do
899014a
     $NSUPDATE -k ns1/${alg}.key <<END > /dev/null || ret=1
899014a
 server 10.53.0.1 ${PORT}
899014a
 update add ${alg}.keytests.nil. 600 A 10.10.10.3
01c5de4
@@ -796,7 +803,7 @@ send
899014a
 END
899014a
 done
899014a
 sleep 2
899014a
-for alg in md5 sha1 sha224 sha256 sha384 sha512; do
899014a
+for alg in $ALGS; do
899014a
     $DIG $DIGOPTS +short @10.53.0.1 ${alg}.keytests.nil | grep 10.10.10.3 > /dev/null 2>&1 || ret=1
899014a
 done
899014a
 if [ $ret -ne 0 ]; then
899014a
diff --git a/bin/tests/system/rndc/setup.sh b/bin/tests/system/rndc/setup.sh
01c5de4
index 2eb2cd5..36f5114 100644
899014a
--- a/bin/tests/system/rndc/setup.sh
899014a
+++ b/bin/tests/system/rndc/setup.sh
745f43a
@@ -35,7 +35,7 @@ make_key () {
899014a
             sed 's/allow { 10.53.0.4/allow { any/' >> ns4/named.conf
899014a
 }
899014a
 
899014a
-make_key 1 ${EXTRAPORT1} hmac-md5
899014a
+$FEATURETEST --md5 && make_key 1 ${EXTRAPORT1} hmac-md5
899014a
 make_key 2 ${EXTRAPORT2} hmac-sha1
899014a
 make_key 3 ${EXTRAPORT3} hmac-sha224
899014a
 make_key 4 ${EXTRAPORT4} hmac-sha256
899014a
diff --git a/bin/tests/system/rndc/tests.sh b/bin/tests/system/rndc/tests.sh
01c5de4
index 4e25e51..cb8934c 100644
899014a
--- a/bin/tests/system/rndc/tests.sh
899014a
+++ b/bin/tests/system/rndc/tests.sh
843e5f5
@@ -348,15 +348,20 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
 status=`expr $status + $ret`
899014a
 
899014a
 n=`expr $n + 1`
899014a
-echo_i "testing rndc with hmac-md5 ($n)"
899014a
-ret=0
899014a
-$RNDC -s 10.53.0.4 -p ${EXTRAPORT1} -c ns4/key1.conf status > /dev/null 2>&1 || ret=1
899014a
-for i in 2 3 4 5 6
899014a
-do
899014a
-        $RNDC -s 10.53.0.4 -p ${EXTRAPORT1} -c ns4/key${i}.conf status > /dev/null 2>&1 && ret=1
899014a
-done
899014a
-if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
-status=`expr $status + $ret`
899014a
+if $FEATURETEST --md5
899014a
+then
899014a
+	echo_i "testing rndc with hmac-md5 ($n)"
899014a
+	ret=0
899014a
+	$RNDC -s 10.53.0.4 -p ${EXTRAPORT1} -c ns4/key1.conf status > /dev/null 2>&1 || ret=1
899014a
+	for i in 2 3 4 5 6
899014a
+	do
899014a
+		$RNDC -s 10.53.0.4 -p ${EXTRAPORT1} -c ns4/key${i}.conf status > /dev/null 2>&1 && ret=1
899014a
+	done
899014a
+	if [ $ret != 0 ]; then echo_i "failed"; fi
899014a
+	status=`expr $status + $ret`
899014a
+else
899014a
+	echo_i "skipping rndc with hmac-md5 ($n)"
899014a
+fi
899014a
 
899014a
 n=`expr $n + 1`
899014a
 echo_i "testing rndc with hmac-sha1 ($n)"
899014a
diff --git a/bin/tests/system/tsig/ns1/named.conf.in b/bin/tests/system/tsig/ns1/named.conf.in
01c5de4
index 4905ffd..958d9fb 100644
899014a
--- a/bin/tests/system/tsig/ns1/named.conf.in
899014a
+++ b/bin/tests/system/tsig/ns1/named.conf.in
899014a
@@ -21,10 +21,7 @@ options {
899014a
 	notify no;
899014a
 };
899014a
 
899014a
-key "md5" {
899014a
-	secret "97rnFx24Tfna4mHPfgnerA==";
899014a
-	algorithm hmac-md5;
899014a
-};
899014a
+# md5 key appended by setup.sh at the end
899014a
 
899014a
 key "sha1" {
899014a
 	secret "FrSt77yPTFx6hTs4i2tKLB9LmE0=";
899014a
@@ -51,10 +48,7 @@ key "sha512" {
899014a
 	algorithm hmac-sha512;
899014a
 };
899014a
 
899014a
-key "md5-trunc" {
899014a
-	secret "97rnFx24Tfna4mHPfgnerA==";
899014a
-	algorithm hmac-md5-80;
899014a
-};
899014a
+# md5-trunc key appended by setup.sh at the end
899014a
 
899014a
 key "sha1-trunc" {
899014a
 	secret "FrSt77yPTFx6hTs4i2tKLB9LmE0=";
899014a
diff --git a/bin/tests/system/tsig/setup.sh b/bin/tests/system/tsig/setup.sh
01c5de4
index f42aa79..bfcf4a6 100644
899014a
--- a/bin/tests/system/tsig/setup.sh
899014a
+++ b/bin/tests/system/tsig/setup.sh
745f43a
@@ -15,3 +15,8 @@ SYSTEMTESTTOP=..
899014a
 copy_setports ns1/named.conf.in ns1/named.conf
899014a
 
1e41691
 test -r $RANDFILE || $GENRANDOM $RANDOMSIZE $RANDFILE
1e41691
+
899014a
+if $FEATURETEST --md5
899014a
+then
899014a
+	cat ns1/rndc5.conf.in >> ns1/named.conf
899014a
+fi
899014a
diff --git a/bin/tests/system/tsig/tests.sh b/bin/tests/system/tsig/tests.sh
01c5de4
index ed41e1d..98c542e 100644
899014a
--- a/bin/tests/system/tsig/tests.sh
899014a
+++ b/bin/tests/system/tsig/tests.sh
899014a
@@ -26,20 +26,25 @@ sha512="jI/Pa4qRu96t76Pns5Z/Ndxbn3QCkwcxLOgt9vgvnJw5wqTRvNyk3FtD6yIMd1dWVlqZ+Y4f
899014a
 
899014a
 status=0
899014a
 
899014a
-echo_i "fetching using hmac-md5 (old form)"
899014a
-ret=0
899014a
-$DIG $DIGOPTS example.nil. -y "md5:$md5" @10.53.0.1 soa > dig.out.md5.old || ret=1
899014a
-grep -i "md5.*TSIG.*NOERROR" dig.out.md5.old > /dev/null || ret=1
899014a
-if [ $ret -eq 1 ] ; then
899014a
-	echo_i "failed"; status=1
899014a
-fi
899014a
+if $FEATURETEST --md5
899014a
+then
899014a
+	echo_i "fetching using hmac-md5 (old form)"
899014a
+	ret=0
899014a
+	$DIG $DIGOPTS example.nil. -y "md5:$md5" @10.53.0.1 soa > dig.out.md5.old || ret=1
899014a
+	grep -i "md5.*TSIG.*NOERROR" dig.out.md5.old > /dev/null || ret=1
899014a
+	if [ $ret -eq 1 ] ; then
899014a
+		echo_i "failed"; status=1
899014a
+	fi
745f43a
 
745f43a
-echo_i "fetching using hmac-md5 (new form)"
745f43a
-ret=0
745f43a
-$DIG $DIGOPTS example.nil. -y "hmac-md5:md5:$md5" @10.53.0.1 soa > dig.out.md5.new || ret=1
745f43a
-grep -i "md5.*TSIG.*NOERROR" dig.out.md5.new > /dev/null || ret=1
745f43a
-if [ $ret -eq 1 ] ; then
745f43a
-	echo_i "failed"; status=1
899014a
+	echo_i "fetching using hmac-md5 (new form)"
899014a
+	ret=0
899014a
+	$DIG $DIGOPTS example.nil. -y "hmac-md5:md5:$md5" @10.53.0.1 soa > dig.out.md5.new || ret=1
899014a
+	grep -i "md5.*TSIG.*NOERROR" dig.out.md5.new > /dev/null || ret=1
899014a
+	if [ $ret -eq 1 ] ; then
899014a
+		echo_i "failed"; status=1
899014a
+	fi
899014a
+else
899014a
+	echo_i "skipping using hmac-md5"
899014a
 fi
899014a
 
899014a
 echo_i "fetching using hmac-sha1"
899014a
@@ -87,12 +92,17 @@ fi
899014a
 #	Truncated TSIG
899014a
 #
899014a
 #
899014a
-echo_i "fetching using hmac-md5 (trunc)"
899014a
-ret=0
899014a
-$DIG $DIGOPTS example.nil. -y "hmac-md5-80:md5-trunc:$md5" @10.53.0.1 soa > dig.out.md5.trunc || ret=1
899014a
-grep -i "md5-trunc.*TSIG.*NOERROR" dig.out.md5.trunc > /dev/null || ret=1
899014a
-if [ $ret -eq 1 ] ; then
899014a
-	echo_i "failed"; status=1
899014a
+if $FEATURETEST --md5
899014a
+then
899014a
+	echo_i "fetching using hmac-md5 (trunc)"
899014a
+	ret=0
899014a
+	$DIG $DIGOPTS example.nil. -y "hmac-md5-80:md5-trunc:$md5" @10.53.0.1 soa > dig.out.md5.trunc || ret=1
899014a
+	grep -i "md5-trunc.*TSIG.*NOERROR" dig.out.md5.trunc > /dev/null || ret=1
899014a
+	if [ $ret -eq 1 ] ; then
899014a
+		echo_i "failed"; status=1
899014a
+	fi
899014a
+else
899014a
+	echo_i "skipping using hmac-md5 (trunc)"
899014a
 fi
899014a
 
899014a
 echo_i "fetching using hmac-sha1 (trunc)"
899014a
@@ -141,12 +151,17 @@ fi
899014a
 #	Check for bad truncation.
899014a
 #
899014a
 #
899014a
-echo_i "fetching using hmac-md5-80 (BADTRUNC)"
899014a
-ret=0
899014a
-$DIG $DIGOPTS example.nil. -y "hmac-md5-80:md5:$md5" @10.53.0.1 soa > dig.out.md5-80 || ret=1
899014a
-grep -i "md5.*TSIG.*BADTRUNC" dig.out.md5-80 > /dev/null || ret=1
899014a
-if [ $ret -eq 1 ] ; then
899014a
-	echo_i "failed"; status=1
899014a
+if $FEATURETEST --md5
899014a
+then
899014a
+	echo_i "fetching using hmac-md5-80 (BADTRUNC)" 
899014a
+	ret=0
899014a
+	$DIG $DIGOPTS example.nil. -y "hmac-md5-80:md5:$md5" @10.53.0.1 soa > dig.out.md5-80 || ret=1
899014a
+	grep -i "md5.*TSIG.*BADTRUNC" dig.out.md5-80 > /dev/null || ret=1
899014a
+	if [ $ret -eq 1 ] ; then
899014a
+		echo_i "failed"; status=1
899014a
+	fi
899014a
+else
899014a
+	echo_i "skipping using hmac-md5-80 (BADTRUNC)" 
899014a
 fi
899014a
 
899014a
 echo_i "fetching using hmac-sha1-80 (BADTRUNC)"
899014a
diff --git a/bin/tests/system/tsiggss/setup.sh b/bin/tests/system/tsiggss/setup.sh
01c5de4
index f04c907..09da5f9 100644
899014a
--- a/bin/tests/system/tsiggss/setup.sh
899014a
+++ b/bin/tests/system/tsiggss/setup.sh
745f43a
@@ -16,5 +16,5 @@ test -r $RANDFILE || $GENRANDOM $RANDOMSIZE $RANDFILE
899014a
 
899014a
 copy_setports ns1/named.conf.in ns1/named.conf
899014a
 
899014a
-key=`$KEYGEN -Cq -K ns1 -a DSA -b 512 -r $RANDFILE -n HOST -T KEY key.example.nil.`
899014a
+key=`$KEYGEN -Cq -K ns1 -a DSA -b 1024 -r $RANDFILE -n HOST -T KEY key.example.nil.`
899014a
 cat ns1/example.nil.db.in ns1/${key}.key > ns1/example.nil.db
899014a
diff --git a/bin/tests/system/upforwd/ns1/named.conf.in b/bin/tests/system/upforwd/ns1/named.conf.in
01c5de4
index 4ddd7a4..238f52a 100644
899014a
--- a/bin/tests/system/upforwd/ns1/named.conf.in
899014a
+++ b/bin/tests/system/upforwd/ns1/named.conf.in
899014a
@@ -10,7 +10,7 @@
899014a
  */
899014a
 
899014a
 key "update.example." {
899014a
-	algorithm "hmac-md5";
899014a
+	algorithm "hmac-sha256";
899014a
 	secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
899014a
 };
899014a
 
899014a
diff --git a/bin/tests/system/upforwd/tests.sh b/bin/tests/system/upforwd/tests.sh
01c5de4
index 1cf8d3b..f4c3216 100644
899014a
--- a/bin/tests/system/upforwd/tests.sh
899014a
+++ b/bin/tests/system/upforwd/tests.sh
899014a
@@ -68,7 +68,7 @@ if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
899014a
 
899014a
 echo_i "updating zone (signed) ($n)"
899014a
 ret=0
899014a
-$NSUPDATE -y update.example:c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K -- - <
899014a
+$NSUPDATE -y hmac-sha256:update.example:c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K -- - <
899014a
 server 10.53.0.3 ${PORT}
899014a
 update add updated.example. 600 A 10.10.10.1
899014a
 update add updated.example. 600 TXT Foo
899014a
-- 
745f43a
2.26.2
899014a