Commit Graph

10511 Commits

Author SHA1 Message Date
Witold Kręcicki
3f47c82eab Use completely static-sized buffers
(cherry picked from commit 49f90025a0)
(cherry picked from commit 4007a9d020)
2018-06-26 20:28:24 +02:00
Witold Kręcicki
1745706199 Fix socket cmsg buffer usage
(cherry picked from commit d79be7dd5e)
(cherry picked from commit da63e95612)
2018-06-26 20:28:24 +02:00
Mark Andrews
a4e86236b1 construct a symtab of valid in-view targets then check that the target exists
(cherry picked from commit e01a4bcb20)
2018-06-26 11:01:43 -07:00
Mark Andrews
7ff2c2e25c fix casecompare return type for ninfo, tkey, txt
(cherry picked from commit 3ba1d1e43b)
2018-06-25 13:10:22 +10:00
Evan Hunt
ce4abb600b prepare 9.10.8rc1 2018-06-21 18:56:22 +02:00
Mark Andrews
dc2200c1da Declare the 'rdata' argument for dns_rdata_tostruct() to be const
(cherry picked from commit abb2fd1027)
2018-06-15 08:52:47 +02:00
Evan Hunt
b9bc020d5f ensure we try to validate glue records so RRSIG TTLs will be capped 2018-06-08 11:42:40 -07:00
Mark Andrews
51c78898fb add cfg_parse_buffer4
(cherry picked from commit b313084af2)
2018-06-08 17:41:58 +10:00
Mark Andrews
99ac87cac4 Add support for marking a option as deprecated.
(cherry picked from commit befff9452c)
2018-06-08 16:06:17 +10:00
Mark Andrews
ba76a92338 add support -T sigvalinsecs
(cherry picked from commit 87a3dc8ab9)
(cherry picked from commit 69340b5ac5)
(cherry picked from commit dd05287a31)
2018-06-06 17:29:24 +10:00
Mark Andrews
5686e3bb6a only sign with other keys when deleting a key if there are not already existing signature for the deleted algorithm
(cherry picked from commit 0667bf7ae7)
(cherry picked from commit c1e342cedb)
(cherry picked from commit 298372d8d2)
2018-06-06 17:23:08 +10:00
Mark Andrews
468a3bcdac add named.conf option root-key-sentinel
(cherry picked from commit 68e9315c7d)
(cherry picked from commit ee763ef281)
(cherry picked from commit 9a5f308287)
2018-06-04 20:05:09 -07:00
Mukund Sivaraman
3923685bfe Add NSEC3 fromtext/totext unittests
(cherry picked from commit b0d9198e03)
2018-06-04 13:21:57 +10:00
Mukund Sivaraman
f72911dd12 Don't insert 2nd space between NSEC3 nexthash and typemap fields
(cherry picked from commit d4ea1edd2c)
2018-06-04 13:21:57 +10:00
Mark Andrews
6120aba080 work around cppcheck false positive
(cherry picked from commit cb5802e854)
2018-05-29 09:52:37 +10:00
Evan Hunt
58fd94cbce copyrights 2018-05-23 09:58:39 -07:00
Mark Andrews
4a73559364 ISC_SOCKEVENTATTR_TRUNC was not be set
(cherry picked from commit 6bff1768cf)
2018-05-18 16:02:04 +10:00
Mark Andrews
a0cfa7da7c look for '\0'
(cherry picked from commit d03a81c265)
2018-05-18 12:46:52 +10:00
Mark Andrews
13494a5a20 add some %f format tests
(cherry picked from commit f5233ba5de)
2018-05-18 12:46:52 +10:00
Michał Kępień
1e1ed6627b Extend the list of headers included by lib/dns/tests/sigs_test.c
(cherry picked from commit f98e145c5b)
2018-05-14 09:32:44 +02:00
Mark Andrews
9d8bab64ad return untested if not built with OPENSSL or PKCS11CRYPTO
(cherry picked from commit 2420320b96)
2018-05-14 09:32:35 +02:00
Michał Kępień
5a957ec9e1 Define basic test cases for dns__zone_updatesigs()
Add some basic test cases ensuring dns__zone_updatesigs() behaves as
expected.

(cherry picked from commit 8b9d2c27b4)
(cherry picked from commit 3e93e4bb62)
(cherry picked from commit 505267f320)
2018-05-10 09:36:01 -07:00
Michał Kępień
7394dd8732 Add a framework for dns__zone_updatesigs() unit tests
Add a new ATF test, sigs_test, containing everything required to start
defining test cases for dns__zone_updatesigs().  The framework is
written in a way which ensures that changes to zone database applied by
any dns__zone_updatesigs() invocation are preserved between subsequent
checks.

(cherry picked from commit 1f10186476)
(cherry picked from commit 3dde7c42db)
(cherry picked from commit e787e54ea1)
2018-05-10 09:35:59 -07:00
Michał Kępień
b8720b8f50 Move find_zone_keys() to lib/dns/zone_p.h
Rename find_zone_keys() to dns__zone_findkeys() and move it to
lib/dns/zone_p.h, so that it can be used in unit tests.  Add a comment
describing the purpose of this function.

(cherry picked from commit d7143986b1)
(cherry picked from commit fc0e99c7d7)
(cherry picked from commit a6be59ce08)
2018-05-10 09:32:21 -07:00
Michał Kępień
ae03a5c1fa Move update_sigs() to lib/dns/zone_p.h
Rename update_sigs() to dns__zone_updatesigs() and move it to
lib/dns/zone_p.h, so that it can be unit tested.  Add a comment
describing the purpose of this function.

(cherry picked from commit b1947cee82)
(cherry picked from commit 4d06f50ba8)
(cherry picked from commit 5c71a025c6)
2018-05-10 09:28:53 -07:00
Michał Kępień
5f0b4eaf70 Move zonediff_t to lib/dns/zone_p.h
Rename zonediff_t to dns__zonediff_t and move it to lib/dns/zone_p.h, so
that unit tests can be written for functions taking pointers to
structures of this type as arguments.

(cherry picked from commit ace465a9f9)
(cherry picked from commit ea15c54d8a)
(cherry picked from commit 5712d9528f)
2018-05-10 09:28:52 -07:00
Michał Kępień
27f777c61a Add lib/dns/zone_p.h
Add a new private header file, lib/dns/zone_p.h, which will hold type
definitions and function prototypes not meant to be exported by libdns,
but required by zone-related unit tests.

(cherry picked from commit c1bc3be806)
(cherry picked from commit 2b0add6d1a)
(cherry picked from commit 536d6dc0c5)
2018-05-10 09:25:08 -07:00
Michał Kępień
7193496b6e Add a helper function to facilitate preparing dns_diff_t structures
Implement dns_test_difffromchanges(), a function which enables preparing
a dns_diff_t structure from a mostly-textual representation of zone
database changes to be applied.  This will improve readability of test
case definitions by allowing contents of a dns_diff_t structure, passed
e.g. to update_sigs(), to be represented in a human-friendly manner.

(cherry picked from commit 3c22af0d35)
(cherry picked from commit d4c603eb8a)
(cherry picked from commit 1f454b8d91)
2018-05-10 09:24:15 -07:00
Michał Kępień
94caf8ebdb Rename dns_test_rdata_fromstring() to dns_test_rdatafromstring()
Remove the underscore from "rdata_fromstring" so that all helper
functions for libdns tests use a common naming covention.

(cherry picked from commit 2980cbd55f)
(cherry picked from commit 107102d333)
(cherry picked from commit 5097723d1b)
2018-05-10 09:24:12 -07:00
Michał Kępień
d76fdb8718 Rework dns_test_makezone()
The dns_test_makezone() helper function always assigns the created zone
to some view, which is not always necessary and complicates cleanup of
non-managed zones as they are required not to be assigned to any view.

Rework dns_test_makezone() in order to make it easier to use in unit
tests operating on non-managed zones.  Use dns_name_fromstring() instead
of dns_name_fromtext() to simplify code.  Do not use the CHECK() macro
and add comments to make code flow simpler to follow.  Use
dns_test_makeview() instead of dns_view_create().

Adjust existing unit tests using this function so that they still pass.

(cherry picked from commit bfbeef3609)
(cherry picked from commit f70c02d2c2)
(cherry picked from commit d45ee39bae)
2018-05-10 09:20:31 -07:00
Mark Andrews
44ff35c6cb simplify mask construction
(cherry picked from commit 22fab3199f)
2018-05-03 17:16:10 +02:00
Michał Kępień
fcbdeed802 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)
(cherry picked from commit 8a58a60772)
2018-04-25 12:10:26 -07:00
Michał Kępień
c042ec70d2 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)
(cherry picked from commit cdc7ab42b1)
2018-04-25 12:10:26 -07:00
Evan Hunt
636f8d53d8 remove unnecessary comparison
(cherry picked from commit 8b1baa10ee)
(cherry picked from commit f9da5a735e)
2018-04-22 12:58:36 -07:00
Evan Hunt
61121be596 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)
(cherry picked from commit 0dcff8f93c)
2018-04-22 12:58:36 -07:00
Evan Hunt
bda3ea150f add header guards in files that were missing them
(cherry picked from commit 4247477b61)
(cherry picked from commit 7f61e9d50e)
2018-04-22 12:58:36 -07:00
Evan Hunt
2f5ec44952 fix shadowed global variables
(cherry picked from commit 9ca3ab1168)
(cherry picked from commit 694a1486ca)
2018-04-22 12:58:36 -07:00
Evan Hunt
03e2d9d6de fix duplicate include guard in dnsconf.h
- IMHO we should consider removing dnsconf.c and deprecating the
  /etc/dns.conf file, though, as I don't think it's likely anyone
  is using it

(cherry picked from commit a08ba418ef)
(cherry picked from commit b9db91aa64)
2018-04-22 12:58:35 -07:00
Ondřej Surý
d416af9b15 A couple of more cleanups after free in opensslrsa_generate()
(cherry picked from commit d2b3188c61)
2018-04-06 14:26:04 +10:00
Petr Mensik
5a13cc651c Do not assign NULL conditionally in OpenSSL < 1.1, make it always explicit.
(cherry picked from commit edaafacf36)
2018-04-06 14:26:04 +10:00
Petr Mensik
05bed6173b Fix double free on RSA_generate_key_ex failure
(cherry picked from commit 01cc622e7b)
2018-04-06 14:26:03 +10:00
Mukund Sivaraman
b6e2633ca8 Check return value of isc_mem_get()
(cherry picked from commit de3a4af1bf)
2018-03-20 09:55:50 +11:00
Evan Hunt
89d3cfb4e8 update file headers 2018-03-15 18:49:47 -07:00
Evan Hunt
2b22c3bd4f add an 'untested' case when none of the atomic operations are available
- this fixes a build failure introduced in change 4913 when
  compiling with ATF and --disable-atomic

(cherry picked from commit 1b3eac926e)
2018-03-15 12:09:40 -07:00
Evan Hunt
7044b67b67 update file headers to remove copyright years 2018-03-14 21:12:08 -07:00
Ondřej Surý
1cdcae1183 Fix whitespaces 2018-03-14 12:44:08 +01:00
Evan Hunt
8188d164a3 Fix compiler warnings and test failures when building without threads
(cherry picked from commit 56353aaf42)
2018-03-10 10:37:22 -08:00
Evan Hunt
56fcddbb86 Merge branch 'clean-bin-tests-v9_10' into 'v9_10'
clean up bin/tests, convert unit tests to ATF

Closes #115

See merge request isc-projects/bind9!93
2018-03-09 22:49:58 -08:00
Evan Hunt
6fe8188cc3 final cleanup
- update Kyuafiles to match Atffiles
- copyrights
- CHANGES note

(cherry picked from commit 86e00cbb71)
(cherry picked from commit 80834b5b90)
(cherry picked from commit 442c1530a3)
2018-03-09 19:31:04 -08:00
Evan Hunt
ec55b0136a remove lib/tests as nothing uses it anymore
(cherry picked from commit d132f73497)
(cherry picked from commit d35f62434a)
(cherry picked from commit 941946cf14)
2018-03-09 18:48:59 -08:00