]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix and test migration to dnssec-policy
authorMatthijs Mekking <matthijs@isc.org>
Fri, 27 Mar 2020 09:28:22 +0000 (10:28 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Fri, 3 Apr 2020 07:15:39 +0000 (09:15 +0200)
commit7aa5a11bdd617ba34a575f907b65355a801461a2
tree289c6b2f9673ea84a6698972760f2970100e23eb
parent6c379655d94bb7daf78b65e8ba0976900c48484b
Fix and test migration to dnssec-policy

Migrating from 'auto-dnssec maintain;' to dnssec-policy did not
work properly, mainly because the legacy keys were initialized
badly. Several adjustments in the keymgr are required to get it right:

- Set published time on keys when we calculate prepublication time.
  This is not strictly necessary, but it is weird to have an active
  key without the published time set.

- Initalize key states also before matching keys. Determine the
  target state by looking at existing time metadata: If the time
  data is set and is in the past, it is a hint that the key and
  its corresponding records have been published in the zone already,
  and the state is initialized to RUMOURED. Otherwise, initialize it
  as HIDDEN. This fixes migration to dnssec-policy from existing
  keys.

- Initialize key goal on keys that match key policy to OMNIPRESENT.
  These may be existing legacy keys that are being migrated.

- A key that has its goal to OMNIPRESENT *or* an active key can
  match a kasp key.  The code was changed with CHANGE 5354 that
  was a bugfix to prevent creating new KSK keys for zones in the
  initial stage of signing.  However, this caused problems for
  restarts when rollovers are in progress, because an outroducing
  key can still be an active key.

The test for this introduces a new KEY property 'legacy'.  This is
used to skip tests related to .state files.

(cherry picked from commit 680189913494150d3d5ebc023145a6e61255db80)
bin/tests/system/kasp/ns6/named.conf.in
bin/tests/system/kasp/ns6/named2.conf.in
bin/tests/system/kasp/ns6/policies/kasp.conf
bin/tests/system/kasp/ns6/setup.sh
bin/tests/system/kasp/tests.sh
lib/dns/keymgr.c