]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check deprecated algorithms in dnssec-policy
authorMark Andrews <marka@isc.org>
Mon, 30 Jun 2025 05:56:21 +0000 (15:56 +1000)
committerMark Andrews <marka@isc.org>
Tue, 15 Jul 2025 13:53:57 +0000 (23:53 +1000)
bin/tests/system/checkconf/kasp-deprecated-fips.conf [new file with mode: 0644]
bin/tests/system/checkconf/kasp-deprecated.conf [new file with mode: 0644]
bin/tests/system/checkconf/tests.sh

diff --git a/bin/tests/system/checkconf/kasp-deprecated-fips.conf b/bin/tests/system/checkconf/kasp-deprecated-fips.conf
new file mode 100644 (file)
index 0000000..6159940
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+dnssec-policy deprecated {
+       cds-digest-types { sha1; };
+       keys {
+               csk lifetime unlimited algorithm ecdsa256;
+       };
+};
diff --git a/bin/tests/system/checkconf/kasp-deprecated.conf b/bin/tests/system/checkconf/kasp-deprecated.conf
new file mode 100644 (file)
index 0000000..ba7e72b
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+dnssec-policy deprecated {
+       cds-digest-types { sha1; };
+       keys {
+               csk lifetime unlimited algorithm rsasha1;
+               csk lifetime unlimited algorithm nsec3rsasha1;
+       };
+};
index 08d706a06e326867b2861a0e651f925ba676f198..efb781188b8862c962533d157022a20cd974b02a 100644 (file)
@@ -685,6 +685,20 @@ if [ $lines -ne 5 ]; then ret=1; fi
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
+n=$((n + 1))
+echo_i "checking named-checkconf kasp deprecated algorithms and digests ($n)"
+ret=0
+if [ $RSASHA1_SUPPORTED = 0 ]; then
+  $CHECKCONF kasp-deprecated-fips.conf >checkconf.out$n 2>&1 || ret=1
+else
+  $CHECKCONF kasp-deprecated.conf >checkconf.out$n 2>&1 || ret=1
+  grep "dnssec-policy: DNSSEC algorithm rsasha1 is deprecated" checkconf.out$n >/dev/null || ret=1
+  grep "dnssec-policy: DNSSEC algorithm nsec3rsasha1 is deprecated" checkconf.out$n >/dev/null || ret=1
+fi
+grep "dnssec-policy: deprecated CDS digest-type sha1" checkconf.out$n >/dev/null || ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
 n=$((n + 1))
 echo_i "check that a good 'kasp' configuration is accepted ($n)"
 ret=0