]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 years agohurd: Fix build
Samuel Thibault [Sun, 10 Nov 2019 20:14:17 +0000 (20:14 +0000)] 
hurd: Fix build

Move PATH_MAX, NAME_MAX, IOV_MAX default definitions to the common
<isc/platform.h>.

6 years agoMerge branch '1134-add-missing-dnssec-keygen-dependency-on-libisccfg' into 'master'
Michał Kępień [Fri, 8 Nov 2019 12:42:50 +0000 (12:42 +0000)] 
Merge branch '1134-add-missing-dnssec-keygen-dependency-on-libisccfg' into 'master'

Add missing dnssec-keygen dependency on libisccfg

Closes #1134

See merge request isc-projects/bind9!2555

6 years agoAdd missing dnssec-keygen dependency on libisccfg
Michał Kępień [Fri, 8 Nov 2019 11:52:10 +0000 (12:52 +0100)] 
Add missing dnssec-keygen dependency on libisccfg

Commit 09ac224c5c881824c7b6649905f16b7d3f1036f4 made dnssec-keygen
depend on libisccfg but the Visual Studio solution file was not updated
to reflect that change.  Make sure the dnssec-keygen Visual Studio
project depends on the libisccfg project to prevent compilation issues
during parallel builds.

6 years agoMerge branch 'michal/split-release-notes-into-per-version-sections' into 'master'
Michał Kępień [Fri, 8 Nov 2019 11:16:02 +0000 (11:16 +0000)] 
Merge branch 'michal/split-release-notes-into-per-version-sections' into 'master'

Split release notes into per-version sections

See merge request isc-projects/bind9!2524

6 years agoRebuild output files
Michał Kępień [Tue, 5 Nov 2019 11:33:40 +0000 (12:33 +0100)] 
Rebuild output files

6 years agoUpdate URLs used in release notes
Michał Kępień [Tue, 5 Nov 2019 11:33:40 +0000 (12:33 +0100)] 
Update URLs used in release notes

Some URLs used in release notes became outdated.  Make sure they point
to currently available resources.

6 years agoSplit release notes into per-version sections
Michał Kępień [Tue, 5 Nov 2019 11:33:40 +0000 (12:33 +0100)] 
Split release notes into per-version sections

Intertwining release notes from different BIND releases in a single XML
file has caused confusion in the past due to different (and often
arbitrary) approaches to keeping/removing release notes from older
releases on different BIND branches.  Divide doc/arm/notes.xml into
per-version sections to simplify determining the set of changes
introduced by a given release and to make adding/reviewing release notes
less error-prone.

6 years agoMerge branch '1256-fix-the-jitter-test-2' into 'master'
Ondřej Surý [Fri, 8 Nov 2019 07:43:50 +0000 (07:43 +0000)] 
Merge branch '1256-fix-the-jitter-test-2' into 'master'

Wait a little bit longer for autosign, bail out on not enough categories

See merge request isc-projects/bind9!2554

6 years agoWait a little bit longer for autosign, bail out on not enough categories
Ondřej Surý [Fri, 8 Nov 2019 06:43:33 +0000 (07:43 +0100)] 
Wait a little bit longer for autosign, bail out on not enough categories

6 years agoAdjust the jitter range to +-3*stddev
Ondřej Surý [Fri, 8 Nov 2019 06:05:02 +0000 (07:05 +0100)] 
Adjust the jitter range to +-3*stddev

6 years agoMerge branch '1256-fix-the-jitter-test' into 'master'
Ondřej Surý [Fri, 8 Nov 2019 06:01:47 +0000 (06:01 +0000)] 
Merge branch '1256-fix-the-jitter-test' into 'master'

Check if the RRSIG jitter falls <mean-2.5*stddev;mean+2.5*stddev>

Closes #1309

See merge request isc-projects/bind9!2553

6 years agoRevert "temporarily disable jitter tests in the 'autosign' system test"
Ondřej Surý [Thu, 7 Nov 2019 20:42:45 +0000 (21:42 +0100)] 
Revert "temporarily disable jitter tests in the 'autosign' system test"

This reverts commit e17b7ee05aebeedbbbf8fc581eb9ae472a63e88a.

6 years agoCheck if the RRSIG jitter falls into mean+-2.5*stddev range
Ondřej Surý [Thu, 7 Nov 2019 13:54:24 +0000 (14:54 +0100)] 
Check if the RRSIG jitter falls into mean+-2.5*stddev range

6 years agoMerge branch '29-libuv-network-manager' into 'master'
Witold Krecicki [Thu, 7 Nov 2019 21:32:28 +0000 (21:32 +0000)] 
Merge branch '29-libuv-network-manager' into 'master'

libuv-based network manager

Closes #29

See merge request isc-projects/bind9!2528

6 years agoCHANGES, README, release note
Evan Hunt [Wed, 6 Nov 2019 01:52:03 +0000 (17:52 -0800)] 
CHANGES, README, release note

6 years agoadjust system tests to deal with possible timing issues
Evan Hunt [Wed, 6 Nov 2019 00:14:06 +0000 (16:14 -0800)] 
adjust system tests to deal with possible timing issues

With the netmgr in use, named may start answering queries before zones
are loaded. This can cause transient failures in system tests after
servers are restarted or reconfigured. This commit adds retry loops
and sleep statements where needed to address this problem.

Also incidentally silenced a clang warning.

6 years agoremove ISC_QUEUE as it is no longer used
Evan Hunt [Wed, 6 Nov 2019 00:39:58 +0000 (16:39 -0800)] 
remove ISC_QUEUE as it is no longer used

6 years agoconvert ns_client and related objects to use netmgr
Evan Hunt [Tue, 5 Nov 2019 23:34:35 +0000 (15:34 -0800)] 
convert ns_client and related objects to use netmgr

- ns__client_request() is now called by netmgr with an isc_nmhandle_t
  parameter. The handle can then be permanently associated with an
  ns_client object.
- The task manager is paused so that isc_task events that may be
  triggred during client processing will not fire until after the netmgr is
  finished with it. Before any asynchronous event, the client MUST
  call isc_nmhandle_ref(client->handle), to prevent the client from
  being reset and reused while waiting for an event to process. When
  the asynchronous event is complete, isc_nmhandle_unref(client->handle)
  must be called to ensure the handle can be reused later.
- reference counting of client objects is now handled in the nmhandle
  object.  when the handle references drop to zero, the client's "reset"
  callback is used to free temporary resources and reiniialize it,
  whereupon the handle (and associated client) is placed in the
  "inactive handles" queue.  when the sysstem is shutdown and the
  handles are cleaned up, the client's "put" callback is called to free
  all remaining resources.
- because client allocation is no longer handled in the same way,
  the '-T clienttest' option has now been removed and is no longer
  used by any system tests.
- the unit tests require wrapping the isc_nmhandle_unref() function;
  when LD_WRAP is supported, that is used. otherwise we link a
  libwrap.so interposer library and use that.

6 years agouse clock_gettime() instead of gettimeofday() for isc_itme functions
Witold Kręcicki [Sat, 8 Dec 2018 23:41:21 +0000 (00:41 +0100)] 
use clock_gettime() instead of gettimeofday() for isc_itme functions

6 years agoadd atomic_exchange operations to mutexatomic.h and win32 stdatomic.h
Witold Kręcicki [Thu, 24 Oct 2019 08:55:54 +0000 (10:55 +0200)] 
add atomic_exchange operations to mutexatomic.h and win32 stdatomic.h

6 years agoadd isc_task_pause() and isc_task_unpause() functions
Evan Hunt [Tue, 5 Nov 2019 23:23:33 +0000 (15:23 -0800)] 
add isc_task_pause() and isc_task_unpause() functions

This allows a task to be temporary disabled so that objects won't be
processed simultaneously by libuv events and isc_task events. When a
task is paused, currently running events may complete, but no further
event will added to the run queue will be executed until the task is
unpaused.

6 years agooptionally associate a netmgr with a task manager when creating
Evan Hunt [Tue, 5 Nov 2019 23:23:33 +0000 (15:23 -0800)] 
optionally associate a netmgr with a task manager when creating

When a task manager is created, we can now specify an `isc_nm`
object to associate with it; thereafter when the task manager is
placed into exclusive mode, the network manager will be paused.

6 years agodisable leak detection in ASAN; libuv has some problems with that
Witold Kręcicki [Mon, 4 Nov 2019 14:32:31 +0000 (15:32 +0100)] 
disable leak detection in ASAN; libuv has some problems with that

6 years agouse netmgr in libisc unit tests
Evan Hunt [Wed, 6 Nov 2019 00:28:43 +0000 (16:28 -0800)] 
use netmgr in libisc unit tests

6 years agonetmgr: libuv-based network manager
Witold Kręcicki [Tue, 5 Nov 2019 21:55:54 +0000 (13:55 -0800)] 
netmgr: libuv-based network manager

This is a replacement for the existing isc_socket and isc_socketmgr
implementation. It uses libuv for asynchronous network communication;
"networker" objects will be distributed across worker threads reading
incoming packets and sending them for processing.

UDP listener sockets automatically create an array of "child" sockets
so each worker can listen separately.

TCP sockets are shared amongst worker threads.

A TCPDNS socket is a wrapper around a TCP socket, which handles the
the two-byte length field at the beginning of DNS messages over TCP.

(Other wrapper socket types can be implemented in the future to handle
DNS over TLS, DNS over HTTPS, etc.)

6 years agoimplement fixed-size array stack data structure
Evan Hunt [Tue, 5 Nov 2019 21:50:43 +0000 (13:50 -0800)] 
implement fixed-size array stack data structure

6 years agoimplement fetch-and-add array queue data structure
Witold Kręcicki [Tue, 5 Nov 2019 21:28:50 +0000 (13:28 -0800)] 
implement fetch-and-add array queue data structure

this is a lockless queue based on hazard pointers.

6 years agotemporarily move ISC_QUEUE to list.h
Evan Hunt [Tue, 5 Nov 2019 21:18:37 +0000 (13:18 -0800)] 
temporarily move ISC_QUEUE to list.h

The double-locked queue implementation is still currently in use
in ns_client, but will be replaced by a fetch-and-add array queue.
This commit moves it from queue.h to list.h so that queue.h can be
used for the new data structure, and clean up dependencies between
list.h and types.h. Later, when the ISC_QUEUE is no longer is use,
it will be removed completely.

6 years agoimplement hazard pointer data structure
Witold Kręcicki [Tue, 5 Nov 2019 18:52:20 +0000 (10:52 -0800)] 
implement hazard pointer data structure

this is a mechanism to allow safe lock-free data structures.

6 years agoPreliminary netmgr design documentation
Witold Kręcicki [Wed, 8 May 2019 08:43:12 +0000 (10:43 +0200)] 
Preliminary netmgr design documentation

6 years agoadd isc_sockaddr_fromsockaddr function
Witold Kręcicki [Tue, 15 Jan 2019 10:01:13 +0000 (11:01 +0100)] 
add isc_sockaddr_fromsockaddr function

This converts from struct sockaddr to isc_sockaddr_t

6 years agoMerge branch '1308-fix-tcp-system-test' into 'master'
Evan Hunt [Thu, 7 Nov 2019 19:55:04 +0000 (19:55 +0000)] 
Merge branch '1308-fix-tcp-system-test' into 'master'

Fix "tcp" system test

Closes #1308

See merge request isc-projects/bind9!2549

6 years agomake send_command wait for any result, rather than specifically result=OK
Evan Hunt [Thu, 7 Nov 2019 19:32:59 +0000 (11:32 -0800)] 
make send_command wait for any result, rather than specifically result=OK

6 years agoAddress ShellCheck warnings
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Address ShellCheck warnings

Address all outstanding warnings that ShellCheck reports for
bin/tests/system/tcp/tests.sh.

6 years agoUse "set -e" in the "tcp" system test
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Use "set -e" in the "tcp" system test

Ensure any unexpected failure in the "tcp" system test causes it to be
immediately interrupted with an error to make the aforementioned test
more reliable.  Since the exit code for "expr 0 + 0" is 1, the status
variable needs to be updated using arithmetic expansion.

6 years agoEnsure all "tcp" system test errors are caught
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Ensure all "tcp" system test errors are caught

Ensure any "rndc stats" failure causes the "tcp" system test to fail.
Do not hide "rndc stats" output.

6 years agoMake all "tcp" system test checks numbered
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Make all "tcp" system test checks numbered

Ensure all checks in the "tcp" system test are numbered, so that
forensic data is preserved in case of any failure.

6 years agoFix argument order in assert_int_equal()
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Fix argument order in assert_int_equal()

assert_int_equal() calls in bin/tests/system/tcp/tests.sh pass the found
value as the first argument and the expected value as the second
argument, while the function interprets its arguments the other way
round.  Fix argument handling in assert_int_equal() to make sure the
error messages printed by that function are correct.

6 years agoAllow retries when checking TCP high-water stats
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Allow retries when checking TCP high-water stats

In the TCP high-water checks, "rndc stats" is run after ans6 reports
that it opened the requested number of TCP connections.  However, we
fail to account for the fact that ns5 might not yet have called accept()
for these connections, in which case the counts output by "rndc stats"
will be off.  To prevent intermittent "tcp" system test failures, allow
the relevant connection count checks to be retried (just once, after one
second, as that should be enough for any system to accept() a dozen TCP
connections under any circumstances).

6 years agoMerge branch 'each-disable-jitter-test' into 'master'
Evan Hunt [Thu, 7 Nov 2019 18:25:36 +0000 (18:25 +0000)] 
Merge branch 'each-disable-jitter-test' into 'master'

temporarily disable jitter tests in the 'autosign' system test

See merge request isc-projects/bind9!2551

6 years agotemporarily disable jitter tests in the 'autosign' system test
Evan Hunt [Thu, 7 Nov 2019 17:09:28 +0000 (09:09 -0800)] 
temporarily disable jitter tests in the 'autosign' system test

the current method used for testing distribution of signatures
is failure-prone. we need to replace it with something both
effective and portable, but in the meantime we're commenting
out the jitter test.

6 years agoMerge branch '1134-fix-bashisms-in-kasp-test' into 'master'
Ondřej Surý [Thu, 7 Nov 2019 12:52:14 +0000 (12:52 +0000)] 
Merge branch '1134-fix-bashisms-in-kasp-test' into 'master'

Fix the bashisms in kasp/tests.sh and make the script shellcheck clean

See merge request isc-projects/bind9!2548

6 years agoUse better '\#' quoting in ns3/setup.sh
Ondřej Surý [Thu, 7 Nov 2019 11:04:38 +0000 (12:04 +0100)] 
Use better '\#' quoting in ns3/setup.sh

6 years agoRelax the requirement for check_next_key_event() to <-60;60>
Ondřej Surý [Thu, 7 Nov 2019 09:39:43 +0000 (10:39 +0100)] 
Relax the requirement for check_next_key_event() to <-60;60>

The original requirement for the check to pass was <-10;10> interval and
the first test was failing by 1 second.  As the minimum interval for
checking is 7200 seconds, the commit relaxes the requirement to <-60;60>
interval, which is still sane, but not that draconic.

6 years agoFix the get_keyids() usage as it could return multiple key ids
Ondřej Surý [Thu, 7 Nov 2019 09:26:04 +0000 (10:26 +0100)] 
Fix the get_keyids() usage as it could return multiple key ids

The get_keyids() function can return multiple keyids, when the
return value was not quoted, only the first keyid would be checked
with check_key() function.  This MR fixes both the error that came
with quoting the "$id" with value "12345 54321", and the code now
checks all returned keyids.

6 years agoClean the rest of the shellcheck errors
Ondřej Surý [Thu, 7 Nov 2019 09:07:14 +0000 (10:07 +0100)] 
Clean the rest of the shellcheck errors

6 years agoUse the shellcheck -f diff to autofix certain classes of sh errors
Ondřej Surý [Thu, 7 Nov 2019 08:52:16 +0000 (09:52 +0100)] 
Use the shellcheck -f diff to autofix certain classes of sh errors

6 years agoReplace bash array with concatenated evaluated shell variables
Ondřej Surý [Thu, 7 Nov 2019 08:35:34 +0000 (09:35 +0100)] 
Replace bash array with concatenated evaluated shell variables

6 years agoMerge branch 'each-kasp-relnotes' into 'master'
Evan Hunt [Thu, 7 Nov 2019 04:12:36 +0000 (04:12 +0000)] 
Merge branch 'each-kasp-relnotes' into 'master'

KASP release notes

See merge request isc-projects/bind9!2547

6 years agoCHANGES, REAMDE, release note
Evan Hunt [Thu, 7 Nov 2019 04:06:36 +0000 (20:06 -0800)] 
CHANGES, REAMDE, release note

6 years agoadd 'kasp' to test list
Evan Hunt [Thu, 7 Nov 2019 03:54:02 +0000 (19:54 -0800)] 
add 'kasp' to test list

6 years agoMerge branch '1134-dnssec-made-easy' into 'master'
Matthijs Mekking [Wed, 6 Nov 2019 22:40:53 +0000 (22:40 +0000)] 
Merge branch '1134-dnssec-made-easy' into 'master'

DNSSEC Made Easy

Closes #1134

See merge request isc-projects/bind9!2458

6 years agoFix checkconf test
Matthijs Mekking [Tue, 5 Nov 2019 16:49:46 +0000 (17:49 +0100)] 
Fix checkconf test

6 years agodnssec-policy inheritance from options/view
Matthijs Mekking [Tue, 5 Nov 2019 16:22:35 +0000 (17:22 +0100)] 
dnssec-policy inheritance from options/view

'dnssec-policy' can now also be set on the options and view level and
a zone that does not set 'dnssec-policy' explicitly will inherit it
from the view or options level.

This requires a new keyword to be introduced: 'none'.  If set to
'none' the zone will not be DNSSEC maintained, in other words it will
stay unsigned.  You can use this to break the inheritance.  Of course
you can also break the inheritance by referring to a different
policy.

The keywords 'default' and 'none' are not allowed when configuring
your own dnssec-policy statement.

Add appropriate tests for checking the configuration (checkconf)
and add tests to the kasp system test to verify the inheritance
works.

Edit the kasp system test such that it can deal with unsigned zones
and views (so setting a TSIG on the query).

6 years agomove appending kasp to the list until we can't fail; document why we don't detach
Mark Andrews [Tue, 5 Nov 2019 02:38:00 +0000 (13:38 +1100)] 
move appending kasp to the list until we can't fail; document why we don't detach

6 years agoInsist that kasp is not linked.
Mark Andrews [Tue, 5 Nov 2019 02:36:40 +0000 (13:36 +1100)] 
Insist that kasp is not linked.

6 years agoMake kasp opaque
Matthijs Mekking [Mon, 4 Nov 2019 15:26:39 +0000 (16:26 +0100)] 
Make kasp opaque

6 years agokasp.c: return parenthesis (style) and REQUIRE
Matthijs Mekking [Mon, 4 Nov 2019 11:04:52 +0000 (12:04 +0100)] 
kasp.c: return parenthesis (style) and REQUIRE

This code was missing a lot of return parenthesis (violating our
style guide) and a missing REQUIRE in 'dns_kasplist_find()'.

6 years agoAdd tests for CDS/CDNSKEY publication
Matthijs Mekking [Mon, 4 Nov 2019 10:20:00 +0000 (11:20 +0100)] 
Add tests for CDS/CDNSKEY publication

The kasp system tests are updated with 'check_cds' calls that will
verify that the correct CDS and CDNSKEY records are published during
a rollover and that they are signed with the correct KSK.

This requires a change in 'dnssec.c' to check the kasp key states
whether the CDS/CDNSKEY of a key should be published or not.  If no
kasp state exist, fall back to key timings.

6 years agosign_apex() should also consider CDS/CDNSKEY
Matthijs Mekking [Mon, 4 Nov 2019 10:16:08 +0000 (11:16 +0100)] 
sign_apex() should also consider CDS/CDNSKEY

The 'sign_apex()' function has special processing for signing the
DNSKEY RRset such that it will always be signed with the active
KSK.  Since CDS and CDNSKEY are also signed with the KSK, it
should have the same special processing.  The special processing is
moved into a new function 'tickle_apex_rrset()' and is applied to
all three RR types (DNSKEY, CDS, CDNSKEY).

In addition, when kasp is involved, update the DNSKEY TTL accordingly
to what is in the policy.

6 years agoAdd dst_key_copy_metadata function.
Matthijs Mekking [Mon, 4 Nov 2019 10:12:26 +0000 (11:12 +0100)] 
Add dst_key_copy_metadata function.

When updating DNSSEC keys we would like to be able to copy the
metadata from one key to another.

6 years agoKASP timings all uint32_t
Matthijs Mekking [Wed, 30 Oct 2019 16:40:08 +0000 (17:40 +0100)] 
KASP timings all uint32_t

Get rid of the warnings in the Windows build.

6 years agoTest CSK rollover
Matthijs Mekking [Wed, 30 Oct 2019 15:45:41 +0000 (16:45 +0100)] 
Test CSK rollover

Test two CSK rollover scenarios, one where the DS is swapped before the zone
signatures are all replaced, and one where the signatures are replaced sooner
than the DS is swapped.

6 years agoCode changes for CSK
Matthijs Mekking [Wed, 30 Oct 2019 13:38:28 +0000 (14:38 +0100)] 
Code changes for CSK

Update dns_dnssec_keyactive to differentiate between the roles ZSK
and KSK.  A key is active if it is signing but that differs per role.
A ZSK is signing if its ZRRSIG state is in RUMOURED or OMNIPRESENT,
a KSK is signing if its KRRSIG state is in RUMOURED or OMNIPRESENT.

This means that a key can be actively signing for one role but not
the other.  Add checks in inline signing (zone.c and update.c) to
cover the case where a CSK is active in its KSK role but not the ZSK
role.

6 years agoUse keywords in dnssec-policy keys configuration
Matthijs Mekking [Mon, 21 Oct 2019 11:26:30 +0000 (13:26 +0200)] 
Use keywords in dnssec-policy keys configuration

Add keywords 'lifetime' and 'algorithm' to make the key configuration
more clear.

6 years agoTest ZSK and KSK rollover
Matthijs Mekking [Thu, 17 Oct 2019 13:50:52 +0000 (15:50 +0200)] 
Test ZSK and KSK rollover

Add tests for ZSK Pre-Publication and KSK Double-KSK rollover.

Includes tests for next key event is scheduled at the right time.

6 years agoAdd kasp tests
Matthijs Mekking [Thu, 17 Oct 2019 13:27:06 +0000 (15:27 +0200)] 
Add kasp tests

Add more tests for kasp:

- Add tests for different algorithms.

- Add a test to ensure that an edit in an unsigned zone is
  picked up and properly signed.

- Add two tests that ensures that a zone gets signed when it is
  configured as so-called 'inline-signing'.  In other words, a
  secondary zone that is configured with a 'dnssec-policy'.  A zone
  that is transferred over AXFR or IXFR will get signed.

- Add a test to ensure signatures are reused if they are still
  fresh enough.

- Adds two more tests to verify that expired and unfresh signatures
  will be regenerated.

- Add tests for various cases with keys already available in the
  key-directory.

6 years agoRefactor kasp system test
Matthijs Mekking [Thu, 17 Oct 2019 12:22:38 +0000 (14:22 +0200)] 
Refactor kasp system test

A significant refactor of the kasp system test in an attempt to
make the test script somewhat brief.  When writing a test case,
you can/should use the functions 'zone_properties',
'key_properties', and 'key_timings' to set the expected values
when checking a key with 'check_key'. All these four functions
can be used to set environment variables that come in handy when
testing output.

6 years agoAdjust signing code to use kasp
Matthijs Mekking [Thu, 17 Oct 2019 09:57:20 +0000 (11:57 +0200)] 
Adjust signing code to use kasp

Update the signing code in lib/dns/zone.c and lib/dns/update.c to
use kasp logic if a dnssec-policy is enabled.

This means zones with dnssec-policy should no longer follow
'update-check-ksk' and 'dnssec-dnskey-kskonly' logic, instead the
KASP keys configured dictate which RRset gets signed with what key.

Also use the next rekey event from the key manager rather than
setting it to one hour.

Mark the zone dynamic, as otherwise a zone with dnssec-policy is
not eligble for automatic DNSSEC maintenance.

6 years agoDNSSEC hints use dst_key functions and key states
Matthijs Mekking [Thu, 17 Oct 2019 09:51:58 +0000 (11:51 +0200)] 
DNSSEC hints use dst_key functions and key states

Update dns_dnssec_get_hints and dns_dnssec_keyactive to use dst_key
functions and thus if dnssec-policy/KASP is used the key states are
being considered.

Add a new variable to 'struct dns_dnsseckey' to signal whether this
key is a zone-signing key (it is no longer true that ksk == !zsk).

Also introduce a hint for revoke.

Update 'dns_dnssec_findzonekeys' and 'dns_dnssec_findmatchingkeys'
to also read the key state file, if available.

Remove 'allzsk' from 'dns_dnssec_updatekeys' as this was only a
hint for logging.

Also make get_hints() (now dns_dnssec_get_hints()) public so that
we can use it in the key manager.

6 years agoUpdate zoneconf to use kasp config
Matthijs Mekking [Thu, 17 Oct 2019 09:38:56 +0000 (11:38 +0200)] 
Update zoneconf to use kasp config

If a zone has a dnssec-policy set, use signature validity,
dnskey signature validity, and signature refresh from
dnssec-policy.

Zones configured with 'dnssec-policy' will allow 'named' to create
DNSSEC keys (similar to dnssec-keymgr) if not available.

6 years agoIntroduce keymgr in named
Matthijs Mekking [Thu, 17 Oct 2019 09:19:35 +0000 (11:19 +0200)] 
Introduce keymgr in named

Add a key manager to named.  If a 'dnssec-policy' is set, 'named'
will run a key manager on the matching keys.  This will do a couple
of things:

1. Create keys when needed (in case of rollover for example)
   according to the set policy.

2. Retire keys that are in excess of the policy.

3. Maintain key states according to "Flexible and Robust Key
   Rollover" [1]. After key manager ran, key files will be saved to
   disk.

   [1] https://matthijsmekking.nl/static/pdf/satin2012-Schaeffer.pdf

KEY GENERATION

Create keys according to DNSSEC policy.  Zones configured with
'dnssec-policy' will allow 'named' to create DNSSEC keys (similar
to dnssec-keymgr) if not available.

KEY ROLLOVER

Rather than determining the desired state from timing metadata,
add a key state goal.  Any keys that are created or picked from the
key ring and selected to be a successor has its key state goal set
to OMNIPRESENT (this key wants to be signing!). At the same time,
a key that is being retired has its key state goal set to HIDDEN.

The keymgr state machine with the three rules will make sure no
introduction or withdrawal of DNSSEC records happens too soon.

KEY TIMINGS

All timings are based on RFC 7583.

The keymgr will return when the next action is happening so
that the zone can set the proper rekey event. Prior to this change
the rekey event will run every hour by default (configurable),
but with kasp we can determine exactly when we need to run again.

The prepublication time is derived from policy.

6 years agoUseful dst_key functions
Matthijs Mekking [Thu, 17 Oct 2019 08:21:12 +0000 (10:21 +0200)] 
Useful dst_key functions

Add a couple of dst_key functions for determining hints that
consider key states if they are available.
- dst_key_is_unused:
  A key has no timing metadata set other than Created.
- dst_key_is_published:
  A key has publish timing metadata <= now, DNSKEY state in
  RUMOURED or OMNIPRESENT.
- dst_key_is_active:
  A key has active timing metadata <= now, RRSIG state in
  RUMOURED or OMNIPRESENT.
- dst_key_is_signing:
  KSK is_signing and is_active means different things than
  for a ZSK. A ZSK is active means it is also signing, but
  a KSK always signs its DNSKEY RRset but is considered
  active if its DS is present (rumoured or omnipresent).
- dst_key_is_revoked:
  A key has revoke timing metadata <= now.
- dst_key_is_removed:
  A key has delete timing metadata <= now, DNSKEY state in
  UNRETENTIVE or HIDDEN.

6 years agokasp: Expose more key timings
Matthijs Mekking [Wed, 16 Oct 2019 16:36:38 +0000 (18:36 +0200)] 
kasp: Expose more key timings

When doing rollover in a timely manner we need to have access to the
relevant kasp configured durations.

Most of these are simple get functions, but 'dns_kasp_signdelay'
will calculate the maximum time that is needed with this policy to
resign the complete zone (taking into account the refresh interval
and signature validity).

Introduce parent-propagation-delay, parent-registration-delay,
parent-ds-ttl, zone-max-ttl, zone-propagation-delay.

6 years agokeygen/settime: Write out successor/predecessor
Matthijs Mekking [Wed, 16 Oct 2019 15:43:30 +0000 (17:43 +0200)] 
keygen/settime: Write out successor/predecessor

When creating a successor key, or calculating time for a successor
key, write out the successor and predecessor metadata to the
related files.

6 years agoarm: Update DNSSEC documentation
Matthijs Mekking [Tue, 1 Oct 2019 13:40:01 +0000 (15:40 +0200)] 
arm: Update DNSSEC documentation

6 years agoAllow DNSSEC records in kasp enabled zone
Matthijs Mekking [Tue, 1 Oct 2019 09:11:47 +0000 (11:11 +0200)] 
Allow DNSSEC records in kasp enabled zone

When signing a zone with dnssec-policy, we don't mind DNSSEC records.
This is useful for testing purposes, and perhaps it is better to
signal this behavior with a different configuration option.

6 years agodnssec-settime: Allow manipulating state files
Matthijs Mekking [Thu, 12 Sep 2019 09:57:55 +0000 (11:57 +0200)] 
dnssec-settime: Allow manipulating state files

Introduce a new option '-s' for dnssec-settime that when manipulating
timing metadata, it also updates the key state file.

For testing purposes, add options to dnssec-settime to set key
states and when they last changed.

The dst code adds ways to write and read the new key states and
timing metadata. It updates the parsing code for private key files
to not parse the newly introduced metadata (these are for state
files only).

Introduce key goal (the state the key wants to be in).

6 years agoAdd functionality to read key state from disk
Matthijs Mekking [Thu, 12 Sep 2019 09:45:10 +0000 (11:45 +0200)] 
Add functionality to read key state from disk

When reading a key from file, you can set the DST_TYPE_STATE option
to also read the key state.

This expects the Algorithm and Length fields go above the metadata,
so update the write functionality to do so accordingly.

Introduce new DST metadata types for KSK, ZSK, Lifetime and the
timing metadata used in state files.

6 years agoParse dnssec-policy config into kasp
Matthijs Mekking [Tue, 3 Sep 2019 09:42:10 +0000 (11:42 +0200)] 
Parse dnssec-policy config into kasp

Add code that actually stores the configuration into the kasp
structure and attach it to the appropriate zone.

6 years agodnssec-keygen can create keys given dnssec-policy
Matthijs Mekking [Wed, 11 Sep 2019 14:38:49 +0000 (16:38 +0200)] 
dnssec-keygen can create keys given dnssec-policy

This commit adds code for generating keys with dnssec-keygen given
a specific dnssec-policy.

The dnssec-policy can be set with a new option '-k'. The '-l'
option can be used to set a configuration file that contains a
specific dnssec-policy.

Because the dnssec-policy dictates how the keys should look like,
many of the existing dnssec-keygen options cannot be used together
with '-k'.

If the dnssec-policy lists multiple keys, dnssec-keygen has now the
possibility to generate multiple keys at one run.

Add two tests for creating keys with '-k': One with the default
policy, one with multiple keys from the configuration.

6 years agoAdd various get functions for kasp
Matthijs Mekking [Wed, 11 Sep 2019 14:32:58 +0000 (16:32 +0200)] 
Add various get functions for kasp

Write functions to access various elements of the kasp structure,
and the kasp keys. This in preparation of code in dnssec-keygen,
dnssec-settime, named...

6 years agoUpdate dst key code to maintain key state
Matthijs Mekking [Wed, 11 Sep 2019 14:29:33 +0000 (16:29 +0200)] 
Update dst key code to maintain key state

Add a number of metadata variables (lifetime, ksk and zsk role).

For the roles we add a new type of metadata (booleans).

Add a function to write the state of the key to a separate file.

Only write out known metadata to private file.  With the
introduction of the numeric metadata "Lifetime", adjust the write
private key file functionality to only write out metadata it knows
about.

6 years agoNit: fix typo in documentation dst_key_getnum
Matthijs Mekking [Wed, 11 Sep 2019 14:31:41 +0000 (16:31 +0200)] 
Nit: fix typo in documentation dst_key_getnum

6 years agoFix: nums type in dst_keys
Matthijs Mekking [Wed, 11 Sep 2019 11:46:02 +0000 (13:46 +0200)] 
Fix: nums type in dst_keys

This was isc_stdtime_t but should be uint32_t.

6 years agoNit: fix typo (dnsssec-signzone)
Matthijs Mekking [Wed, 11 Sep 2019 09:36:39 +0000 (11:36 +0200)] 
Nit: fix typo (dnsssec-signzone)

6 years agoAdd code for creating kasp from config
Matthijs Mekking [Wed, 11 Sep 2019 08:58:44 +0000 (10:58 +0200)] 
Add code for creating kasp from config

Add code for creating, configuring, and destroying KASP keys.  When
using the default policy, create one CSK, no rollover.

6 years agodnssec-keygen: Move keygen function above main
Matthijs Mekking [Wed, 11 Sep 2019 08:53:53 +0000 (10:53 +0200)] 
dnssec-keygen: Move keygen function above main

This is done in a separate commit to make diff easier.

6 years agodnssec-keygen: Move key gen code in own function
Matthijs Mekking [Wed, 11 Sep 2019 08:51:36 +0000 (10:51 +0200)] 
dnssec-keygen: Move key gen code in own function

In preparation for key generation with dnssec-policy, where multiple
keys may be created.

6 years agoSync options in dnssec-keygen
Matthijs Mekking [Thu, 5 Sep 2019 10:14:55 +0000 (12:14 +0200)] 
Sync options in dnssec-keygen

Code and documentation were not in line:
- Remove -z option from code
- Remove -k option from docbook
- Add -d option to docbook
- Add -T option to docbook

6 years agoIntroduce kasp structure
Matthijs Mekking [Tue, 3 Sep 2019 08:39:25 +0000 (10:39 +0200)] 
Introduce kasp structure

This stores the dnssec-policy configuration and adds methods to
create, destroy, and attach/detach, as well as find a policy with
the same name in a list.

Also, add structures and functions for creating and destroying
kasp keys.

6 years agoIntroduce dnssec-policy configuration
Matthijs Mekking [Mon, 2 Sep 2019 14:24:48 +0000 (16:24 +0200)] 
Introduce dnssec-policy configuration

This commit introduces the initial `dnssec-policy` configuration
statement. It has an initial set of options to deal with signature
and key maintenance.

Add some checks to ensure that dnssec-policy is configured at the
right locations, and that policies referenced to in zone statements
actually exist.

Add some checks that when a user adds the new `dnssec-policy`
configuration, it will no longer contain existing DNSSEC
configuration options.  Specifically: `inline-signing`,
`auto-dnssec`, `dnssec-dnskey-kskonly`, `dnssec-secure-to-insecure`,
`update-check-ksk`, `dnssec-update-mode`, `dnskey-sig-validity`,
and `sig-validity-interval`.

Test a good kasp configuration, and some bad configurations.

6 years agoDesign documentation 'dnssec-policy'
Matthijs Mekking [Mon, 2 Sep 2019 13:51:10 +0000 (15:51 +0200)] 
Design documentation 'dnssec-policy'

Initial design document.

6 years agoExtend ttlval to accept ISO 8601 durations
Matthijs Mekking [Mon, 2 Sep 2019 13:46:28 +0000 (15:46 +0200)] 
Extend ttlval to accept ISO 8601 durations

The ttlval configuration types are replaced by duration configuration
types. The duration is an ISO 8601 duration that is going to be used
for DNSSEC key timings such as key lifetimes, signature resign
intervals and refresh periods, etc. But it is also still allowed to
use the BIND ttlval ways of configuring intervals (number plus
optional unit).

A duration is stored as an array of 7 different time parts.
A duration can either be expressed in weeks, or in a combination of
the other datetime indicators.

Add several unit tests to ensure the correct value is parsed given
different string values.

6 years agoChange indentation in doc/arm/dnssec.xml
Matthijs Mekking [Mon, 2 Sep 2019 08:13:24 +0000 (10:13 +0200)] 
Change indentation in doc/arm/dnssec.xml

This commit does not change anything significant, it just makes
the file more readable in preparation for upcoming changes related
to the `dnssec-policy` configuration option.

6 years agoMerge branch '1206-fix-tcp-high-water-release-note' into 'master'
Michał Kępień [Wed, 6 Nov 2019 15:28:55 +0000 (15:28 +0000)] 
Merge branch '1206-fix-tcp-high-water-release-note' into 'master'

Fix TCP high-water release note

Closes #1206

See merge request isc-projects/bind9!2541

6 years agoFix TCP high-water release note
Michał Kępień [Wed, 6 Nov 2019 15:25:55 +0000 (16:25 +0100)] 
Fix TCP high-water release note

Add missing GitLab issue number to the TCP high-water release note.

6 years agoMerge branch '1298-do-not-use-sys-sysctl.h-on-linux' into 'master'
Michał Kępień [Wed, 6 Nov 2019 14:49:42 +0000 (14:49 +0000)] 
Merge branch '1298-do-not-use-sys-sysctl.h-on-linux' into 'master'

Do not use <sys/sysctl.h> on Linux

Closes #1298

See merge request isc-projects/bind9!2525

6 years agoDo not use <sys/sysctl.h> on Linux
Michał Kępień [Wed, 6 Nov 2019 14:31:47 +0000 (15:31 +0100)] 
Do not use <sys/sysctl.h> on Linux

glibc 2.30 deprecated the <sys/sysctl.h> header [1].  However, that
header is still used on other Unix-like systems, so only prevent it from
being used on Linux, in order to prevent compiler warnings from being
triggered.

[1] https://sourceware.org/ml/libc-alpha/2019-08/msg00029.html

6 years agoMerge branch '1206-add-assert_int_equal-shell-function' into 'master'
Michał Kępień [Wed, 6 Nov 2019 14:31:02 +0000 (14:31 +0000)] 
Merge branch '1206-add-assert_int_equal-shell-function' into 'master'

Add assert_int_equal() shell function

Closes #1206

See merge request isc-projects/bind9!2535