2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

7407 Commits

Author SHA1 Message Date
Evan Hunt
fea6b5bf10 add a search for GeoIP2 libraries in configure
- "--with-geoip" is used to enable the legacy GeoIP library.
- "--with-geoip2" is used to enable the new GeoIP2 library
  (libmaxminddb), and is on by default if the library is found.
- using both "--with-geoip" and "--with-geoip2" at the same time
  is an error.
- an attempt is made to determine the default GeoIP2 database path at
  compile time if pkg-config is able to report the module prefix. if
  this fails, it will be necessary to set the path in named.conf with
  geoip-directory
- Makefiles have been updated, and a stub lib/dns/geoip2.c has been
  added for the eventual GeoIP2 search implementation.
2019-06-27 14:58:13 -07:00
Evan Hunt
0b792bd37b don't overwrite the dns_master_loadfile() result before calling zone_postload()
if "rndc reload" fails, the result code is supposed to be passed to
zone_postload, but for inline-signing zones, the result can be
overwritten first by a call to the ZONE_TRYLOCK macro. this can lead
to the partially-loaded unsigned zone being synced over to the signed
zone instead of being rejected.
2019-06-26 08:26:32 -07:00
Michał Kępień
6cfcc6e8a2 Include <stdlib.h> in lib/dns/dnsrps.c
Since commit 0771dd3be8bad18f669de978f3be5e08cf2dbd6e, <isc/mem.h> no
longer includes <isc/xml.h>.  On some systems (e.g. FreeBSD), this means
that no header included by lib/dns/dnsrps.c (and no header included by
those headers) contains a definition of free() any more, which triggers
a compiler warning as lib/dns/dnsrps.c calls that function.  Add the
missing #include directive to prevent that warning from being triggered.
2019-06-26 08:45:23 +02:00
Michał Kępień
f1c236d95d Remove nonexistent function from libdns.def.in
No function called dns_dnssecsignstats_decrement() actually exists.
Putting it into lib/dns/win32/libdns.def.in breaks at least some Windows
builds.  Remove the nonexistent function from that file.
2019-06-25 22:27:01 +02:00
Ondřej Surý
5d1e7be582 Rename OPENSSL_INCLUDES to OPENSSL_CFLAGS in AX_CHECK_OPENSSL() macro
The ax_check_openssl m4 macro used OPENSSL_INCLUDES.  Rename the
subst variable to OPENSSL_CFLAGS and wrap AX_CHECK_OPENSSL() in
action-if-not-found part of PKG_CHECK_MODULE check for libcrypto.
2019-06-25 12:36:01 +02:00
Ondřej Surý
e3e6888946 Make the usage of json-c objects opaque to the caller
The json-c have previously leaked into the global namespace leading
to forced -I<include_path> for every compilation unit using isc/xml.h
header.  This MR fixes the usage making the caller object opaque.
2019-06-25 12:04:20 +02:00
Ondřej Surý
0771dd3be8 Make the usage of libxml2 opaque to the caller
The libxml2 have previously leaked into the global namespace leading
to forced -I<include_path> for every compilation unit using isc/xml.h
header.  This MR fixes the usage making the caller object opaque.
2019-06-25 12:01:32 +02:00
Matthijs Mekking
6f67546cd6 Also collect DNSSEC refresh signature statistics
In addition to gather how many times signatures are created per
key in a zone, also count how many of those signature creations are
because of DNSSEC maintenance.  These maintenance counters are
incremented if a signature is refreshed (but the RRset did not
changed), when the DNSKEY RRset is changed, and when that leads
to additional RRset / RRSIG updates (for example SOA, NSEC).
2019-06-25 11:40:01 +02:00
Matthijs Mekking
312fa7f65e Update dnskey sign operations statistics
Update per key tag the stats counter when it creates a new signature.
This can happen upon a dynamic update, or when doing DNSSEC
maintenance.
2019-06-25 11:40:01 +02:00
Matthijs Mekking
d8cf7aedfa Add DNSSEC sign operations statistics channel
Add a new statistics structure to record how many sign operations
a key has made within a zone.
2019-06-25 11:40:01 +02:00
Mark Andrews
79eed4e5c6 define ULLONG_MAX if not already defined
(cherry picked from commit 4110b9184da5660372342d620700436abac25c52)
2019-06-25 09:47:24 +10:00
Brian Conry
39344dfb3e Bump DNS_CLIENTINFOMETHODS_VERSION/_AGE to 2/1 in clientinfo.h
BIND 9.11.0 has bumped DNS_CLIENTINFOMETHODS_VERSION and _AGE to
version 2 and 1 in the dlz_minimal.h because a member was addet to the
dnsclientinfo struct.  It was found out that the new member is not
used anywhere and there are no accessor functions therefore the change
was reverted.

Later on, it was found out that the revert caused some problems to the
users of BIND 9, and thus this changes takes a different approach by
syncing the values other way around.
2019-06-20 12:46:21 +02:00
Tinderbox User
9bb0b30bc2 prep 9.15.1 2019-06-19 15:36:28 -07:00
Mark Andrews
a78a9d37a8 move item_out test inside lock in dns_dispatch_getnext() 2019-06-19 15:35:57 -07:00
Ondřej Surý
52f98c5734 Rename mctx in dnstest.c to dt_mctx to prevent any global/local name clashes
The common construct seen in the BIND 9 source is func(isc_mem_t *mctx, ...).
Unfortunately, the dnstest.{h,c} has been using mctx as a global symbol, which
in turn generated a lot of errors when update.c got included in update_test.c.

As a rule of thumb, we should avoid naming global symbols with generic names
(like mctx) and we should prefix them with "namespace" (like dt_mctx).
2019-06-19 13:52:19 +02:00
Ondřej Surý
6a1f24a863 Make CHECK() macro local by moving it from dnstest.h to respective .c files
The CHECK() macro has been defined both in dnstest.h and update.c
files.  This has created a conflict between macro definitions when
including both of the files in update_test.c.  While the CHECK() macro
is convenient for the tests, it has been really used in just two
files, so the MR moves them into those respective .c files.
2019-06-19 13:51:01 +02:00
Ondřej Surý
6713c6703e Fix spurious lib/dns/tests/update_test errors on macOS
lib/dns/tests/update_test was failing on macOS on random occasions.  It
turned out this was a linker problem - it preferred isc_stdtime_get()
from libisc instead of the local version in lib/dns/tests/update_test.c.

Fix by including the original .c file in the unit test.  This has two
benefits:

 a) linking order may no longer cause issues as symbols found in the
    same compilation unit are always preferred,

 b) it allows writing tests for static functions in lib/dns/update.c.
2019-06-19 13:31:43 +02:00
Michał Kępień
ce796ac1f4 Address GCC 9.1 -O3 compilation warnings
Compiling with -O3 triggers the following warnings with GCC 9.1:

    task.c: In function ‘isc_taskmgr_create’:
    task.c:1384:43: warning: ‘%04u’ directive output may be truncated writing between 4 and 10 bytes into a region of size 6 [-Wformat-truncation=]
     1384 |   snprintf(name, sizeof(name), "isc-worker%04u", i);
          |                                           ^~~~
    task.c:1384:32: note: directive argument in the range [0, 4294967294]
     1384 |   snprintf(name, sizeof(name), "isc-worker%04u", i);
          |                                ^~~~~~~~~~~~~~~~
    task.c:1384:3: note: ‘snprintf’ output between 15 and 21 bytes into a destination of size 16
     1384 |   snprintf(name, sizeof(name), "isc-worker%04u", i);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    private_test.c: In function ‘private_nsec3_totext_test’:
    private_test.c:110:9: warning: array subscript 4 is outside array bounds of ‘uint32_t[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds]
      110 |  while (*sp == '\0' && slen > 0) {
          |         ^~~
    private_test.c:103:11: note: while referencing ‘salt’
      103 |  uint32_t salt;
          |           ^~~~

Prevent these warnings from being triggered by increasing the size of
the relevant array (task.c) and reordering conditions (private_test.c).
2019-06-11 10:18:23 +02:00
Ondřej Surý
3dcf121064 Put the items into unreachable LRU cache from first to last, not last to first 2019-06-11 09:38:59 +02:00
Witold Kręcicki
68eb9a7c6a In dns_zonemgr_unreachable use atomics to avoid unnecessary
write locking.

Unreachable cache in zonemgr is realized as an static LRU list.
When we 'use' an entry we need to update the last-used time, we
can use atomics to do so without the necessity to upgrading
read-lock to write-lock.
2019-06-11 09:38:59 +02:00
Evan Hunt
3853b3cf6d update documentation
- change references to trusted-keys to dnssec-keys with static-key
- rebuild doc/misc/options and other generated grammar doc
- add a "see MANAGED-KEYS" note when building named.conf.docbook
2019-06-05 07:49:57 -07:00
Evan Hunt
5ab252183b deprecate "trusted-keys"
- trusted-keys is now flagged as deprecated, but still works
- managed-keys can be used to configure permanent trust anchors by
  using the "static-key" keyword in place of "initial-key"
- parser now uses an enum for static-key and initial-key keywords
2019-06-05 07:49:23 -07:00
Tony Finch
a9dca5831b Remove cleaning-interval remnants.
Since 2008, the cleaning-interval timer has been documented as
"effectively obsolete" and disabled in the default configuration with
a comment saying "now meaningless".

This change deletes all the code that implements the cleaning-interval
timer, except for the config parser in whcih it is now explicitly
marked as obsolete.

I have verified (using the deletelru and deletettl cache stats) that
named still cleans the cache after this change.
2019-06-05 13:08:12 +10:00
Mark Andrews
bb51694d03 log TSIG key name when sending notify 2019-06-05 10:18:36 +10:00
Mark Andrews
30a50f9be4 check all RSA algorithms for weak keys 2019-06-05 09:00:05 +10:00
Mark Andrews
4e97f7dccc POST(optlen) 2019-06-04 01:23:01 -04:00
Evan Hunt
6d6e94bee7 fixup! Use experimental "_ A" minimization in relaxed mode. 2019-05-30 14:06:56 -07:00
Witold Kręcicki
ae52c2117e Use experimental "_ A" minimization in relaxed mode.
qname minimization, even in relaxed mode, can fail on
some very broken domains. In relaxed mode, instead of
asking for "foo.bar NS" ask for "_.foo.bar A" to either
get a delegation or NXDOMAIN. It will require more queries
than regular mode for proper NXDOMAINs.
2019-05-30 14:06:55 -07:00
Witold Kręcicki
2691e729f0 Don't SERVFAIL on lame delegations when doing minimization in relaxed mode.
qname minimization in relaxed mode should fall back to regular
resolution in case of failure.
2019-05-30 12:38:18 -07:00
Ondřej Surý
a25aa889e1 Fix uninitialized variable warning in restore_nsec3param() 2019-05-30 14:42:37 +02:00
Mark Andrews
5da97eeea6 fix Ed448 length values for precomputed ASN.1 prefix blobs 2019-05-30 18:00:31 +10:00
Ondřej Surý
52a8fb31c7 Revert "Merge branch '996-wrong-key-id-is-displayed-for-rsamd5-keys' into 'master'"
This reverts commit ea131d2e6a937964b65b9ccc4cd3f18de9f6d09f, reversing
changes made to e79dd268b6fb36b897a3258cdf959d87f60e55e0.
2019-05-29 15:34:08 +02:00
Ondřej Surý
4d2d3b49ce Cleanup the way we detect json-c library to use only pkg-config 2019-05-29 15:08:52 +02:00
Ondřej Surý
d4596baed4 Pull the values for LFS_{CFLAGS,LDFLAGS,LIBS} from autoconf instead using them directly in make 2019-05-29 11:50:24 +02:00
Ondřej Surý
4c7345bcb6 Use getconf LFS_{CFLAGS,LDFLAGS,LIBS} to get flags to compile lib/dns/gen
On some systems (namely Debian buster armhf) the readdir() call fails
with `Value too large for defined data type` unless the
_FILE_OFFSET_BITS=64 is defined.  The correct way to fix this is to
get the appropriate compilation parameters from getconf system
interface.
2019-05-29 06:58:41 +02:00
Ondřej Surý
05b7c08a16 Exit the ./gen program on failed readdir() call 2019-05-27 16:13:16 +02:00
Ondřej Surý
d5055665ca Remove isc_hash_reverse function 2019-05-21 10:23:17 +00:00
Ondřej Surý
2e7d82443f Convert isc_hash functions to use isc_siphash24 2019-05-21 10:23:13 +00:00
Ondřej Surý
eb8c9bdd55 Make lib/isc/app.c opaque and thread-safe
This work cleans up the API which includes couple of things:

1. Make the isc_appctx_t type fully opaque

2. Protect all access to the isc_app_t members via stdatomics

3. sigwait() is part of POSIX.1, remove dead non-sigwait code

4. Remove unused code: isc_appctx_set{taskmgr,sockmgr,timermgr}
2019-05-20 18:13:02 +02:00
Witold Kręcicki
a8e2ca6f7d Remove UNSPEC rrtype 2019-05-13 10:05:03 +07:00
Michał Kępień
5e80488270 Make NTAs work with validating forwarders
If named is configured to perform DNSSEC validation and also forwards
all queries ("forward only;") to validating resolvers, negative trust
anchors do not work properly because the CD bit is not set in queries
sent to the forwarders.  As a result, instead of retrieving bogus DNSSEC
material and making validation decisions based on its configuration,
named is only receiving SERVFAIL responses to queries for bogus data.
Fix by ensuring the CD bit is always set in queries sent to forwarders
if the query name is covered by an NTA.
2019-05-09 19:55:35 -07:00
Ondřej Surý
c8cb612d39 Make lib/dns/gen.c compatible with reproducible builds.
The gen.c will now use SOURCE_DATE_EPOCH[1] if found in environment
to make the build more reproducible build friendly.

1. https://reproducible-builds.org/specs/source-date-epoch/
2019-05-09 15:10:01 +07:00
Mark Andrews
ee7cf180b3 Recognise EDNS Client Tag and EDNS Server Tag 2019-05-09 17:29:23 +10:00
Tony Finch
8785f6fa34 Deprecate SHA-1 CDS records
This affects CDS records generated by `named` and `dnssec-signzone`
based on `-P sync` and `-D sync` key timing instructions.

This is for conformance with the DS/CDS algorithm requirements in
https://tools.ietf.org/html/draft-ietf-dnsop-algorithm-update
2019-05-08 18:17:55 -07:00
Mark Andrews
1722728c80 enforce known SSHFP finger print lengths 2019-05-09 08:11:43 +10:00
Mark Andrews
d8798098e8 support printing AAAA in expanded form 2019-05-06 21:50:38 -07:00
Mark Andrews
32ba5a0494 fix whitespace 2019-05-07 10:05:25 +10:00
Mark Andrews
127333c71f return rdatasets when processing ANY queries in client_resfind 2019-05-07 10:05:25 +10:00
Evan Hunt
0fd344e77a attach memory context sooner so that cleanup will work correctly 2019-04-26 18:27:37 -04:00
Mark Andrews
ffaa5a07dd compute the RSAMD5 key id 2019-04-24 08:05:27 +10:00