Commit Graph
7180 Commits
Author SHA1 Message Date
Witold Kręcicki 5081e6c6e0 Get rid of internal allocator 2018-11-09 10:32:57 +00:00
Ondřej Surý 6f5fe11f5a isc_stdtime_t is always 32-bit now, so remove the always true macro STDTIME_ON_32BITS 2018-11-09 02:27:06 +07:00
Ondřej Surý 23fff6c569 Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached 2018-11-08 12:22:17 +07:00
Ondřej Surý b992b5b811 Modify the dbversion_test.c to detect disabled assertions 2018-11-08 12:22:17 +07:00
Ondřej Surý 29c45200e7 Add extra return failure after INSIST(0) in default branch 2018-11-08 12:22:17 +07:00
Ondřej Surý 4eaf927571 Use larger buffers on snprintf buffer overflow false positives 2018-11-08 12:21:53 +07:00
Ondřej Surý b2b43fd235 Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool 2018-11-08 12:21:53 +07:00
Ondřej Surý fbd2e47f51 Add small tweaks to the code to fix compilation when ISC assertions are disabled
While implementing the new unit testing framework cmocka, it was found that the
BIND 9 code doesn't compile when assertions are disabled or replaced with any
function (such as mock_assert() from cmocka unit testing framework) that's not
directly recognized as assertion by the compiler.

This made the compiler to complain about blocks of code that was recognized as
unreachable before, but now it isn't.

The changes in this commit include:

* assigns default values to couple of local variables,
* moves some return statements around INSIST assertions,
* adds __builtin_unreachable(); annotations after some INSIST assertions,
* fixes one broken assertion (= instead of ==)
2018-11-08 12:21:53 +07:00
Witold Kręcicki 9a903789ed Use larger quantum for network tasks 2018-11-06 08:19:50 +00:00
Tony FinchandEvan Hunt 1b1d63acd8 Fixes for rndc nta user interface
Tell the user explicitly about their mistakes:

* Unknown options, e.g. -list instead of -dump
  or -delete instead of -remove.

* Unknown view names.

* Excess arguments.

Include the view name in `rndc nta -dump` output, for consistency with
the NTA add and remove actions.

When removing an NTA from all views, do not abort with an error if the
NTA was not found in one of the views.
2018-11-05 22:01:28 -08:00
Tony FinchandMark Andrews 3064d3d0ef Abolish ip6.int support in dig and mdig 2018-11-05 19:07:31 -05:00
Mark AndrewsandEvan Hunt 99b25eb379 two dns_name_dup calls were not checked 2018-11-05 14:46:08 -08:00
Witold Kręcicki 2d0a33208c Cleanup fctx->finds before sending 'final' query after qname minimization.
At the beginning of qname minimization we get fctx->finds filled with what's
in the cache at this point, in worst case root servers. After doing full
run querying for NSes at different levels we need to clean it and refill
it with proper values from cache.
2018-11-05 09:57:11 +00:00
Witold KręcickiandMichał Kępień 54b9690a4e Remove vector socket functions from Unix socket code and library headers
Remove the following functions in order to simplify socket code:

  - isc_socket_recvv()
  - isc_socket_sendtov()
  - isc_socket_sendtov2()
  - isc_socket_sendv()
2018-10-31 12:12:53 +01:00
Ondřej Surý c1d111cd2e Destroy task first when destroying catzs.
When freeing catzs structures we need to kill the updater task first.
    Otherwise we might race with the updater and there might be a crash
    on shutdown.
2018-10-30 14:01:01 +01:00
Witold KręcickiandOndřej Surý 541872bf3b Destroy task first when destroying rpzs.
When freeing rpzs structures we need to kill the updater task first.
Otherwise we might race with the updater and there might be a crash
on shutdown.
2018-10-30 14:01:01 +01:00
Mark Andrews cf83016682 compare_nxt compared records with identical next fields case insensitively 2018-10-30 14:51:39 +11:00
Mark Andrews 2ff57d8a39 Record types which support a empty rdata field were not handling the empty rdata field case. 2018-10-30 11:03:02 +11:00
Witold Kręcicki 8283cbabdc <stdlib.h> include in rpz.c for strtoul 2018-10-29 23:04:01 +01:00
Michał KępieńandWitold Kręcicki 139bc2c6ab Release all resources when shutting down an RPZ zone during an update
If an RPZ zone is to be freed during an update, canceling the
update_quantum() event is not enough because the resources released when
an update completes also need to be accounted for.  Failure to do this
results in a hang upon shutdown.  Fix by copying cleanup code from the
end of update_quantum() to rpz_detach().
2018-10-29 23:04:00 +01:00
Witold Kręcicki faf2c7711a Fix a race in RPZ with min-update-interval set to 0
If another RPZ update is pending when processing the previous one nears
completion and min-update-interval is set to 0, isc_timer_reset() gets
called with 'interval' set to 0, which triggers an assertion failure.
To prevent such a scenario from causing a crash, queue the update event
directly instead of asking the timer thread to do it.
2018-10-29 23:04:00 +01:00
Witold Kręcicki 37df3ca8b6 Style nits 2018-10-29 19:22:10 +00:00
Witold Kręcicki 08460c8cb2 Don't do qname minimization when forwarding; Avoid some intermittent errors in qmin tests caused by timing 2018-10-29 19:22:10 +00:00
Mark Andrews 1cf1254051 Initalize TZ environment variable before calling dns_test_begin in dnstap_test. 2018-10-29 16:15:52 +11:00
Evan Hunt ff747365db avoid makefile conditional 2018-10-26 23:34:34 -07:00
Ondřej Surý d6c50674bb Remove last traces of DSA and NSEC3DSA algorithm, but restore the algnumber -> name mapping 2018-10-26 11:50:11 +02:00
Ondřej Surý 83dbe04bf3 Update dst_test.c to use ECDSA256 and RSASHA256 as test algorithms 2018-10-26 11:50:11 +02:00
Ondřej Surý fbb08b30b8 Remove traces of DST_ALG_ECC which is now just Reserved in IANA registry 2018-10-26 11:50:11 +02:00
Mark Andrews 3219a873a9 free hkey on error 2018-10-26 17:46:15 +11:00
Mark AndrewsandEvan Hunt fbab100426 Add support for EID and NIMLOC 2018-10-25 15:20:33 -07:00
Mark AndrewsandEvan Hunt eb7ca65b78 GID, UID and UINFO could not be loaded using unknown record format. 2018-10-25 13:00:32 -07:00
Ondřej Surý c3846425f3 Don't include inet/arpa.h on Windows 2018-10-25 20:59:48 +02:00
Evan Hunt c852810fbc correctly attach and detach memory context 2018-10-25 11:27:28 -07:00
Ondřej Surý 7fc78e7cad Remove internal dst memory context that was used just for OpenSSL and was passthrough for malloc and free 2018-10-25 08:16:24 +02:00
Ondřej Surý af69bf5491 Add tkey_test.c with mocked isc_mem object 2018-10-25 08:16:24 +02:00
Ondřej Surý b98ac2593c Add generic hashed message authentication code API (isc_hmac) to replace specific HMAC functions hmacmd5/hmacsha1/hmacsha2... 2018-10-25 08:15:42 +02:00
Ondřej Surý 7fd3dc63de Add generic message digest API (isc_md) to replace specific MD functions md5/sha1/sha256 2018-10-25 08:15:42 +02:00
Mark Andrews f9ceddd8ca Add support for ATMA 2018-10-25 13:21:49 +11:00
Michał KępieńandOndřej Surý 2cb9e8a020 Replace the "mirror" zone option with "type mirror;"
Use a zone's 'type' field instead of the value of its DNS_ZONEOPT_MIRROR
option for checking whether it is a mirror zone.  This makes said zone
option and its associated helper function, dns_zone_mirror(), redundant,
so remove them.  Remove a check specific to mirror zones from
named_zone_reusable() since another check in that function ensures that
changing a zone's type prevents it from being reused during
reconfiguration.
2018-10-24 20:32:55 +02:00
Michał KępieńandOndřej Surý e1bb8de6f0 Define a separate dns_zonetype_t for mirror zones
Rather than overloading dns_zone_slave and discerning between a slave
zone and a mirror zone using a zone option, define a separate enum
value, dns_zone_mirror, to be used exclusively by mirror zones.  Update
code handling slave zones to ensure it also handles mirror zones where
applicable.
2018-10-24 20:32:55 +02:00
Mark Andrews 607c2d7441 free key on error 2018-10-23 20:19:07 -04:00
Mark AndrewsandWitold Kręcicki ba85bb1a85 whitespace 2018-10-23 12:15:04 +00:00
Mark AndrewsandWitold Kręcicki 2b3b626cc1 set fctx->client to NULL 2018-10-23 12:15:04 +00:00
Mark AndrewsandWitold Kręcicki 23766ff690 checkpoint 2018-10-23 12:15:04 +00:00
Witold Kręcicki 86246c7431 Initialize adbname->client properly; check for loops 2018-10-23 12:15:04 +00:00
Mark AndrewsandWitold Kręcicki 2f36a62d16 use RUNTIME_CHECK 2018-10-23 12:15:04 +00:00
Mark AndrewsandWitold Kręcicki 1a2a19c693 address fctx reference count leaks; style 2018-10-23 12:15:04 +00:00
Witold Kręcicki f2af336dc4 Fix looping issues 2018-10-23 12:15:04 +00:00
Witold Kręcicki 70a1ba20ec QNAME miminimization should create a separate fetch context for each fetch -
this makes the cache more efficient and eliminates duplicates queries.
2018-10-23 12:15:04 +00:00
Ondřej Surý c4cee27f9b Add support for enabling and enforcing FIPS mode in OpenSSL:
* Add configure option --enable-fips-mode that detects and enables FIPS mode
* Add a function to enable FIPS mode and call it on crypto init
* Log an OpenSSL error when FIPS_mode_set() fails and exit
* Report FIPS mode status in a separate log message from named
2018-10-22 20:55:35 +02:00