Commit Graph
36152 Commits
Author SHA1 Message Date
Artem Boldariev 334eeef5a1 Do not provide a shim for SSL_SESSION_is_resumable()
The recently added TLS client session cache used
SSL_SESSION_is_resumable() to avoid polluting the cache with
non-resumable sessions. However, it turned out that we cannot provide
a shim for this function across the whole range of OpenSSL versions
due to the fact that OpenSSL 1.1.0 does uses opaque pointers for
SSL_SESSION objects.

The commit replaces the shim for SSL_SESSION_is_resumable() with a non
public approximation of it on systems shipped with OpenSSL 1.1.0. It
is not turned into a proper shim because it does not fully emulate the
behaviour of SSL_SESSION_is_resumable(), but in our case it is good
enough, as it still helps to protect the cache from pollution.

For systems shipped with OpenSSL 1.0.X and derivatives (e.g. older
versions of LibreSSL), the provided replacement perfectly mimics the
function it is intended to replace.

(cherry picked from commit 40be3c9263)
2022-06-15 17:02:45 +03:00
Artem Boldariev 7bd5f4972f Dig: Do not call isc_nm_cancelread() for HTTP sockets
This commit ensures that isc_nm_cancelread() is not called from within
dig code for HTTP sockets, as these lack its implementation.

It does not have much sense to have it due to transactional nature of
HTTP.

Every HTTP request-response pair is represented by a virtual socket,
where read callback is called only when full DNS message is received
or when an error code is being passed there. That is, there is nothing
to cancel at the time of the call.

(cherry picked from commit 90c52ca12b)
2022-06-15 17:02:45 +03:00
Artem Boldariev 0cec9cca37 Fix an abort in DoH (client-side) when writing on closing sock
The commit fixes a corner case in client-side DoH code, when a write
attempt is done on a closing socket (session).

The change ensures that the write call-back will be called with a
proper error code (see failed_send_cb() call in client_httpsend()).

(cherry picked from commit 9abb00bb5f)
2022-06-15 17:02:45 +03:00
Artem Boldariev cb6591f277 Avoid aborting when uv_timer_start() is used on a closing socket
In such a case it will return UV_EINVAL (-EINVAL), leading to
aborting, as the code expects the function to succeed.

(cherry picked from commit 245f7cec2e)
2022-06-15 17:02:45 +03:00
Artem Boldariev 3393ec19c2 Modify CHANGES
Mention that TLS session resumption is now fully supported in the
client side code.

(cherry picked from commit aa8c258fba)
2022-06-15 17:02:45 +03:00
Artem Boldariev 5154bac7c5 Add SSL_SESSION_is_resumable() implementation shim
This commit adds SSL_SESSION_is_resumable() implementation if it is
missing.

(cherry picked from commit 35338b4105)
2022-06-15 17:02:45 +03:00
Artem Boldariev e02284354a DoT: implement TLS client session resumption
This commit extends DoT code with TLS client session resumption
support implemented on top of the TLS client session cache.

(cherry picked from commit 86465c1dac)
2022-06-15 17:02:45 +03:00
Artem Boldariev 0a4a76ff7a TLS stream/DoH: implement TLS client session resumption
This commit extends TLS stream code and DoH code with TLS client
session resumption support implemented on top of the TLS client
session cache.

(cherry picked from commit 90bc13a5d5)
2022-06-15 17:02:45 +03:00
Artem Boldariev 6ec48f1e78 Extend TLS context cache with TLS client session cache
This commit extends TLS context cache with TLS client session cache so
that an associated session cache can be stored alongside the TLS
context within the context cache.

(cherry picked from commit 987892d113)
2022-06-15 17:02:45 +03:00
Artem Boldariev 7c8d76c458 Add TLS client session cache implementation
This commit adds an implementation of a client TLS session cache. TLS
client session cache is an object which allows efficient storing and
retrieval of previously saved TLS sessions so that they can be
resumed. This object is supposed to be a foundation for implementing
TLS session resumption - a standard technique to reduce the cost of
re-establishing a connection to the remote server endpoint.

OpenSSL does server-side TLS session caching transparently by
default. However, on the client-side, a TLS session to resume must be
manually specified when establishing the TLS connection. The TLS
client session cache is precisely the foundation for that.

(cherry picked from commit 4ef40988f3)
2022-06-15 17:02:45 +03:00
Michał Kępień 64fcf1e464 Merge tag 'v9_18_4' into v9_18
BIND 9.18.4
2022-06-15 15:58:14 +02:00
Artem Boldariev 8cea314705 Merge branch 'artem-tlsdns-do-not-call-acceptcb-twice-v9_18' into 'v9_18'
[Backport to 9.18] TLS DNS: do not call accept callback twice

See merge request isc-projects/bind9!6440
2022-06-15 13:40:30 +00:00
Artem Boldariev 9b320b1682 TLS DNS: do not call accept callback twice
Before the changes from this commit were introduced, the accept
callback function will get called twice when accepting connection
during two of these stages:

* when accepting the TCP connection;
* when handshake has completed.

That is clearly an error, as it should have been called only once. As
far as I understand it the mistake is a result of TLS DNS transport
being essentially a fork of TCP transport, where calling the accept
callback immediately after accepting TCP connection makes sense.

This commit fixes this mistake. It did not have any very serious
consequences because in BIND the accept callback only checks an ACL
and updates stats.

(cherry picked from commit e616d7f240)
2022-06-15 15:32:49 +03:00
Petr Špaček b0ac324a02 Merge branch 'pspacek/doc-cleanup-dnssec-prereq-v9_18' into 'v9_18'
Update intro texts in the DNSSEC Guide [v9_18]

See merge request isc-projects/bind9!6434
2022-06-14 16:24:18 +00:00
Petr Špaček d1d5531c6a Update FAQ in the DNSSEC Guide
Mention DoT/DoH, update stats, remove mentions of early stages of
deployment.

(cherry picked from commit fd3a2c7854)
2022-06-14 18:20:50 +02:00
Petr Špaček a04d6200e0 Update Authoritative Server Hardware requirements in DNSSEC Guide
Based on measurements done on BIND v9_19_2 using bank. TLD and a
synthetitc fullly signed zone, using RSASHA256 and ECDSAP256SHA256
algorithms with NSEC and NSEC3 without opt-out.

(cherry picked from commit 635885afe6)
2022-06-14 18:20:50 +02:00
Petr Špaček 08a5f5cea2 Update DNSSEC validation deployment stats in DNSSEC Guide
(cherry picked from commit 832c172985)
2022-06-14 18:20:50 +02:00
Petr Špaček 8961105b98 Rewrite Recursive Server Hardware requirements in DNSSEC Guide
This section was completely out of date. Current measurements on dataset
Telco EU 2022-02 and BIND 9.19.1 indicate absolutely different results
than described in the old version of the text.

(cherry picked from commit 6cf8066b9c)
2022-06-14 18:20:50 +02:00
Petr Špaček a85d0286a9 Remove outdated software requirements from DNSSEC Guide
Guide in this repo is tied to latest version anyway, so let's not even
mention ancient versions of BIND.

This also solves the OpenSSL question because it is now mandatory for
build, which subsequently removes the entropy problem - so let's not
mention it either.

(cherry picked from commit 6e79877759)
2022-06-14 18:20:50 +02:00
Arаm Sаrgsyаn 2d85fda569 Merge branch '3401-race-condition-in-route_connected-v9_18' into 'v9_18'
[v9_18] Resolve "race condition in route_connected() leads to crash on startup/shutdown"

See merge request isc-projects/bind9!6433
2022-06-14 15:55:46 +00:00
Aram Sargsyan 7d5ec4b6a5 Add CHANGES note for [GL #3401]
(cherry picked from commit 4b0e7e41fc)
2022-06-14 14:57:32 +00:00
Aram Sargsyan 12aefe6ced Fix a race condition between shutdown and route_connected()
When shutting down, the interface manager can be destroyed
before the `route_connected()` callback is called, which is
unexpected for the latter and can cause a crash.

Move the interface manager attachment code from the callback
to the place before the callback is registered using
`isc_nm_routeconnect()` function, which will make sure that
the interface manager will live at least until the callback
is called.

Make sure to detach the interface manager if the
`isc_nm_routeconnect()` function is not implemented, or when
the callback is called with a result value which differs from
`ISC_R_SUCCESS`.

(cherry picked from commit f6e729635f)
2022-06-14 14:57:23 +00:00
Aram Sargsyan e92b261235 Do not use the interface manager until it is ready
The `ns_interfacemgr_create()` function, when calling
`isc_nm_routeconnect()`, uses the newly created `ns_interfacemgr_t`
instance before initializing its reference count and the magic value.

Defer the `isc_nm_routeconnect()` call until the initializations
are complete.

(cherry picked from commit 1d93fe973b)
2022-06-14 14:55:57 +00:00
Arаm Sаrgsyаn e781c394d8 Merge branch '3207-dig-nssearch-crash-fix-v9_18' into 'v9_18'
[v9_18]  Resolve "dig +nssearch org crashes when network is unreachable"

See merge request isc-projects/bind9!6432
2022-06-14 14:51:16 +00:00
Aram Sargsyan cb25d5b80d Add CHANGES note for [GL #3207]
(cherry picked from commit 0450c9bd32)
2022-06-14 13:22:39 +00:00
Aram Sargsyan 7917e1866a Fix a crash in dig NS search mode
In special NS search mode, after the initial lookup, dig starts the
followup lookup with discovered NS servers in the queries list. If one
of those queries then fail, dig, as usual, tries to start the next query
in the list, which results in a crash, because the NS search mode is
special in a way that the queries are running in parallel, so the next
query is usually already started.

Apply some special logic in `recv_done()` function to deal with the
described situation when handling the query result for the NS search
mode. Particularly, print a warning message for the failed query,
and do not try to start the next query in the list. Also, set a non-zero
exit code if all the queries in the followup lookup fail.

(cherry picked from commit 1290863c22)
2022-06-14 13:21:47 +00:00
Michal Nowak 74ca068877 Merge branch '3138-capture-scripts-to-coverity-scan-v9_18' into 'v9_18'
[v9_18] Capture scripts for Coverity Scan analysis

See merge request isc-projects/bind9!6430
2022-06-14 12:24:17 +00:00
Michal Nowak e1a463e98d Capture scripts for Coverity Scan analysis
With the recent Coverity Scan 2021.12 version, Python 3 scripts are
being analyzed in addition to C files. The --fs-capture-search option
scripts for Coverity Scan analysis should be added to leverage this
feature.

(cherry picked from commit b4a2674d98)
2022-06-14 14:19:26 +02:00
Michal Nowak bed115211e Download Coverity Scan analysis tool to /tmp
Downloading and unpacking Coverity Scan analysis tool tarball
(cov-analysis-linux64.tgz) to $CI_PROJECT_DIR interferes with the
execution of the analysis tool when the --fs-capture-search option is
used because the tool starts to analyze some of its Javascript files.
(There's the --fs-capture-search-exclude-regex <path> option, but I
failed to find a way to make it work.)

(cherry picked from commit 1333bdf67e)
2022-06-14 14:19:21 +02:00
Michal Nowak 36780e07f6 Drop coverity cache feature
The coverity CI job cache feature is used to ensure that the 1 GB
cov-analysis-linux64.tgz file is being cached on GitLab CI runner, where
it was downloaded in the past. This feature does not seem to work
anymore; given that the proper solution to creating distributed cache is
complicated, better to drop the feature altogether.

(cherry picked from commit c966304e90)
2022-06-14 14:19:17 +02:00
Petr Špaček 5cc296bfb2 Merge branch 'pspacek/dnssec-guide-keymgr-removal-v9_18' into 'v9_18'
Remove description of dnssec-keymgr from DNSSEC Guide [v9_18]

See merge request isc-projects/bind9!6428
2022-06-14 11:32:57 +00:00
Petr Špaček 782f3b6845 Remove description of dnssec-keygmr from DNSSEC Guide
dnssec-keymgr is not included in the distribution since BIND 9.17 so
there is no point in keeping usage instructions around.

(cherry picked from commit 0e1306374e)
2022-06-14 13:12:59 +02:00
Ondřej Surý f5405826f1 Merge branch '3400-gracefully-handle-the-errors-from-uv_start_read-v9_18' into 'v9_18'
Gracefully handle uv_read_start() failures [v9.18]

See merge request isc-projects/bind9!6426
2022-06-14 10:41:27 +00:00
Ondřej Surý e644acbfae Add CHANGES and release note for [GL #3400]
(cherry picked from commit 646df5cbbc)
2022-06-14 11:54:11 +02:00
Ondřej Surý 579270509f Gracefully handle uv_read_start() failures
Under specific rare timing circumstances the uv_read_start() could
fail with UV_EINVAL when the connection is reset between the connect (or
accept) and the uv_read_start() call on the nmworker loop.  Handle such
situation gracefully by propagating the errors from uv_read_start() into
upper layers, so the socket can be internally closed().

(cherry picked from commit b432d5d3bc)
2022-06-14 11:54:11 +02:00
Michal Nowak d3658fcb6f Merge branch 'mnowak/fix-statistics-system-test-on-ol7-v9_18' into 'v9_18'
[v9_18] Fix statistics system test on Oracle Linux 7

See merge request isc-projects/bind9!6425
2022-06-14 08:10:15 +00:00
Michal Nowak 152343e221 Fix statistics system test on Oracle Linux 7
The statistics system test fails on Oracle Linux 7 when libxml2, Curl,
and xsltproc are present:

    I:statistics:checking bind9.xsl vs xml (17)
    diff: curl.out.17.xsl: No such file or directory
    tests.sh: line 183: curl.out.17.xml: No such file or directory
    cp: cannot stat 'curl.out.17.xml': No such file or directory
    grep: xsltproc.out.17: No such file or directory

This is because the Oracle Linux 7 Curl does not know about the
--http1.1 option and silently fails with:

    + /usr/bin/curl --http1.1 http://10.53.0.3:7252
    curl: option --http1.1: is unknown
    curl: try 'curl --help' or 'curl --manual' for more information

The following test "checking bind9.xml socket statistics" then needs to
check for existence of stats.xml.out file which is artifact of the
previous test.

(cherry picked from commit 49cb896929)
2022-06-14 09:42:02 +02:00
Petr Špaček 6234936395 Merge branch '3395-dnssec-signzone-default-0-iterations-v9_18' into 'v9_18'
Set default number of additional NSEC3 iterations to 0 in dnssec-signzone [v9_18]

See merge request isc-projects/bind9!6423
2022-06-14 07:33:52 +00:00
Petr Špaček 47c214644b Set default number of additional NSEC3 iterations to 0 in dnssec-signzone
We forgot to update dnssec-signzone while updating KASP defaults.

Closes: #3395
Related: #2956
(cherry picked from commit d029d6374d)
2022-06-14 09:08:07 +02:00
Mark Andrews 0590dd43c7 Merge branch 'typo-in-log-on-update-forward-opcode-mismatch-v9_18' into 'v9_18'
corrected the opcode param to opcode_totext

See merge request isc-projects/bind9!6421
2022-06-14 02:57:34 +00:00
Mark Andrews 2a4bdcd8a3 Add CHANGES note for [GL !6420]
(cherry picked from commit bd508194be)
2022-06-14 12:07:21 +10:00
JINMEI TatuyaandMark Andrews 5068ee73d6 make the fix more complete
(cherry picked from commit a58647df6a)
2022-06-14 12:06:54 +10:00
JINMEI TatuyaandMark Andrews 430a52883d corrected the opcode param to opcode_totext
(cherry picked from commit 2b81a69659)
2022-06-14 12:06:54 +10:00
Petr Špaček f64cbe3086 Merge branch 'pspacek/keyfromlabel-doc-alg-clarif-v9_18' into 'v9_18'
Clarify dnssec-keyfromlabel -a in man page [v9_18]

See merge request isc-projects/bind9!6414
2022-06-10 05:59:05 +00:00
Petr Špaček 4630d50f83 Clarify dnssec-keyfromlabel -a in man page
(cherry picked from commit 5f53003dae)
2022-06-10 07:55:12 +02:00
Petr Špaček 87ec530daa Merge branch 'pspacek/arm-statement-syntax-v9_18' into 'v9_18'
Add Sphinx extension to help with ARM maintenance and cross-linking [v9_18]

See merge request isc-projects/bind9!6411
2022-06-09 12:59:40 +00:00
Petr Špaček e949ac7bbc Add tag filter to .. statementlist:: RST directive
Introduce a new syntax:
.. namedconf:statementlist::
   :filter_tags: acl, resolver

The resulting table contains only items tagged as acl OR resolver.

(cherry picked from commit 33931c97fa)
2022-06-09 14:56:21 +02:00
Petr Špaček ed4634c5a4 Warn about duplicate .. statement:: definitions
(cherry picked from commit ff577462f9)
2022-06-09 14:56:21 +02:00
Petr Špaček 0078fa1058 Refactor and unite internal data structures for iscconf Sphinx extension
It turns out it is easier to regenerate Sphinx-mandated structure in
get_objects than to maintain two separate data structures. I should have
realized that before.

(cherry picked from commit 2f2aa1d21c)
2022-06-09 14:56:21 +02:00
Petr Špaček 851b513e45 Render optional statement metadata in the ARM
Optional values :short: and :tags: are now rendered right after the
statement heading.

(cherry picked from commit 475f7a9603)
2022-06-09 14:56:21 +02:00