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