2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00
Commit Graph

37156 Commits

Author SHA1 Message Date
Ondřej Surý
16377100ae Fix stack-use-after-scope in dns_message_checksig test
Previously stack with buffer for test dns message went out of scope
before the message was processed. For fuzz testing its better to avoid
allocation, so let's avoid allocations completely and use simplest
possible static buffer.

Fixes: #3565
2022-09-27 13:06:01 +02:00
Petr Špaček
4108d79c9a Fix dns_message_checksig in out-of-tree setup
Hardcoded path was missing FUZZDIR prefix.

Related: !5923
2022-09-27 11:21:42 +02:00
Petr Špaček
d102c59b96 Detect errors in fuzzer initialization
Incomplete initialization typically causes mysterious failures later on,
so let's err out early.
2022-09-27 11:21:38 +02:00
Michał Kępień
547f15ff11 Merge branch 'mnowak/add-fedora-36' into 'main'
Add Fedora 36

See merge request isc-projects/bind9!6297
2022-09-27 07:39:31 +00:00
Michal Nowak
a313c49a3b Add Fedora 36 2022-09-27 09:37:09 +02:00
Evan Hunt
df51d22726 Merge branch '3553-static-buffer-functions' into 'main'
change ISC__BUFFER macros to inline functions

See merge request isc-projects/bind9!6801
2022-09-27 07:23:06 +00:00
Evan Hunt
1926ddc987 change ISC__BUFFER macros to inline functions
previously, when ISC_BUFFER_USEINLINE was defined, macros were
used to implement isc_buffer primitives (isc_buffer_init(),
isc_buffer_region(), etc). these macros were missing the DbC
assertions for those primitives, which made it possible for
coding errors to go undetected.

adding the assertions to the macros caused compiler warnings on
some platforms. therefore, this commit converts the ISC__BUFFER
macros to static inline functions instead, with assertions included,
and eliminates the non-inline implementation from buffer.c.

the --enable-buffer-useinline configure option has been removed.
2022-09-26 23:49:27 -07:00
Petr Špaček
c42d980d4a Merge branch 'bug/main/doc-arm-rhel9' into 'main'
Compatibility for building ARM on older sphinx

See merge request isc-projects/bind9!6815
2022-09-26 15:15:27 +00:00
Petr Menšík
3db7e241d2 Simplify allowing warnings during ARM build
RHEL8 Sphinx does not support all features used in ARM building. But
with few emitted warnings it can build the documentation fine. Simplify
warnings acceptance by allowing make doc SPHINX_W=''.
2022-09-26 17:09:56 +02:00
Petr Menšík
bc6c6b1184 Compatibility for building ARM on older sphinx
Make documentation building successful even on RHEL9 sphinx 3.4.3. It
does not like case-insensitive matching of terms, so provide lowercase
text description with Uppercase word reference.
2022-09-26 17:09:51 +02:00
Petr Špaček
12bce9e69b Merge branch 'ondrej-add-dns_message_checktsig-fuzzer' into 'main'
Add dns_message_checksig() fuzzer

See merge request isc-projects/bind9!5923
2022-09-26 14:30:16 +00:00
Petr Špaček
983822abcf Add seed to reproduce issue memory leak in dns_message_checktsig
Related: #3547
2022-09-26 16:29:36 +02:00
Mark Andrews
6237273205 Add CHANGES notes for [GL !5923] 2022-09-26 16:29:35 +02:00
Mark Andrews
805e2ba31d Add the ability to dig to specify the signing time 2022-09-26 16:28:23 +02:00
Mark Andrews
4d248ee78e Allow dig to SIG(0) sign a message 2022-09-26 16:28:23 +02:00
Mark Andrews
c127a2aefc Add a SIG(0) request seed 2022-09-26 16:28:23 +02:00
Mark Andrews
3c28608c9f Add TSIG reply seed 2022-09-26 16:28:23 +02:00
Mark Andrews
f3d47bc8e0 Add TSIG request seed 2022-09-26 16:28:23 +02:00
Ondřej Surý
4da0180ba2 Add dns_message_checksig() fuzzer
dns_message_checksig is called in a number of scenarios

	* on requests and responses
	* on multiple opcodes
	* with and without signatures
	* with TSIG signatures
	* with SIG(0) signatures
	* with and without configured TSIG keys
	* with and without KEY records being present
	* signing performed now, in the future and in the past

we use the first two octets of the seed to configure the calling
environment with the remainder of the seed being the rdata of the
TSIG/SIG(0) record.
2022-09-26 16:28:23 +02:00
Ondřej Surý
3e85d8c3d6 Add the ability specify the signing / verification time
When fuzzing it is useful for all signing operations to happen
at a specific time for reproducability.  Add two variables to
the message structure (fuzzing and fuzztime) to specify if a
fixed time should be used and the value of that time.
2022-09-26 16:28:12 +02:00
Ondřej Surý
7ea6796a3e Merge branch 'ondrej-use-uv_random' into 'main'
Switch the CSPRNG function from RAND_bytes() to uv_random()

See merge request isc-projects/bind9!6803
2022-09-26 13:32:41 +00:00
Ondřej Surý
b4e131ac77 Add CHANGES note for [GL !6803] 2022-09-26 15:13:11 +02:00
Ondřej Surý
1baed21688 Switch the CSPRNG function from RAND_bytes() to uv_random()
The RAND_bytes() implementation differs between the OpenSSL versions and
uses the system entropy only for seeding its internal CSPRNG.  The
uv_random() on the other hand uses the system provided CSPRNG.

Switch from RAND_bytes() to uv_random() to use system provided CSPRNG.
2022-09-26 15:13:11 +02:00
Petr Špaček
126c9c7419 Merge branch '3547-dns_message_checksig-leak-fix' into 'main'
Fix memory leak in dns_message_checksig() - SIG(0) sigs

Closes #3547

See merge request isc-projects/bind9!6787
2022-09-26 09:55:40 +00:00
Mark Andrews
d6ad56bd9e Stop passing mctx to dns_rdata_tostruct as it is unnecessary for SIG
dns_rdata_tostruct doesn't need a mctx passed to it for SIG (the signer
is already expanded at this point). About the only time when mctx is
needed is when the structure is to be used after the rdata has been
destroyed.
2022-09-26 10:30:57 +02:00
Petr Špaček
69256b3553 Fix memory leak in dns_message_checksig() - SIG(0) sigs
Impact should be visible only in tests or tools because named never
uses view == NULL, which is a necessary condition to trigger this leak.
2022-09-26 10:30:51 +02:00
Arаm Sаrgsyаn
d1508a13cb Merge branch '1781-nsupdate-dot' into 'main'
Implement DoT support for nsupdate

Closes #1781

See merge request isc-projects/bind9!6752
2022-09-23 16:10:05 +00:00
Aram Sargsyan
34f06fd2b5 Add a release note for [GL #1781] 2022-09-23 13:27:44 +00:00
Aram Sargsyan
7ea4e4a1ce Add a CHANGES note for [GL #1781] 2022-09-23 13:27:44 +00:00
Aram Sargsyan
bd8299d7b5 Document nsupdate options related to DoT
Add documentation for the newly implemented DoT feature of the
nsupdate program.
2022-09-23 13:27:44 +00:00
Aram Sargsyan
f2bb80d6ae Extend the nsupdate system test with DoT-related checks
Add a simple test PKI based on the existing one in the doth test.

Check ephemeral, forward-secrecy, and forward-secrecy-mutual-tls
TLS configurations with different scenarios.
2022-09-23 13:23:49 +00:00
Aram Sargsyan
60f1a73754 Fix a typo in doth system test's CA.cfg
The comments in CA.cfg file serve as a good tutorial for setting up
a simple PKI for a system test. There is a typo in one of the presented
commands, which results in openssl not exiting with an error message
instead of generating a certificate.

Fix the typo.
2022-09-23 13:23:49 +00:00
Aram Sargsyan
13000c28c2 Implement DoT support for nsupdate
Implement DNS-over-TLS support for nsupdate. Use DiG's DoT
implementation as a model for the newly added features.
2022-09-23 13:23:49 +00:00
Mark Andrews
73cc9a3232 Merge branch 'bug/main/sha1-disabled-fedora-rhbz2122841' into 'main'
Engine pkcs11 cannot work with OSSL_PARAM on OpenSSL 3.0

See merge request isc-projects/bind9!6711
2022-09-23 03:50:50 +00:00
Mark Andrews
e27b063f67 Add release note for [GL !6711] 2022-09-23 13:18:29 +10:00
Mark Andrews
54916b4e45 Add a CHANGES note for [GL !6711] 2022-09-23 13:18:28 +10:00
Mark Andrews
979062ee5d Report how named was built 2022-09-23 13:17:55 +10:00
Mark Andrews
9b13dd7b4d Build against OpenSSL 3.0 in OpenSSL 1.1.0 compatibility mode 2022-09-23 13:17:55 +10:00
Michal Nowak
3dec2deebc Let Debian sid image leverage PKCS#11 with OpenSSL 3 2022-09-23 13:17:55 +10:00
Mark Andrews
6d668b8c34 Update reference to point to doc/arm/build.inc.rst 2022-09-23 13:17:55 +10:00
Mark Andrews
f32c52c5ca Document -DOPENSSL_API_COMPAT=10100 in OPTIONS.md 2022-09-23 13:17:55 +10:00
Petr Menšík
6c55ea17c6 Remove engine related parts for OpenSSL 3.0
OpenSSL just cannot work with mixing ENGINE_* api mixed with OSSL_PARAM
builders. But it can be built in legacy mode, where deprecated but still
working API would be used.

It can work under OpenSSL 3.0, but only if using legacy code paths
matching OpenSSL 1.1 calls and functions.

Remove fromlabel processing by OpenSSL 3.0 only functions. They can
return later with a proper provider support for pkcs11.
2022-09-23 13:17:55 +10:00
Petr Menšík
f92950bb64 Do not use OSSL_PARAM when engine API is compiled
OpenSSL has deprecated many things in version 3.0. If pkcs11 engine
should work then no builder from OpenSSL 3.0 API can be used.

Allow switching to OpenSSL 1.1 like calls even on OpenSSL 3.0 when
OPENSSL_API_COMPAT=10100 is defined. It would still compile and allow
working keys loading from the engine passed on command line.
2022-09-23 13:17:53 +10:00
Petr Menšík
71a8f1e7cd Add ENGINE_init and ENGINE_finish calls
According to manual page of ENGINE_init, it should be called explicitly
before any key operations happens. Make it active whole lifetime.
2022-09-23 13:15:16 +10:00
Petr Špaček
5bfec15ad4 Merge branch 'pspacek/fix-out-of-tree-junit' into 'main'
Improve JUnit test status generator for Gitlab CI

See merge request isc-projects/bind9!6166
2022-09-22 14:16:05 +00:00
Petr Špaček
8d095550a8 Unify Python interpreter used by TSAN and JUnit helpers
Reportedly we don't have python2-enabled TSAN builds, so we can remove
one more hardcoded python3 call from .gitlab-ci.yaml.
2022-09-22 15:20:26 +02:00
Petr Špaček
c46ad4aec2 Fix JUnit test status generator for out-of-tree system tests
- Use separate paths for tests results and test script
- For tarball tests include the conversion script in the `make dist`
2022-09-22 15:20:23 +02:00
Ondřej Surý
e5ff78dfbd Merge branch 'ondrej-loopmgr-cleanup-tcp-implementation' into 'main'
Cleanup the asychronous code in the TCP implementation

See merge request isc-projects/bind9!6703
2022-09-22 12:58:32 +00:00
Ondřej Surý
fffd444440 Cleanup the asychronous code in the stream implementations
After the loopmgr work has been merged, we can now cleanup the TCP and
TLS protocols a little bit, because there are stronger guarantees that
the sockets will be kept on the respective loops/threads.  We only need
asynchronous call for listening sockets (start, stop) and reading from
the TCP (because the isc_nm_read() might be called from read callback
again.

This commit does the following changes (they are intertwined together):

1. Cleanup most of the asynchronous events in the TCP code, and add
   comments for the events that needs to be kept asynchronous.

2. Remove isc_nm_resumeread() from the netmgr API, and replace
   isc_nm_resumeread() calls with existing isc_nm_read() calls.

3. Remove isc_nm_pauseread() from the netmgr API, and replace
   isc_nm_pauseread() calls with a new isc_nm_read_stop() call.

4. Disable the isc_nm_cancelread() for the streaming protocols, only the
   datagram-like protocols can use isc_nm_cancelread().

5. Add isc_nmhandle_close() that can be used to shutdown the socket
  earlier than after the last detach.  Formerly, the socket would be
  closed only after all reading and sending would be finished and the
  last reference would be detached.  The new isc_nmhandle_close() can
  be used to close the underlying socket earlier, so all the other
  asynchronous calls would call their respective callbacks immediately.

Co-authored-by: Ondřej Surý <ondrej@isc.org>
Co-authored-by: Artem Boldariev <artem@isc.org>
2022-09-22 14:51:15 +02:00
Michał Kępień
62813df44b Merge branch '1967-prevent-generating-broken-glueless-referrals' into 'main'
Prevent generating broken glueless referrals

Closes #1967

See merge request isc-projects/bind9!4122
2022-09-22 12:23:22 +00:00