Commit graph

6978 commits

Author SHA1 Message Date
Petr Menšík
af021f136e Do not fail on NULL passed to OpenSSL_free
Some plugins might call it after deconstruction. Do not crash if there
is no reason for it.

(cherry picked from commit a26673a088)
2019-01-29 15:42:51 -08:00
Evan Hunt
665122be0d Revert "Merge branch 'ondrej/fix-race-condition-in-dnstap-v9_11' into 'v9_11'"
This reverts merge request !1345
2019-01-23 13:56:26 -05:00
Evan Hunt
e511187ebd removed a debugging fprintf
(cherry picked from commit 6c478a3dae)
2019-01-21 17:01:11 +11:00
Witold Kręcicki
aa9866c390 If possible don't use forwarders when priming the resolver.
If we try to fetch a record from cache and need to look into
hints database we assume that the resolver is not primed and
start dns_resolver_prime(). Priming query is supposed to return
NSes for "." in ANSWER section and glue records for them in
ADDITIONAL section, so that we can fill that info in 'regular'
cache and not use hints db anymore.
However, if we're using a forwarder the priming query goes through
it, and if it's configured to return minimal answers we won't get
the addresses of root servers in ADDITIONAL section. Since the
only records for root servers we have are in hints database we'll
try to prime the resolver with every single query.

This patch adds a DNS_FETCHOPT_NOFORWARD flag which avoids using
forwarders if possible (that is if we have forward-first policy).
Using this flag on priming fetch fixes the problem as we get the
proper glue. With forward-only policy the problem is non-existent,
as we'll never ask for root server addresses because we'll never
have a need to query them.

Also added a test to confirm priming queries are not forwarded.

(cherry picked from commit b49310ac06)
(cherry picked from commit f8963ad70e)
2019-01-16 22:27:52 -08:00
Petr Menšík
3442c69911 Make sure null atributes are never used
Add INSIST to pubattr fetching where null might occur in therory. Make
sure null is never dereferenced.

(cherry picked from commit fe9ef0d9f5)
2019-01-17 09:00:42 +11:00
Mark Andrews
bf6133ea61 adjust timeout to allow for ECN negotiation failures
(cherry picked from commit dadb924be7)
2019-01-15 17:30:20 -08:00
Ondřej Surý
5c73b97715 Fix race condition in cleanup part of dns_dt_create()
(cherry picked from commit 482dd7eed3)
2019-01-15 09:51:25 +01:00
Mark Andrews
8bb42d7812 update refreshkeytime
(cherry picked from commit ca977e3976)
2019-01-09 19:48:58 +11:00
Mark Andrews
3266d3c4da maybe_numeric failed to handle NUL in text region.
(cherry picked from commit ee23780246)
2019-01-09 19:08:22 +11:00
Mark Andrews
58cc1ee718 Ensure base64/base32/hex fields in DNS records that should be non-empty are.
(cherry picked from commit 5e8b772ad1)
2019-01-09 18:52:50 +11:00
Mark Andrews
6750780e88 allow for up 100 records or 64K of data to be in a ncache entry
(cherry picked from commit 604889e627)
2019-01-09 16:17:07 +11:00
Mark Andrews
e4f7d6c418 explictly convert ISC_R_NOSPACE from dns_message_parse to DNS_R_FORMERR and remove from dns_result_torcode
(cherry picked from commit 0c42a9c0ab)
2019-01-08 20:51:27 -08:00
Michał Kępień
3db9f56718 Track forwarder timeouts in fetch contexts
Since following a delegation resets most fetch context state, address
marks (FCTX_ADDRINFO_MARK) set inside lib/dns/resolver.c are not
preserved when a delegation is followed.  This is fine for full
recursive resolution but when named is configured with "forward first;"
and one of the specified forwarders times out, triggering a fallback to
full recursive resolution, that forwarder should no longer be consulted
at each delegation point subsequently reached within a given fetch
context.

Add a new badnstype_t enum value, badns_forwarder, and use it to mark a
forwarder as bad when it times out in a "forward first;" configuration.
Since the bad server list is not cleaned when a fetch context follows a
delegation, this prevents a forwarder from being queried again after
falling back to full recursive resolution.  Yet, as each fetch context
maintains its own list of bad servers, this change does not cause a
forwarder timeout to prevent that forwarder from being used by other
fetch contexts.

(cherry picked from commit 33350626f9)
2019-01-08 08:34:37 +01:00
Matthijs Mekking
1360a1fa1a Move REQUIRE outside comment unsupported alg
(cherry picked from commit 5ca649967e)
2018-12-20 04:50:08 -05:00
Matthijs Mekking
040e132f16 Allow unsupported alg in zone /w dnssec-signzone
dnssec-signzone should sign a zonefile that contains a DNSKEY record
with an unsupported algorithm.  Current behavior is that it will
fail, hitting a fatal error.  The fix detects unsupported algorithms
and will not try to add it to the keylist.

Also when determining the maximum iterations for NSEC3, don't take
into account DNSKEY records in the zonefile with an unsupported
algorithm.

(cherry picked from commit 1dd11fc754)
2018-12-20 04:50:08 -05:00
Ondřej Surý
11cce88a41 gcc defines __SANITIZE_ADDRESS__ and not __ADDRESS_SANITIZER__, use the correct #define
(cherry picked from commit 8903d68d69)
2018-12-19 12:46:05 +01:00
Ondřej Surý
8fbd61343a Disable RTLD_DEEPBIND when compiled under AddressSanitizer
(cherry picked from commit cad6b39cab)
2018-12-19 10:51:09 +01:00
Mark Andrews
da49d1cfc3 add unit tests for dns_rdatatype_atcname, dns_rdatatype_atparent and iszonecutauth
(cherry picked from commit f2f7711977)
2018-12-14 14:44:20 +11:00
Mark Andrews
587c81ac99 create dns_rdatatype_atcname to split records that can appear along side CNAME from DNSSEC; dns_rdatatype_iszonecutauth allowed too many types
(cherry picked from commit f4ceb12b69)
2018-12-14 14:29:46 +11:00
Mark Andrews
ed232e96d1 log a error if we don't explicitly know that a error has been logged in zone_sign
(cherry picked from commit b108376a10)
2018-12-10 15:13:53 +11:00
Mark Andrews
f8dc30d18b Properly detect bottom of zone when sign_a_node() is not called
(cherry picked from commit 9eec02a81f)
2018-12-07 12:20:09 +11:00
Mark Andrews
c0a3c48802 add missing DBC checks for catz and add isc_magic checks; add DBC checks to ht.c
(cherry picked from commit a487473fc5)
(cherry picked from commit 17d9fa3cc7)
2018-11-29 15:05:17 +11:00
Mark Andrews
12f2ea418c update zname with the current zone anme
(cherry picked from commit 0708e43d3f)
2018-11-28 23:34:42 +11:00
Mark Andrews
156195dac6 address coverity side effect in assert warning
(cherry picked from commit 2156a5b610)
2018-11-23 10:21:53 +11:00
Ondřej Surý
2386be289c Use strlcpy in place where strncpy(s, ...) + s[sizeof(s)-1] = \0; was used
(cherry picked from commit 175f06949f)
2018-11-22 08:11:31 +11:00
Evan Hunt
58314571ef remove (or hide behind a 'verbose' flag) extra output from system tests
(cherry picked from commit 8f15219f36)
2018-11-16 13:00:49 -08:00
Evan Hunt
2ed9b06ab8 remove ATF source code and Atffiles
(cherry picked from commit 8c4d50c6bc)
(cherry picked from commit 33f428efda)
2018-11-15 17:52:00 -08:00
Joey
49cfe448da convert update_test; remove ATF from lib/dns/tests
(cherry picked from commit 336d5a5374)
(cherry picked from commit 4beba42654)
2018-11-15 17:51:56 -08:00
Evan Hunt
3a8eff4589 convert gost_test
(cherry picked from commit 28296fc57c)
2018-11-15 17:51:47 -08:00
Joey
f919fb6e0e convert tsig_test
(cherry picked from commit 92a3762cb6)
(cherry picked from commit ea300146a8)
2018-11-15 17:51:42 -08:00
Joey
ab76e6a8b7 convert time_test
(cherry picked from commit 2c7e6947fa)
(cherry picked from commit 132bdcb954)
2018-11-15 17:51:35 -08:00
Joey
e938089e20 convert sigs_test
(cherry picked from commit eda6281f98)
(cherry picked from commit 34855ec13b)
2018-11-15 17:51:30 -08:00
Joey
2ba04b17a8 convert rsa_test
(cherry picked from commit b915cdbf0b)
(cherry picked from commit c00f2c9434)
2018-11-15 17:51:24 -08:00
Joey
e0b408a5ee convert resolver_test
(cherry picked from commit 2837a821e8)
(cherry picked from commit bd3bb7cb89)
2018-11-15 17:51:12 -08:00
Joey
0f2b87f0ae convert rbt_serialize_test
(cherry picked from commit dfd90dbb82)
(cherry picked from commit 5e44278871)
2018-11-15 17:51:06 -08:00
Joey
684083a3da convert name_test
(cherry picked from commit 1b48e710d5)
(cherry picked from commit c9c1d244e1)
2018-11-15 17:51:00 -08:00
Joey
4e0f18fc0f convert master_test
(cherry picked from commit 4ba08bb119)
(cherry picked from commit 34291ae2be)
2018-11-15 17:50:54 -08:00
Joey
f16ad8f1d6 convert keytable_test
(cherry picked from commit e38901154d)
(cherry picked from commit ff26c1e014)
2018-11-15 17:50:47 -08:00
Joey
9bc895c9d9 convert private_test
(cherry picked from commit 9a464ef869)
(cherry picked from commit ade81f29d6)
2018-11-15 17:50:38 -08:00
Evan Hunt
b48f406b91 convert dbversion_test
(cherry picked from commit 98d5abb73c)
(cherry picked from commit 3d396d1eb8)
2018-11-15 17:50:31 -08:00
Joey
8c767607fb convert dst_test
(cherry picked from commit ad923f82b1)
(cherry picked from commit b902454460)
2018-11-15 17:50:24 -08:00
Joey
e6118469ad convert db_test
(cherry picked from commit 005e19ad3f)
(cherry picked from commit e8f61dd315)
2018-11-15 17:50:18 -08:00
Evan Hunt
ddeac8f5cd convert dispatch_test
(cherry picked from commit 8d347788b0)
(cherry picked from commit a554ae3dcc)
2018-11-15 17:50:11 -08:00
Evan Hunt
da0145f938 convert zonemgr_test
(cherry picked from commit 01a193ff6c)
(cherry picked from commit 503869db64)
2018-11-15 17:50:04 -08:00
Evan Hunt
bcd2c7fa85 convert zt_test
(cherry picked from commit 0a4f6122de)
(cherry picked from commit ff07929977)
2018-11-15 17:49:53 -08:00
Evan Hunt
01e5303b46 convert rdata_test
- also added code to dnstest.c to optionally suppress printing of errors
  from dns_rdata_fromtxt()

(cherry picked from commit bb5ed5a4ac)
(cherry picked from commit 87d702aaa6)
2018-11-15 17:49:38 -08:00
Evan Hunt
9eed71a449 convert rbt_test
(cherry picked from commit 55465517c7)
(cherry picked from commit 7a57323bbf)
2018-11-15 17:49:31 -08:00
Evan Hunt
1831a14c27 convert dnstap_test
(cherry picked from commit 9f83d31e42)
(cherry picked from commit d51d4febf9)
2018-11-15 17:49:17 -08:00
Evan Hunt
b6707b7ffb convert geoip_test
(cherry picked from commit 06b4ff5fe2)
(cherry picked from commit 80172ae24d)
2018-11-15 17:49:09 -08:00
Evan Hunt
d4f775178c convert nsec3_test
(cherry picked from commit 015fda0bb4)
(cherry picked from commit 5a13cf0543)
2018-11-15 17:49:02 -08:00