Commit Graph

6907 Commits

Author SHA1 Message Date
Ondřej Surý
311fbf3f5b Use standard OPENSSL_NO_ENGINE instead of custom USE_ENGINE define
(cherry picked from commit 8d648e7a8a)
2018-05-03 21:36:46 +02:00
Ondřej Surý
5af60f69fd Use BN_hex2bn instead of custom BN_fromhex function
(cherry picked from commit 8bf192b4d1)
2018-05-03 21:35:21 +02:00
Mark Andrews
9b20819dd6 simplify mask construction
(cherry picked from commit 22fab3199f)
2018-05-03 17:13:42 +02:00
Ondřej Surý
e3a318e8d3 Workaround LibreSSL 2.7.0-2.7.2 quirk in DH_set0_key
(cherry picked from commit 6b9e3b7b06)
2018-05-03 14:26:40 +02:00
Ondřej Surý
1e64b869b5 Add support for LibreSSL 2.7
(cherry picked from commit 29ff62a149)
2018-05-03 14:26:40 +02:00
Michał Kępień
8a58a60772 Apply raw zone deltas to yet unsigned secure zones
When inline signing is enabled for a zone without creating signing keys
for it, changes subsequently applied to the raw zone will not be
reflected in the secure zone due to the dns_update_signaturesinc() call
inside receive_secure_serial() failing.  Given that an inline zone will
be served (without any signatures) even with no associated signing keys
being present, keep applying raw zone deltas to the secure zone until
keys become available in an attempt to follow the principle of least
astonishment.

(cherry picked from commit 6acf326969)
2018-04-25 12:09:04 -07:00
Michał Kępień
cdc7ab42b1 Only log bumped signed serial after a successful secure zone update
If a raw zone is modified, but the dns_update_signaturesinc() call in
receive_secure_serial() fails, the corresponding secure zone's database
will not be modified, even though by that time a message containing the
bumped signed serial will already have been logged.  This creates
confusion, because a different secure zone version will be served than
the one announced in the logs.  Move the relevant dns_zone_log() call so
that it is only performed if the secure zone's database is modified.

(cherry picked from commit cfbc8e264d)
2018-04-25 12:09:03 -07:00
Evan Hunt
493a8b53ed remove unnecessary comparison
(cherry picked from commit 8b1baa10ee)
2018-04-22 12:57:52 -07:00
Evan Hunt
fe27dfa9fd silence warnings about unnecessary comparisons
- these are cases where result has been explicitly set, so
  if (result != ISC_R_SUCCESS) is unnecessary

(cherry picked from commit e00eb55cd2)
2018-04-22 12:57:52 -07:00
Evan Hunt
19be8866d8 add header guards in files that were missing them
(cherry picked from commit 4247477b61)
2018-04-22 12:57:52 -07:00
Evan Hunt
97cbc27ed7 fix shadowed global variables
(cherry picked from commit 9ca3ab1168)
2018-04-22 12:57:52 -07:00
Mark Andrews
ee763ef281 add named.conf option root-key-sentinel
(cherry picked from commit 68e9315c7d)
2018-04-22 12:46:03 -07:00
Mark Andrews
ba238ab374 use %u instead of %d for unsigned int arguments
(cherry picked from commit 49f8e9571c)
2018-04-20 15:13:12 -07:00
Mukund Sivaraman
c932fd2d49 Fix TSIG dump keyfile name buffer size issues
(cherry picked from commit 44b84cb5a6)
2018-04-11 14:37:46 +02:00
Ondřej Surý
e052e7f427 Define PATH_MAX on Windows as _MAX_PATH, so we can use it everywhere
(cherry picked from commit 7467735258)
2018-04-11 14:37:46 +02:00
Michał Kępień
0041aeb751 Use dns_fixedname_initname() where possible
Replace dns_fixedname_init() calls followed by dns_fixedname_name()
calls with calls to dns_fixedname_initname() where it is possible
without affecting current behavior and/or performance.

This patch was mostly prepared using Coccinelle and the following
semantic patch:

    @@
    expression fixedname, name;
    @@
    -	dns_fixedname_init(&fixedname);
    	...
    -	name = dns_fixedname_name(&fixedname);
    +	name = dns_fixedname_initname(&fixedname);

The resulting set of changes was then manually reviewed to exclude false
positives and apply minor tweaks.

It is likely that more occurrences of this pattern can be refactored in
an identical way.  This commit only takes care of the low-hanging fruit.

(cherry picked from commit 4df4a8e731)
2018-04-10 13:09:24 -07:00
Mukund Sivaraman
cee4fef7c5 Add a dns_fixedname_initname() helper function
This also turns the dns_fixedname macros into functions.

(cherry picked from commit 0d2a03c290)
2018-04-10 13:06:43 -07:00
Ondřej Surý
cd6d3fbf07 A couple of more cleanups after free in opensslrsa_generate()
(cherry picked from commit d2b3188c61)
2018-04-06 14:21:11 +10:00
Petr Mensik
d27c7940d9 Do not assign NULL conditionally in OpenSSL < 1.1, make it always explicit.
(cherry picked from commit edaafacf36)
2018-04-06 14:21:11 +10:00
Petr Mensik
587452f830 Fix double free on RSA_generate_key_ex failure
(cherry picked from commit 01cc622e7b)
2018-04-06 14:21:11 +10:00
Mukund Sivaraman
d2dea05356 Check return value of isc_mem_get()
(cherry picked from commit de3a4af1bf)
2018-03-20 09:54:08 +11:00
Evan Hunt
19b5249028 update file headers 2018-03-15 18:40:21 -07:00
Michał Kępień
f2838e68e8 Fix a zone database reference counting bug in dump_done()
A typo in commit d39ab7440e introduced a bug in zone database reference
counting which leads to a crash if dumping one version of a slave zone
is not finished by the time transferring a newer version from a master
completes.  Correct the typo to fix reference counting, thus preventing
crashes.

(cherry picked from commit fbd5658db7)
2018-03-13 10:52:01 -07:00
Evan Hunt
7bc7557df9 Merge branch 'clean-bin-tests-v9_12' into 'v9_12'
clean up bin/tests, convert unit tests to ATF

Closes #115

See merge request isc-projects/bind9!93
2018-03-09 14:40:12 -08:00
Evan Hunt
80834b5b90 final cleanup
- update Kyuafiles to match Atffiles
- copyrights
- CHANGES note

(cherry picked from commit 86e00cbb71)
2018-03-09 14:40:12 -08:00
Evan Hunt
4439c471d1 migrate t_dst signature test to lib/dns/tests/dst_test
(cherry picked from commit a4ebe83cdb)
2018-03-09 14:39:56 -08:00
Evan Hunt
56da937399 migrate t_db to lib/dns/tests/db_test
(cherry picked from commit f58ac8ada3)
2018-03-09 14:39:56 -08:00
Evan Hunt
aefad99e1e migrate t_names to lib/dns/tests/name_test
(cherry picked from commit 8ecf69ef7b)
2018-03-09 14:39:56 -08:00
Evan Hunt
c505afd183 migrate t_rbt to lib/dns/tests/rbt_test
(cherry picked from commit 109546cbda)
2018-03-09 14:39:56 -08:00
Evan Hunt
30e157f6e4 migrate t_resolver to lib/dns/tests/resolver_test
(cherry picked from commit d80825c40b)
2018-03-09 14:39:56 -08:00
Evan Hunt
787c5d1394 allow ATF tests to run in parallel
(cherry picked from commit ef0b4c91bc)
2018-03-09 14:36:06 -08:00
Evan Hunt
c54e379267 Merge branch 'v9_12_1_patch' into v9_12 2018-03-08 14:26:15 -08:00
Tinderbox User
38be7f6d9b prep 9.12.1rc2 2018-03-02 21:53:26 +00:00
Evan Hunt
06b52cc939 temporarily revert change #4859 2018-03-02 12:14:20 -08:00
Evan Hunt
84ec07999f temporarily revert change #4859 2018-03-02 12:01:55 -08:00
Evan Hunt
26b1e37f87 minor cleanup and addressed a sprintf format warning
(cherry picked from commit ab0fe63f07)
2018-02-26 10:39:44 +11:00
Mark Andrews
1470774f9c update the sscanf format strings so they match the pointer types
(cherry picked from commit 70d192eb97)
2018-02-26 10:39:44 +11:00
Mark Andrews
efb8880d1b redefine CHECK so cppcheck see the definition
(cherry picked from commit a4186b1867)
2018-02-26 10:39:44 +11:00
Mark Andrews
65bf254fc8 adjust goto target and conditional compilation so that cleanup_spillattimer and cleanup_alglock labels match the element to be cleanup and so that they are always used
(cherry picked from commit 7b27be54ee)
2018-02-26 10:39:43 +11:00
Petr Menšík
eb5c7e91fa unit/unittest.sh is generated by configure. It will always be
generated into builddir. If out-of-tree build is used, make unit
will always fail. Kyuafiles and testdata still have to be copied
manually into the builddir.

(cherry picked from commit 95cde3608a)
2018-02-23 15:45:19 -08:00
Petr Menšík
cb98ce8e67 Reuse new function from rt46864 for similar block elsewhere.
(cherry picked from commit e7a93321f0)
2018-02-23 13:51:23 -08:00
Ondřej Surý
557a5c3f78 Update license headers to not include years in copyright in all applicable files
(cherry picked from commit 843d389661)
2018-02-23 10:38:02 +01:00
Evan Hunt
cd8d44403b [v9_12] copyrights 2018-02-17 21:26:12 -08:00
Evan Hunt
5254978eec [v9_12] re-prep 9.12.1rc1 to include needed fixes; update README 2018-02-17 19:54:52 -08:00
Michał Kępień
5f12985f0b Make dns_dt_send() call dns_dt_reopen() asynchronously
Instead of checking current dnstap output file size and potentially
synchronously calling dns_dt_reopen() upon every call to dns_dt_send():

  - call dns_dt_reopen() asynchronously by queuing an event to the task
    specified at dnstap environment creation time,

  - ensure no roll event is outstanding before checking dnstap output
    file size and potentially queuing another roll event.

This causes dnstap output files to exceed their configured size limits,
but prevents any two threads from performing the roll simultaneously
(which causes crashes).
2018-02-16 09:37:23 +01:00
Michał Kępień
2c1307f061 Make dns_dt_reopen() request task-exclusive mode on its own
Instead of relying on the caller to set up task-exclusive mode, make
dns_dt_reopen() enforce task-exclusive mode itself, using the task
specified at dnstap environment creation time.
2018-02-16 09:37:23 +01:00
Michał Kępień
e26c5df16f Add dns_dt_create2()
Implement a new variant of dns_dt_create() to enable a dnstap
environment structure to hold the task in the context of which
dns_dt_reopen() will be executed.
2018-02-16 09:37:23 +01:00
Michał Kępień
840c9348bf Do not recheck DNS_ZONEFLG_LOADPENDING in zone_asyncload()
Remove a block of code which dates back to commit 8a2ab2b920, when
dns_zone_asyncload() did not yet check DNS_ZONEFLG_LOADPENDING.
Currently, no race in accessing DNS_ZONEFLG_LOADPENDING is possible any
more, because:

  - dns_zone_asyncload() is still the only function which may queue
    zone_asyncload(),

  - dns_zone_asyncload() accesses DNS_ZONEFLG_LOADPENDING under a lock
    (and potentially queues an event under the same lock),

  - DNS_ZONEFLG_LOADPENDING is not cleared until the load actually
    completes.

Thus, the rechecking code can be safely removed from zone_asyncload().

Note that this also brings zone_asyncload() to a state in which the
completion callback is always invoked.  This is required to prevent
leaking memory in case something goes wrong in zone_asyncload() and a
zone table the zone belongs to is indefinitely left with a positive
reference count.
2018-02-16 08:47:40 +01:00
Michał Kępień
3395f6fac3 Asynchronous zone load events have no way of getting canceled
Code handling cancellation of asynchronous zone load events was likely
copied over from other functions when asynchronous zone loading was
first implemented in commit 8a2ab2b920.  However, unlike those other
functions, asynchronous zone loading events currently have no way of
getting canceled once they get posted, which means the aforementioned
code is effectively dead.  Remove it to prevent confusion.
2018-02-16 08:47:40 +01:00
Michał Kępień
7c64547d95 Only clear DNS_ZONEFLG_LOADPENDING in zone_asyncload() if zone loading is completed immediately
zone_load() is not always synchronous, it may only initiate an
asynchronous load and return DNS_R_CONTINUE, which means zone loading
has not yet been completed.  In such a case, zone_asyncload() must not
clear DNS_ZONEFLG_LOADPENDING immediately and leave that up to
zone_postload().
2018-02-16 08:47:40 +01:00