Commit Graph

6392 Commits

Author SHA1 Message Date
Mark Andrews
66c6414b97 Declare the 'rdata' argument for dns_rdata_tostruct() to be const
(cherry picked from commit abb2fd1027)
2018-06-15 08:52:54 +02:00
Mark Andrews
eb69786ff6 add support -T sigvalinsecs
(cherry picked from commit 87a3dc8ab9)
(cherry picked from commit 69340b5ac5)
(cherry picked from commit dd05287a31)
(cherry picked from commit ba76a92338)
2018-06-06 17:51:35 +10:00
Mark Andrews
3408ab391a 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)
(cherry picked from commit 5686e3bb6a)
2018-06-06 17:47:51 +10:00
Mark Andrews
3890b5d7ba add named.conf option root-key-sentinel
(cherry picked from commit 68e9315c7d)
(cherry picked from commit ee763ef281)
(cherry picked from commit 9a5f308287)
(cherry picked from commit 468a3bcdac)
2018-06-04 21:30:33 -07:00
Mukund Sivaraman
d1af2db397 Add NSEC3 fromtext/totext unittests
(cherry picked from commit b0d9198e03)
2018-06-04 13:34:46 +10:00
Mukund Sivaraman
2420b8f5fc Don't insert 2nd space between NSEC3 nexthash and typemap fields
(cherry picked from commit d4ea1edd2c)
2018-06-04 13:34:46 +10:00
Mark Andrews
24dd75db91 fix merge error 2018-05-29 10:02:29 +10:00
Mark Andrews
20d279571f work around cppcheck false positive
(cherry picked from commit cb5802e854)
2018-05-29 09:55:25 +10:00
Evan Hunt
f2dc9a516f copyrights
(cherry picked from commit 58fd94cbce)
2018-05-23 09:58:57 -07:00
Michał Kępień
7f38fd70c1 Extend the list of headers included by lib/dns/tests/sigs_test.c
(cherry picked from commit 1e1ed6627b)
2018-05-14 09:34:56 +02:00
Mark Andrews
77cd6fe0f5 return untested if not built with OPENSSL or PKCS11CRYPTO
(cherry picked from commit 9d8bab64ad)
2018-05-14 09:34:42 +02:00
Michał Kępień
e41d2a195e 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)
(cherry picked from commit 5a957ec9e1)
2018-05-10 09:45:50 -07:00
Michał Kępień
02da03b17f 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)
(cherry picked from commit 7394dd8732)
2018-05-10 09:45:48 -07:00
Michał Kępień
781105c046 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)
(cherry picked from commit b8720b8f50)
2018-05-10 09:42:39 -07:00
Michał Kępień
b767528e13 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)
(cherry picked from commit ae03a5c1fa)
2018-05-10 09:42:13 -07:00
Michał Kępień
645c43d09c 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)
(cherry picked from commit 5f0b4eaf70)
2018-05-10 09:42:13 -07:00
Michał Kępień
0d126920e6 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)
(cherry picked from commit 27f777c61a)
2018-05-10 09:42:13 -07:00
Michał Kępień
f7a84380dd 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)
(cherry picked from commit 7193496b6e)
2018-05-10 09:42:13 -07:00
Michał Kępień
1eec107a94 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)
(cherry picked from commit 94caf8ebdb)
2018-05-10 09:42:13 -07:00
Michał Kępień
c7d9100dcb 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)
(cherry picked from commit d76fdb8718)
2018-05-10 09:42:13 -07:00
Mark Andrews
d1d04fdffd simplify mask construction
(cherry picked from commit 22fab3199f)
2018-05-03 17:17:38 +02:00
Michał Kępień
8b0f7f1b8d 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)
(cherry picked from commit fcbdeed802)
2018-04-25 12:24:36 -07:00
Michał Kępień
0d4750a8e9 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)
(cherry picked from commit c042ec70d2)
2018-04-25 12:19:30 -07:00
Evan Hunt
0795311bce remove unnecessary comparison
(cherry picked from commit 8b1baa10ee)
(cherry picked from commit f9da5a735e)
2018-04-22 13:01:08 -07:00
Evan Hunt
d0410a0783 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 13:01:08 -07:00
Evan Hunt
d5456e7318 add header guards in files that were missing them
(cherry picked from commit 4247477b61)
(cherry picked from commit 7f61e9d50e)
2018-04-22 13:01:07 -07:00
Evan Hunt
54f07c3b1a fix shadowed global variables
(cherry picked from commit 9ca3ab1168)
(cherry picked from commit 694a1486ca)
2018-04-22 12:59:06 -07:00
Ondřej Surý
3c2f6922f5 A couple of more cleanups after free in opensslrsa_generate()
(cherry picked from commit d2b3188c61)
2018-04-06 14:27:23 +10:00
Petr Mensik
fcb5795560 Do not assign NULL conditionally in OpenSSL < 1.1, make it always explicit.
(cherry picked from commit edaafacf36)
2018-04-06 14:27:23 +10:00
Petr Mensik
3bce97740f Fix double free on RSA_generate_key_ex failure
(cherry picked from commit 01cc622e7b)
2018-04-06 14:27:22 +10:00
Mukund Sivaraman
eb98f2759e Check return value of isc_mem_get()
(cherry picked from commit de3a4af1bf)
2018-03-20 09:56:09 +11:00
Evan Hunt
5a21193fdd update file headers 2018-03-15 11:30:37 -07:00
Ondřej Surý
9f830be501 update file headers to remove copyright years 2018-03-15 09:09:15 +01:00
Evan Hunt
a6e5d9a2ca Merge branch 'clean-bin-tests-v9_9' into 'v9_9'
clean up bin/tests, convert unit tests to ATF

Closes #115

See merge request isc-projects/bind9!93
2018-03-09 23:52:26 -08:00
Evan Hunt
e6c446bfba 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)
(cherry picked from commit 6fe8188cc3)
2018-03-09 23:35:02 -08:00
Evan Hunt
2591c077f0 migrate t_dst signature test to lib/dns/tests/dst_test
(cherry picked from commit a4ebe83cdb)
(cherry picked from commit 4439c471d1)
(cherry picked from commit 57a5820dcc)
(cherry picked from commit dbc21e4393)
2018-03-09 23:22:04 -08:00
Evan Hunt
a11252dbbc migrate t_db to lib/dns/tests/db_test
(cherry picked from commit f58ac8ada3)
(cherry picked from commit 56da937399)
(cherry picked from commit d3518e57b1)
(cherry picked from commit c5dbc0b727)
2018-03-09 23:20:11 -08:00
Evan Hunt
28d62b0a31 migrate t_names to lib/dns/tests/name_test
(cherry picked from commit 8ecf69ef7b)
(cherry picked from commit aefad99e1e)
(cherry picked from commit b2fef3b438)
(cherry picked from commit 2893e982ed)
2018-03-09 23:19:11 -08:00
Evan Hunt
20da3cd7e7 migrate t_rbt to lib/dns/tests/rbt_test
(cherry picked from commit 109546cbda)
(cherry picked from commit c505afd183)
(cherry picked from commit 42fa3932ab)
(cherry picked from commit 4c6818ff8e)
2018-03-09 23:17:36 -08:00
Evan Hunt
48c8aca49b migrate t_resolver to lib/dns/tests/resolver_test
(cherry picked from commit d80825c40b)
(cherry picked from commit 30e157f6e4)
(cherry picked from commit 5dd25f2285)
(cherry picked from commit 29474940ea)
2018-03-09 23:13:44 -08:00
Evan Hunt
93db8ad693 Merge branch 'v9_9_12_patch' into v9_9 2018-03-08 14:30:46 -08:00
Tinderbox User
7af73b918e prep 9.9.12rc2 2018-03-02 21:53:47 +00:00
Evan Hunt
ce1114a95a temporarily revert change #4859
(cherry picked from commit 06b52cc939)
2018-03-02 12:18:03 -08:00
Evan Hunt
7e2d361355 temporarily revert change #4859
(cherry picked from commit 84ec07999f)
2018-03-02 12:04:33 -08:00
Mark Andrews
750467e284 update the sscanf format strings so they match the pointer types
(cherry picked from commit 70d192eb97)
(cherry picked from commit 06b7a4397a)
2018-02-26 10:54:19 +11:00
Mark Andrews
d65c60d894 redefine CHECK so cppcheck see the definition
(cherry picked from commit a4186b1867)
(cherry picked from commit d17558a874)
2018-02-26 10:54:18 +11:00
Mark Andrews
7c3734f920 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)
(cherry picked from commit 981d548a66)
2018-02-26 10:54:18 +11:00
Evan Hunt
7677cb277a final cleanup
- add CHANGES note
- update copyrights and license headers
2018-02-25 13:13:26 -08:00
Petr Menšík
3727e6a944 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)
(cherry picked from commit 6d9b38e9fe)
(cherry picked from commit 6f2fd5ccca)
2018-02-23 15:51:50 -08:00
Petr Menšík
07b6ddd178 Reuse new function from rt46864 for similar block elsewhere.
(cherry picked from commit e7a93321f0)
(cherry picked from commit cb98ce8e67)
(cherry picked from commit 6876501605)
(cherry picked from commit 16ea60d8cc)
2018-02-23 13:57:56 -08:00