diff --git a/CHANGES b/CHANGES index 9bde887fa6..4497dba1cb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +4964. [bug] Reduce the probabilty of double signature when deleting + a DNSKEY by checking if the node is otherwise signed + by the algorithm of the key to be deleted. [GL #240] + 4963. [test] ifconfig.sh now uses "ip" instead of "ifconfig", if available, to configure the test interfaces on linux. [GL #302] diff --git a/bin/named/main.c b/bin/named/main.c index 341a8c794d..6838d3c4c4 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -129,6 +129,7 @@ static unsigned int delay = 0; static isc_boolean_t nonearest = ISC_FALSE; static isc_boolean_t notcp = ISC_FALSE; static isc_boolean_t fixedlocal = ISC_FALSE; +static isc_boolean_t sigvalinsecs = ISC_FALSE; /* * -4 and -6 @@ -541,6 +542,8 @@ parse_T_opt(char *option) { if (dns_zone_mkey_month < dns_zone_mkey_day) { named_main_earlyfatal("bad mkeytimer"); } + } else if (!strcmp(option, "sigvalinsecs")) { + sigvalinsecs = ISC_TRUE; } else if (!strncmp(option, "tat=", 4)) { named_g_tat_interval = atoi(option + 4); } else { @@ -1111,6 +1114,8 @@ setup(void) { ns_server_setoption(sctx, NS_SERVER_DISABLE4, ISC_TRUE); if (disable6) ns_server_setoption(sctx, NS_SERVER_DISABLE6, ISC_TRUE); + if (sigvalinsecs) + ns_server_setoption(sctx, NS_SERVER_SIGVALINSECS, ISC_TRUE); named_g_server->sctx->delay = delay; } diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index a6a59c3231..81040e5e24 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -1439,7 +1439,9 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig, } if (ztype == dns_zone_master || raw != NULL) { + const cfg_obj_t *validity, *resign; isc_boolean_t allow = ISC_FALSE, maint = ISC_FALSE; + isc_boolean_t sigvalinsecs; obj = NULL; result = named_config_get(maps, "dnskey-sig-validity", &obj); @@ -1450,26 +1452,29 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig, obj = NULL; result = named_config_get(maps, "sig-validity-interval", &obj); INSIST(result == ISC_R_SUCCESS && obj != NULL); - { - const cfg_obj_t *validity, *resign; - validity = cfg_tuple_get(obj, "validity"); - seconds = cfg_obj_asuint32(validity) * 86400; - dns_zone_setsigvalidityinterval(zone, seconds); - - resign = cfg_tuple_get(obj, "re-sign"); - if (cfg_obj_isvoid(resign)) { - seconds /= 4; - } else { - if (seconds > 7 * 86400) - seconds = cfg_obj_asuint32(resign) * - 86400; - else - seconds = cfg_obj_asuint32(resign) * - 3600; - } - dns_zone_setsigresigninginterval(zone, seconds); + sigvalinsecs = ns_server_getoption(named_g_server->sctx, + NS_SERVER_SIGVALINSECS); + validity = cfg_tuple_get(obj, "validity"); + seconds = cfg_obj_asuint32(validity); + if (!sigvalinsecs) { + seconds *= 86400; } + dns_zone_setsigvalidityinterval(zone, seconds); + + resign = cfg_tuple_get(obj, "re-sign"); + if (cfg_obj_isvoid(resign)) { + seconds /= 4; + } else if (!sigvalinsecs) { + if (seconds > 7 * 86400) { + seconds = cfg_obj_asuint32(resign) * 86400; + } else { + seconds = cfg_obj_asuint32(resign) * 3600; + } + } else { + seconds = cfg_obj_asuint32(resign); + } + dns_zone_setsigresigninginterval(zone, seconds); obj = NULL; result = named_config_get(maps, "key-directory", &obj); diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in index 5518c7918f..e4d60eaa18 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in @@ -71,8 +71,8 @@ KRB5_CONFIG=/dev/null # The "stress" test is not run by default since it creates enough # load on the machine to make it unusable to other users. -# The "dialup" and "delzone" tests are also not run by default because -# they take a very long time to complete. +# The "dialup", "delzone", and "dupsigs" tests are also not run by +# default because they take a very long time to complete. # # List of tests hard-coded to use ports 5300 and 9953. For this # reason, these must be run sequentially. diff --git a/bin/tests/system/conf.sh.win32 b/bin/tests/system/conf.sh.win32 index 4da318fca8..6bfac1357c 100644 --- a/bin/tests/system/conf.sh.win32 +++ b/bin/tests/system/conf.sh.win32 @@ -77,7 +77,8 @@ KRB5_CONFIG=NUL # The "stress" test is not run by default since it creates enough # load on the machine to make it unusable to other users. -# v6synth +# The "dialup", "delzone", and "dupsigs" tests are also not run by +# default because they take a very long time to complete. # # List of tests that use ports 5300 and 9953. For this reason, these must # be run sequentially. diff --git a/bin/tests/system/dupsigs/check_journal.pl b/bin/tests/system/dupsigs/check_journal.pl new file mode 100644 index 0000000000..972ea8b008 --- /dev/null +++ b/bin/tests/system/dupsigs/check_journal.pl @@ -0,0 +1,209 @@ +#!/usr/bin/env perl +# +# 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. + +use strict; +use warnings; + +sub process_changeset; + +my @changeset; + +while( my $line = <> ) { + chomp $line; + + if( $line =~ /^(?add|del) (?