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 */ +}; 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;