Commit Graph
12571 Commits
Author SHA1 Message Date
Mark Andrews c7cdc47cc5 move provide-ixfr testing after the serial has been checked 2020-05-14 16:37:34 +10:00
Witold Kręcicki f4260dc0c5 Fix 'error: ‘%s’ directive argument is null [-Werror=format-overflow=]' in assertions.c 2020-05-13 11:02:23 +02:00
Witold Kręcicki 2f252a1068 Clean quota callback after calling it 2020-05-13 08:45:27 +02:00
Witold Kręcicki 60629e5b0b Redesigned TCP accepting: one listen/accept loop, passing the connected socket.
Instead of using bind() and passing the listening socket to the children
threads using uv_export/uv_import use one thread that does the accepting,
and then passes the connected socket using uv_export/uv_import to a random
worker. The previous solution had thundering herd problems (all workers
waking up on one connection and trying to accept()), this one avoids this
and is simpler.
The tcp clients quota is simplified with isc_quota_attach_cb - a callback
is issued when the quota is available.
2020-05-13 08:45:27 +02:00
Mark Andrews 919a9ece25 enforce record count maximums 2020-05-13 15:35:28 +10:00
Mark Andrews 79de6edde8 allow grant rules to be retrieved 2020-05-13 15:35:28 +10:00
Mark Andrews 361ec726cb allow per type record counts to be specified 2020-05-13 15:35:28 +10:00
Evan Hunt 7192edf9c2 don't bother checking for empty nodes when searching the NSEC3 tree
this avoids a time-wasting search that could occur during an
IXFR that replaced an NSEC3 chain.
2020-05-12 12:35:29 -07:00
Mark Andrews 1c8f9d06e2 Also print out valid printable utf8 2020-05-12 22:01:54 +10:00
Mark Andrews b144ae1bb0 Report Extended DNS Error codes 2020-05-12 22:01:54 +10:00
Diego Fronza f2bf7beeb6 Added new logging category rpz-passthru
It is now possible to use the new logging category "rpz-passthru"
to redirect RPZ passthru activity to a dedicate logging channel.
2020-05-07 11:44:48 -03:00
Evan Hunt f8d753d452 initialize sockaddrdscp to prevent spurious output from 'named-checkconf -p' 2020-05-05 12:48:31 -07:00
Evan HuntandMichał Kępień b89decfcc9 replace fputs() with fprintf() 2020-05-04 09:14:58 +02:00
Witold KręcickiandOndřej Surý fa02f6438b Don't set UDP recv/send buffer sizes - use system defaults (unless explicitly defined) 2020-05-01 17:04:00 +02:00
Ondřej SurýandOndřej Surý 09ba47b067 Use SO_REUSEPORT only on Linux, use SO_REUSEPORT_LB on FreeBSD
The SO_REUSEPORT socket option on Linux means something else on BSD
based systems.  On FreeBSD there's 1:1 option SO_REUSEPORT_LB, so we can
use that.
2020-05-01 15:20:55 +02:00
Aaron ThompsonandOndřej Surý 6a9f20d031 Add engine support to OpenSSL EdDSA implementation. 2020-05-01 14:11:08 +02:00
Aaron ThompsonandOndřej Surý f9685b29f9 Use OpenSSL raw key functions for EdDSA keys. 2020-05-01 14:11:08 +02:00
Ondřej SurýandOndřej Surý 064d8b7a6d Simplify error handling 2020-05-01 10:36:45 +02:00
Ondřej SurýandOndřej Surý aff61535c2 Add initial support for ECDSA keys via OpenSSL PKCS#11 engine 2020-05-01 10:36:45 +02:00
Mark Andrews a66c6fc883 Mimic nzf_append from bin/named/server.c
nzf_append is conditionally compiled and this is intended to
catch error introduced by changes to the called functions on all
systems before the changes are run through the CI.
2020-05-01 06:51:05 +10:00
Mark Andrews b02081d423 Escape double quote when printing quoted string.
When we were printing quoted string, the double quotes where unescaped
leading to prematurely ending the quoted string.
2020-05-01 06:51:05 +10:00
Aaron ThompsonandOndřej Surý 2e6b7a56cc Update EdDSA implementation to PKCS#11 v3.0.
Per Current Mechanisms 2.3.5, the curve name is DER-encoded in the
EC_PARAMS attribute, and the public key value is DER-encoded in the
EC_POINT attribute.
2020-04-30 18:40:45 +02:00
Aaron ThompsonandOndřej Surý 9b87fe1051 Fix EdDSA key sizes (key_size is in bits). 2020-04-30 18:40:45 +02:00
Witold Kręcicki 83049ceabf Don't free udp recv buffer if UV_UDP_MMSG_CHUNK is set 2020-04-30 17:30:37 +02:00
Ondřej SurýandWitold Kręcicki d5356a40ff Use UV_UDP_RECVMMSG to enable mmsg support in libuv if available 2020-04-30 17:30:37 +02:00
Ondřej Surý c86ebeebd2 As libltdl is convenience library, link it just into libisc 2020-04-30 15:33:44 +02:00
Ondřej Surý 86f322133f Fix the noinst_LTLIBRARIES -> check_LTLIBRARIES in libisc and libdns unit tests 2020-04-27 15:18:31 +02:00
Evan HuntandOndřej Surý 17a1bafc08 Restore behaviour of "make test" and "make unit"
Add recursive "test" and "unit" rules, which execute "make check"
in specific directories - "make test" runs the system tests, and
"make unit" runs the unit tests.
2020-04-27 15:02:30 +02:00
Ondřej Surý 5f0efcbb3c Cleanup libirs APIs and slim down the library to just irs_resconf
The libirs contained own re-implementations of the getaddrinfo,
getnameinfo and gai_strerror + irs_context and irs_dnsconf API that was
unused anywhere in the BIND 9.

Keep just the irs_resonf API that is being extensively used to parse
/etc/resolv.conf by several of BIND 9 tools.
2020-04-24 08:33:34 +02:00
Ondřej Surý 6494665f08 Remove 'ephemeral' database implementation
The 'ephemeral' database implementation was used to provide a
lightweight database implemenation that doesn't cache results, and the
only place where it was really use is "samples" because delv is
overriding this to use "rbtdb" instead. Otherwise it was completely
unused.

 * The 'ephemeral' cache DB (ecdb) implementation.  An ecdb just provides
 * temporary storage for ongoing name resolution with the common DB interfaces.
 * It actually doesn't cache anything.  The implementation expects any stored
 * data is released within a short period, and does not care about the
 * scalability in terms of the number of nodes.
2020-04-23 18:05:53 +02:00
Ondřej Surý 6a6a9f7afa Add OPENSSL_CFLAGS to libdns tests that include dst_internal.h
The three libdns tests directly include ../dst_internal.h which
in turn directly include openssl headers, thus there was a missing
path and build failure on systems where OpenSSL is not in the default
include path.
2020-04-23 15:53:03 +02:00
Ondřej Surý bdca09aa8d Remove unused isc_lfsr API
The isc_lfsr API was used to generate message IDs in the past.
Currently, it's just cruft.
2020-04-23 12:16:22 +02:00
Evan Hunt 286e8cd7ea acquire maintenance lock when running incremental RPZ updates
this addresses a race that could occur during shutdown or when
reconfiguring to remove RPZ zones.

this change should ensure that the rpzs structure and the incremental
updates don't interfere with each other: rpzs->zones entries cannot
be set to NULL while an update quantum is running, and the
task should be destroyed and its queue purged so that no subsequent
quanta will run.
2020-04-21 15:53:58 -07:00
Ondřej SurýandOndřej Surý 978c7b2e89 Complete rewrite the BIND 9 build system
The rewrite of BIND 9 build system is a large work and cannot be reasonable
split into separate merge requests.  Addition of the automake has a positive
effect on the readability and maintainability of the build system as it is more
declarative, it allows conditional and we are able to drop all of the custom
make code that BIND 9 developed over the years to overcome the deficiencies of
autoconf + custom Makefile.in files.

This squashed commit contains following changes:

- conversion (or rather fresh rewrite) of all Makefile.in files to Makefile.am
  by using automake

- the libtool is now properly integrated with automake (the way we used it
  was rather hackish as the only official way how to use libtool is via
  automake

- the dynamic module loading was rewritten from a custom patchwork to libtool's
  libltdl (which includes the patchwork to support module loading on different
  systems internally)

- conversion of the unit test executor from kyua to automake parallel driver

- conversion of the system test executor from custom make/shell to automake
  parallel driver

- The GSSAPI has been refactored, the custom SPNEGO on the basis that
  all major KRB5/GSSAPI (mit-krb5, heimdal and Windows) implementations
  support SPNEGO mechanism.

- The various defunct tests from bin/tests have been removed:
  bin/tests/optional and bin/tests/pkcs11

- The text files generated from the MD files have been removed, the
  MarkDown has been designed to be readable by both humans and computers

- The xsl header is now generated by a simple sed command instead of
  perl helper

- The <irs/platform.h> header has been removed

- cleanups of configure.ac script to make it more simpler, addition of multiple
  macros (there's still work to be done though)

- the tarball can now be prepared with `make dist`

- the system tests are partially able to run in oot build

Here's a list of unfinished work that needs to be completed in subsequent merge
requests:

- `make distcheck` doesn't yet work (because of system tests oot run is not yet
  finished)

- documentation is not yet built, there's a different merge request with docbook
  to sphinx-build rst conversion that needs to be rebased and adapted on top of
  the automake

- msvc build is non functional yet and we need to decide whether we will just
  cross-compile bind9 using mingw-w64 or fix the msvc build

- contributed dlz modules are not included neither in the autoconf nor automake
2020-04-21 14:19:48 +02:00
Ondřej SurýandOndřej Surý 4df5a5832c Remove files generated by autotools 2020-04-21 14:19:30 +02:00
Ondřej Surý 98b3b93791 Remove python based tools (dnssec-keymgr, dnssec-coverage, dnssec-checkds)
With the introduction of dnssec-policy, the aforementioned tools were
either rendered obsolete, or they will be replaced with dnssec-policy
based tools.  Remove the tools and the requirement to have Python
installed.  Python 3 is still being used for tests, so keep the autoconf
test, but make it much simpler.
2020-04-21 14:19:30 +02:00
Witold KręcickiandOndřej Surý 62f738ba48 Fix detaching the extra quotas in the quota_test 2020-04-21 14:17:20 +02:00
Ondřej Surý 54defc8b78 Enable quota_test in Kyuafile 2020-04-21 12:30:11 +02:00
Ondřej Surý cf30e7d0d1 Use switch instead of if when evaluating curves
Previously, the code would do:

    REQUIRE(alg == CURVE1 || alg == CURVE2);

    [...]

    if (alg == CURVE1) { /* code for CURVE1 */ }
    else { /* code for CURVE2 */ }

This approach is less extensible and also more prone to errors in case
the initial REQUIRE() is forgotten.  The code has been refactored to
use:

    REQUIRE(alg == CURVE1 || alg == CURVE2);

    [...]

    switch (alg) {
    case CURVE1: /* code for CURVE1 */; break;
    case CURVE2: /* code for CURVE2 */; break;
    default: INSIST(0);
    }
2020-04-20 11:40:42 +02:00
Ondřej Surý da38bd0e1d Refactor the code using the pk11 ECC constants.
The pk11/constants.h header contained static CK_BYTE arrays and
we had to use #defines to pull only those we need.  This commit
changes the constants to only define byte arrays with the content
and either use them directly or define the CK_BYTE arrays locally
where used.
2020-04-20 11:40:42 +02:00
Aaron ThompsonandOndřej Surý 541d7bafe6 Fix a segfault when a PKCS#11 token is not found. 2020-04-20 11:40:42 +02:00
Aaron ThompsonandOndřej Surý 46cae09023 Fix bad syntax in pkcs11eddsa_link.c.
Introduced in 994e656977.
2020-04-20 11:40:41 +02:00
Aaron ThompsonandOndřej Surý 3e685fe01a Update to PKCS#11 v3.0 EdDSA macros. 2020-04-20 11:40:41 +02:00
Aaron ThompsonandOndřej Surý 2ef379d911 Fix compiler warnings about unused pk11 constants. 2020-04-20 11:40:41 +02:00
Aaron ThompsonandOndřej Surý d28c7dadbb Remove remaining PKCS#11 DH references.
Missed in 0a73c9f137 and 8efd394c80.
2020-04-20 11:40:41 +02:00
Aaron ThompsonandOndřej Surý 6a6485a531 Remove unnecessary forward declarations. 2020-04-20 11:40:41 +02:00
Aaron ThompsonandOndřej Surý 7744aece03 Finish refactoring pkcs11eddsa_link.c after isc_buffer_allocate change.
Left over after c73e5866c4.
2020-04-20 11:40:41 +02:00
Aaron ThompsonandOndřej Surý b4a7bfd55e Remove unreachable label in pkcs11eddsa_link.c.
Missed in ae83801e2b.
2020-04-20 11:40:41 +02:00
Aaron ThompsonandOndřej Surý 7fc4f926fb Finish refactoring after the removal of --with-ecdsa and --with-eddsa.
Missed in c3b8130fe8.
2020-04-20 11:40:41 +02:00
Aaron ThompsonandOndřej Surý bb158e8a4c Finish replacing OP_EC with OP_ECDSA/OP_EDDSA.
Missed in c3b8130fe8.
2020-04-20 11:40:41 +02:00