Commit graph

11206 commits

Author SHA1 Message Date
Matthijs Mekking
78e6b8646a Test dnssec-signzone -G digests
Add test cases for the new dnssec-signzone -G option.
2023-02-28 09:38:31 +01:00
Matthijs Mekking
b1633b71b0 dnssec-signzone can now create multiple CDS RRs
Change the commandline option -G to take a string that determines what
sync records should be published. It is a comma-separated string with
each element being either "cdnskey", or "cds:<algorithm>", where
<algorithm> is a valid digest type. Duplicates are suppressed.
2023-02-28 09:38:31 +01:00
Matthijs Mekking
ea4130d6bd Update syncupdate() function to disable CDNSKEY
Add a new function argument so you can choose whether the CDNSKEY
record should be published or not.
2023-02-28 09:38:17 +01:00
Mark Andrews
59cd228216 Fix dns_kasp_attach / dns_kasp_detach usage
The kasp pointers in dns_zone_t should consistently be changed by
dns_kasp_attach and dns_kasp_detach so the usage is balanced.
2023-02-28 09:38:17 +01:00
Matthijs Mekking
c0b606885e Make cds-digest-type plural
Allow for configuring multiple CDS records with different digest
types (currently only SHA-256 and SHA-384 are allowed).
2023-02-28 09:38:17 +01:00
Matthijs Mekking
06e64821f5 New option to dnssec-signzone to ignore sync rrs
By default, CDS and CDNSKEY records are generated from the given
key list. In some cases you don't want that.
2023-02-28 09:37:38 +01:00
Matthijs Mekking
8d20c4e95f Update code to publish CDS with other digest type
Now that we can configure a different digest type, update the code
to honor the configuration. Update 'dns_dnssec_syncupdate' so that
the correct CDS record is published, and also when deleting CDS records,
ensure that all possible CDS records are removed from the zone.
2023-02-28 09:36:50 +01:00
Matthijs Mekking
9f3e3fcfc8 Add test case for different digest type
Change one of the test cases to use a different digest type (4).  The
system tests and kasp script need to be updated to take into account
the new algorithm (instead of the hard coded 2).
2023-02-28 09:36:50 +01:00
Matthijs Mekking
f1ec02a359 Test cds-digest-type configuration
Add tests for good and bad configuration values in the checkconf system
test.
2023-02-28 09:36:50 +01:00
Matthijs Mekking
2742fe656f Add configuration cds-digest-type
Add the 'cds-digest-type' configuration option to 'dnssec-policy'.
2023-02-28 09:36:49 +01:00
Mark Andrews
c7ae975ecf Fix 'checking drop statistics' test
Wait for the desired log message to appear in ns3/named.stats rather
than the creation of the file.
2023-02-28 17:46:14 +11:00
Mark Andrews
af47090d99 Fix 'lame server clients are dropped below the hard limit' test
The test was setting a minimum count for recursive clients which
was not always being met (e.g. 91 instead of 100) producing a false
positive.  Lower the lower bound on recursive clients for this
test to 1.
2023-02-28 17:45:59 +11:00
Aram Sargsyan
a73b67456e Add a system test for [GL #3777]
Add the 'ixfr-from-differences yes;' option to trigger a failed
zone postload operation when a zone is updated but the serial
number is not updated, then issue two successive 'rndc reload'
commands to trigger the bug, which causes an assertion failure.
2023-02-27 10:06:32 +00:00
Aram Sargsyan
2a52d30660
Call dns_catz_new_zones() only when it is needed
The configure_catz() function creates the catalog zones structure
for the view even when it is not needed, in which case it then
discards it (by detaching) later.

Instead, call dns_catz_new_zones() only when it is needed, i.e. when
there is no existing "previous" view with an existing 'catzs', that
is going to be reused.
2023-02-24 15:00:26 +01:00
Aram Sargsyan
53f0c5a9ac
Add reference count tracing for dns_catz_zone_t and dns_catz_zones_t
Tracing can be activated by defining DNS_RPZ_TRACE in catz.h.
2023-02-24 15:00:26 +01:00
Aram Sargsyan
8cb79fec9d
Light refactoring of catz.c
* Change 'dns_catz_new_zones()' function's prototype (the order of the
  arguments) to synchronize it with the similar function in rpz.c.
* Rename 'refs' to 'references' in preparation of ISC_REFCOUNT_*
  macros usage for reference tracking.
* Unify dns_catz_zone_t naming to catz, and dns_catz_zones_t naming to
  catzs, following the logic of similar changes in rpz.c.
* Use C compound literals for structure initialization.
* Synchronize the "new zone version came too soon" log message with the
  one in rpz.c.
* Use more of 'sizeof(*ptr)' style instead of the 'sizeof(type_t)' style
  expressions when allocating or freeing memory for 'ptr'.
2023-02-24 15:00:26 +01:00
Tony Finch
330ff06d4a Move irs_resconf into libdns and remove libirs
`libirs` used to be a reference implementation of `getaddrinfo` and
related modern resolver APIs. It was stripped down in BIND 9.18
leaving only the `irs_resconf` module, which parses
`/etc/resolv.conf`. I have kept its include path and namespace prefix,
so it remains a little fragment of libirs now embedded in libdns.
2023-02-24 09:38:59 +00:00
Evan Hunt
f0c766abec refactor dns_xfrin to use dns_dispatch
the dns_xfrin module was still using the network manager directly to
manage TCP connections and send and receive messages.  this commit
changes it to use the dispatch manager instead.
2023-02-24 08:30:33 +00:00
Evan Hunt
ae5ba54fbe move dispatchmgr from resolver to view
the 'dispatchmgr' member of the resolver object is used by both
the dns_resolver and dns_request modules, and may in the future
be used by others such as dns_xfrin. it doesn't make sense for it
to live in the resolver object; this commit moves it into dns_view.
2023-02-24 08:30:33 +00:00
Evan Hunt
4dfc3f056d fix a crash from using an empty string for "include"
the parser could crash when "include" specified an empty string in place
of the filename. this has been fixed by returning ISC_R_FILENOTFOUND
when the string length is 0.
2023-02-22 17:35:29 +00:00
Mark Andrews
add40273df
Test RRSIG queries with serve-stale enabled
Make RRSIG queries where the existing tests trigger a DNS_EVENT_TRYSTALE
event.
2023-02-22 13:22:02 +01:00
Aram Sargsyan
4b52b0b4a9
Add tests for CVE-2022-3924
Reproduce the assertion by configuring a 'named' resolver with
'recursive-clients 10;' configuration option and running 20
queries is parallel.

Also tweak the 'ans2/ans.pl' to simulate a 50ms network latency
when qname starts with "latency". This makes sure that queries
running in parallel don't get served immediately, thus allowing
the configured recursive clients quota limitation to be activated.
2023-02-22 10:39:06 +01:00
Evan Hunt
aea4f10817 make builtin a standalone dns_db implementation
instead of using the SDB API as a wrapper to register and
unregister and provide a call framework for the builtin databases,
this commit flattens things so that the builtin databases implement
dns_db directly.
2023-02-21 10:13:10 -08:00
Evan Hunt
603cdb6332 move the dns_sdb API
move all dns_sdb code into bin/named/builtin.c, which is the
only place from which it's called.

(note this is temporary: later we'll refactor builtin so that it's a
standalone dns_db implementation on its own instead of using SDB
as a wrapper.)
2023-02-21 10:13:10 -08:00
Evan Hunt
77e7eac54c enable detailed db tracing
move database attach/detach functions to db.c, instead of
requiring them to be implemented for every database type.
instead, they must implement a 'destroy' function that is
called when references go to zero.

this enables us to use ISC_REFCOUNT_IMPL for databases,
with detailed tracing enabled by setting DNS_DB_TRACE to 1.
2023-02-21 10:13:10 -08:00
Evan Hunt
8da43bb7f5 simplify dns_sdb API
SDB is currently (and foreseeably) only used by the named
builtin databases, so it only needs as much of its API as
those databases use.

- removed three flags defined for the SDB API that were always
  set the same by builtin databases.

- there were two different types of lookup functions defined for
  SDB, using slightly different function signatures. since backward
  compatibility is no longer a concern, we can eliminate the 'lookup'
  entry point and rename 'lookup2' to 'lookup'.

- removed the 'allnodes' entry point and all database iterator
  implementation code

- removed dns_sdb_putnamedrr() and dns_sdb_putnamedrdata() since
  they were never used.
2023-02-21 10:13:10 -08:00
Evan Hunt
ffa4757c79 use member name initialization for methods
initialize dns_dbmethods, dns_sdbmethods and dns_rdatasetmethods
using explicit struct member names, so we don't have to keep track
of NULLs for unimplemented functions any longer.
2023-02-21 10:13:10 -08:00
Evan Hunt
8036412aaa make fewer dns_db functions mandatory-to-implement
some dns_db functions would have crashed if the DB implementation failed
to implement them, requiring the implementations to add functions that
did nothing but return ISC_R_NOTIMPLEMENTED or some obvious default
value. we can just have the dns_db wrapper functions themselves return
those values, and clean up the implementations accordingly.
2023-02-21 10:13:10 -08:00
Mark Andrews
b41882cc75 Fix dns_kasp_attach / dns_kasp_detach usage
The kasp pointers in dns_zone_t should consistently be changed by
dns_kasp_attach and dns_kasp_detach so the usage is balanced.
2023-02-21 15:47:44 +01:00
Tony Finch
4da9c582b8 Remove libbind9
It is now empty.
2023-02-21 13:12:26 +00:00
Tony Finch
3fef7c626a Move bind9_getaddresses() to isc_getaddresses()
No need to have a whole library for one function.
2023-02-21 13:12:26 +00:00
Aram Sargsyan
121a095a22 Detach rpzs and catzs from the previous view
When switching to a new view during a reconfiguration (or reverting
to the old view), detach the 'rpzs' and 'catzs' from the previuos view.

The 'catzs' case was earlier solved slightly differently, by detaching
from the new view when reverting to the old view, but we can not solve
this the same way for 'rpzs', because now in BIND 9.19 and BIND 9.18
a dns_rpz_shutdown_rpzs() call was added in view's destroy() function
before detaching the 'rpzs', so we can not leave the 'rpzs' attached to
the previous view and let it be shut down when we intend to continue
using it with the new view.

Instead, "re-fix" the issue for the 'catzs' pointer the same way as
for 'rpzs' for consistency, and also because a similar shutdown call
is likely to be implemented for 'catzs' in the near future.
2023-02-21 08:23:13 +00:00
Aram Sargsyan
95f4bac002 Add an "rpz" system test check for a failed reconfiguration
The faulty "DLZ" configuration triggers a reconfiguration failure
in such a place where view reverting code is covered.
2023-02-21 08:23:13 +00:00
Evan Hunt
197334464e remove named_os_gethostname()
this function was just a front-end for gethostname(). it was
needed when we supported windows, which has a different function
for looking up the hostname; it's not needed any longer.
2023-02-18 20:23:41 +00:00
Michal Nowak
8064ac6bec
Fix unnecessary "else" after "raise" with pylint 2.16.2
bin/tests/system/get_algorithms.py:225:4: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)
2023-02-17 15:31:52 +01:00
Michal Nowak
3cd2cc6254
Adapt to Python scripts to black 23.1.0 2023-02-17 15:31:52 +01:00
Tony Finch
dcb54af220 Move bind9/check to isccfg/check
Since it is part of the configuration machinery
2023-02-17 12:13:37 +00:00
Evan Hunt
a52b17d39b
remove isc_task completely
as there is no further use of isc_task in BIND, this commit removes
it, along with isc_taskmgr, isc_event, and all other related types.

functions that accepted taskmgr as a parameter have been cleaned up.
as a result of this change, some functions can no longer fail, so
they've been changed to type void, and their callers have been
updated accordingly.

the tasks table has been removed from the statistics channel and
the stats version has been updated. dns_dyndbctx has been changed
to reference the loopmgr instead of taskmgr, and DNS_DYNDB_VERSION
has been udpated as well.
2023-02-16 18:35:32 +01:00
Evan Hunt
a9f9041fe6
refactor dns_catz to use loop callbacks
catz events are now scheduled using isc_task_async() instead
of isc_task_send().
2023-02-16 17:51:55 +01:00
Evan Hunt
9bdf982ea6
refactor delzone to use loop callbacks
the rmzone() function is now posted using isc_async_run().

dns_zone_gettask() is no longer used anywhere, and has been
removed.
2023-02-16 17:51:55 +01:00
Evan Hunt
f58e7c28cd
switch to using isc_loopmgr_pause() instead of task exclusive
change functions using isc_taskmgr_beginexclusive() to use
isc_loopmgr_pause() instead.

also, removed an unnecessary use of exclusive mode in
named_server_tcptimeouts().

most functions that were implemented as task events because they needed
to be running in a task to use exclusive mode have now been changed
into loop callbacks instead. (the exception is catz, which is being
changed in a separate commit because it's a particularly complex change.)
2023-02-16 17:51:55 +01:00
Evan Hunt
0312789129
refactor dns_resolver to use loop callbacks
callback events from dns_resolver_createfetch() are now posted
using isc_async_run.

other modules which called the resolver and maintained task/taskmgr
objects for this purpose have been cleaned up.
2023-02-16 17:27:59 +01:00
Evan Hunt
83593167cd
refactor dyndb sample driver to use loop callbacks
the syncptr function in the dyndb sample driver now uses
isc_async_run().
2023-02-16 17:16:42 +01:00
Evan Hunt
b061c7e27f
refactor plugin hook resumption to use loop callbacks
plugins supporting asynchronous operation now use a loop callback
to resume operation in query_hookresume() rather than a task.
2023-02-16 17:16:41 +01:00
Evan Hunt
773d47c95c
refactor TAT queries to use loop callbacks
trust anchor telemetry events are now posted via isc_async_run().
(an isc_task is still used for dns_resolver_createfetch().)
2023-02-16 17:16:41 +01:00
Evan Hunt
106da9c190
refactor dns_request to use loopmgr callbacks
dns_request_create() and _createraw() now take a 'loop' parameter
and run the callback event on the specified loop.

as the task manager is no longer used, it has been removed from
the dns_requestmgr structure.  the dns_resolver_taskmgr() function
is also no longer used and has been removed.
2023-02-16 14:55:06 +01:00
Michal Nowak
3203d6c549 BIND 9.19.10
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEIz+ZTe/bbr1Q+/5RJKPoRjruXlYFAmPc6LIACgkQJKPoRjru
 XlY2sxAApR7URjCmNfNmNim0WZcM44gNZbhyVQZ7EwrVYz9VELeJEu9EcLEkVzi2
 KQwkB7ClSee/or0fT5i9P2rNu8aZFbZutjePqpoXffBJ+nZVDBltbxt3XJti3J14
 P3EW8qqFDv2g1Fgf603231HLEVBss2knEk3mzsbFlvqdiTPbcWkb30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hh0I7WamP6/RNz8jFnVmgZKDpZ2zqyeN/Umep6MyX1OFpCho
 fbVArEMfKfFthEaJ1JwD7oDivOh2t+yPycJGbDsXJA++mP4kkJ7elnrOs9qu42mG
 m//FNVFbc1lS1GounwF4/cCRauFZrnbSX1LOGP30Wj+0hPFSr9T4Ie+VgO5U6FlI
 HuG1LabeEWPCkOcmT6cuVQ207e4U/IvN6z6h8hSEzjfqmLjxbS5Q4hyzZNeHr4Tw
 BxOVoAdXAmH841JsSRDkgpbRDGdu3l2qy1v6Prg050mjp8Z4AVk=
 =2S8g
 -----END PGP SIGNATURE-----

Merge tag 'v9_19_10'

BIND 9.19.10
2023-02-16 13:38:33 +01:00
Mark Andrews
e27fc4bbc5 Cleanup OpenSSL reference on bad option
Another exit path that needs to be cleaned up.
2023-02-16 10:55:42 +11:00
Mark Andrews
4c2525c418 Cleanup OpenSSL reference on bad domain name
Free/detach tsigkey and sig0key when exiting and then call
dst_lib_destroy if we have previously called dst_lib_init.  This will,
in theory, allow OPENSSL_cleanup to free all memory.
2023-02-16 10:55:41 +11:00
Tony Finch
f9c725d7d4 Remove do-nothing header <isc/stat.h>
Use <sys/stat.h> instead
2023-02-15 16:44:47 +00:00