From 20647657f9f64a51108c9f53240535d399bfcd4b Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 24 Oct 2019 13:21:43 +1100 Subject: [PATCH 1/2] accept 0 for dnskey-sig-validity (indicates off) --- lib/bind9/check.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bind9/check.c b/lib/bind9/check.c index 9fc6736a7a..1426c41867 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -1000,9 +1000,9 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, uint32_t keyvalidity; keyvalidity = cfg_obj_asuint32(obj); - if (keyvalidity > 3660 || keyvalidity == 0) { /* 10 years */ + if (keyvalidity > 3660) { /* 10 years */ cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "%s '%u' is out of range (1..3660)", + "%s '%u' is out of range (0..3660)", "dnskey-sig-validity", keyvalidity); result = ISC_R_RANGE; From 918f020f9f5d3ca41cd230e489326654cf14c588 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 24 Oct 2019 14:13:39 +1100 Subject: [PATCH 2/2] add named-checkconf tests for dnskey-sig-validity at range limits --- CHANGES | 3 +++ .../checkconf/good-dnskey-validity-3660.conf | 14 ++++++++++++++ .../checkconf/good-dnskey-validity-zero.conf | 14 ++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 bin/tests/system/checkconf/good-dnskey-validity-3660.conf create mode 100644 bin/tests/system/checkconf/good-dnskey-validity-zero.conf diff --git a/CHANGES b/CHANGES index 6abd05682c..6d89938cbd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5304. [bug] "dnskey-sig-validity 0;" was not being accepted. + [GL #876] + 5303. [placeholder] 5302. [bug] Fix checking that "dnstap-output" is defined when diff --git a/bin/tests/system/checkconf/good-dnskey-validity-3660.conf b/bin/tests/system/checkconf/good-dnskey-validity-3660.conf new file mode 100644 index 0000000000..2a69951faa --- /dev/null +++ b/bin/tests/system/checkconf/good-dnskey-validity-3660.conf @@ -0,0 +1,14 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * 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 http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + dnskey-sig-validity 3660; /* maximum value 10 years */ +}; diff --git a/bin/tests/system/checkconf/good-dnskey-validity-zero.conf b/bin/tests/system/checkconf/good-dnskey-validity-zero.conf new file mode 100644 index 0000000000..3f8967044b --- /dev/null +++ b/bin/tests/system/checkconf/good-dnskey-validity-zero.conf @@ -0,0 +1,14 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * 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 http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + dnskey-sig-validity 0; /* 0 is disabled */ +};