Commit Graph

12757 Commits

Author SHA1 Message Date
Witold Kręcicki
bc3747f56b nghttp2-based HTTP client with DoH support 2020-08-31 11:12:41 -07:00
Witold Kręcicki
7c01178369 netmgr/tls: call tls_do_bio in resumeread
We might have some leftover data in bio buffer that we received
before pausing, we need to do tls_do_bio to make sure we call
the recv() callback on it.
2020-08-31 11:12:41 -07:00
Evan Hunt
3b8e287994 fixup! netmgr/tls: logging 2020-08-31 11:12:41 -07:00
Witold Kręcicki
dbe5d42ff3 netmgr/tls: logging 2020-08-31 11:12:41 -07:00
Evan Hunt
469b7a5ecb fixup! isc_nm_cancelread returns true if the callback was called 2020-08-31 11:12:41 -07:00
Witold Kręcicki
ca3a5d1e52 isc_nm_cancelread returns true if the callback was called 2020-08-31 11:12:41 -07:00
Evan Hunt
2779c44e27 add "dig +tls"
- add isc_nm_tlsdnsconnect() function
- add "+[no]tls" option to dig to enable TLS mode
- override the default port number in dig from 53 to 853 when using TLS
2020-08-31 11:12:41 -07:00
Evan Hunt
3a09529d78 clean up some style nits 2020-08-31 11:12:41 -07:00
Witold Kręcicki
de0c3c3019 checkpoint/test: tcpdns always using TLS, to verify that dig can do DoT 2020-08-31 11:12:41 -07:00
Witold Kręcicki
f8ef33db6d post-merge-fixes 2020-08-31 11:12:41 -07:00
Witold Kręcicki
f43af328b6 tls connect: checkpoint 2020-08-31 11:12:41 -07:00
Witold Kręcicki
1d32b9799e netmgr tcpdns: add support for DoT
Add an optional SSL_CTX argument to isc_nm_listentcpdns - if not NULL,
use isc_nm_listentls instead of isc_nm_listentcp to listen on a TLS
socket for DoT.
2020-08-31 10:58:37 -07:00
Witold Kręcicki
d7b441a1d5 netmgr: server-side TLS support
Add server-side TLS support to netmgr - that includes moving some of the isc_nm_
functions from tcp.c to a wrapper in netmgr.c calling a proper tcp or tls
function, and a new isc_nm_listentls function.
2020-08-31 10:58:37 -07:00
Evan Hunt
7aa9bbb8ac clear sock->statichandle if it goes to 0 references 2020-08-31 10:58:37 -07:00
Evan Hunt
4c8f28f087 experiment: add cancelread support for UDP, tweak lookup locking 2020-08-31 10:58:37 -07:00
Evan Hunt
1817dadf5d limit the time we wait for netmgr to be destroyed
if more than 10 seconds pass while we wait for netmgr
events to finish running on shutdown, something is almost
certainly wrong and we should assert and crash.
2020-08-31 10:58:37 -07:00
Evan Hunt
1cea2ede55 fixup! checkpoint: isc_nm_tcpdnsconnect 2020-08-31 10:58:37 -07:00
Evan Hunt
5316b99628 fixup! checkpoint: implement isc_nm_udpconnect() 2020-08-31 10:58:37 -07:00
Evan Hunt
db354895e7 checkpoint: implement isc_nm_read() for UDP
isc_nm_read() on a UDP socket will now read a single datagram and
stop until next time.
2020-08-31 10:58:37 -07:00
Evan Hunt
03009e7159 checkpoint: implement isc_nm_udpconnect()
this function sets up a UDP socket, connected to a specified peer
address, then immediately calls a callback with a handle so that
the caller can begin sending.
2020-08-31 10:58:37 -07:00
Witold Kręcicki
cac6b52672 checkpoint: isc_nm_tcpdnsconnect
add a function to establish outgoing TCPDNS connections.
2020-08-31 10:58:37 -07:00
Witold Kręcicki
9748d9f4d0 Rename isc_nmsocket_t->tcphandle to statichandle 2020-08-31 10:58:37 -07:00
Ondřej Surý
e0380d437d Handle EPROTO errno from recvmsg
It was discovered, that some systems might set EPROTO instead of EACCESS
on recvmsg() call causing spurious syslog messages from the socket
code.  This commit returns soft handling of EPROTO errno code to the
socket code. [GL #1928]
2020-08-28 20:45:52 +02:00
Ondřej Surý
78543ad5a7 Fix off-by-one error when calculating new hashtable size
When calculating the new hashtable bitsize, there was an off-by-one
error that would allow the new bitsize to be larger than maximum allowed
causing assertion failure in the rehash() function.
2020-08-28 16:21:21 +02:00
Mark Andrews
2ca4d35037 Refactor totext_loc 2020-08-26 15:31:31 +02:00
Mark Andrews
337cc878fa Correctly encode LOC records with non integer negative altitudes. 2020-08-26 15:31:31 +02:00
Mark Andrews
888dfd78c7 Check LOC's altitude field is properly parsed and encoded. 2020-08-26 15:31:31 +02:00
Mark Andrews
9225c67835 Tighten LOC parsing to reject period and/or m as a value. 2020-08-26 15:31:31 +02:00
Ondřej Surý
01684cc219 Use the Fibonacci Hashing for the RBTDB glue table
The rbtdb version glue_table has been refactored similarly to rbt.c hash
table, so it does use 32-bit hash function return values and apply
Fibonacci Hashing to lookup the index to the hash table instead of
modulo.  For more details, see the lib/dns/rbt.c commit log.
2020-08-26 21:16:04 +10:00
Mark Andrews
33d0e8d168 rbtversion->glue_table_size must be read when holding a lock 2020-08-26 21:16:04 +10:00
Mark Andrews
a347641782 Cast the original rcode to (dns_ttl_t) when setting extended rcode
Shifting (signed) integer left could trigger undefined behaviour when
the shifted value would overflow into the sign bit (e.g. 2048).

The issue was found when using AFL++ and UBSAN:

    message.c:2274:33: runtime error: left shift of 2048 by 20 places cannot be represented in type 'int'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior message.c:2274:33 in
2020-08-25 14:10:05 +00:00
Michal Nowak
dd425254a7 Fix warnings in when build with --enable-buffer-useinline
sockaddr.c:147:49: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness
    rdata.c:1780:30: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness
2020-08-25 16:02:55 +02:00
Mark Andrews
2eb5c29c83 Add missing isc_mutex_init to manytasks subtest. 2020-08-24 22:38:08 +00:00
Evan Hunt
d7362ff16d Merge tag 'v9_17_4' into main
BIND 9.17.4
2020-08-20 12:05:01 -07:00
Mark Andrews
8452404bd7 A6: return FORMERR in fromwire if bits are non zero.
oss_fuzz: Issue 24864: bind9:dns_rdata_fromwire_text_fuzzer: Overwrites-const-input in dns_rdata_fromwire_text_fuzzer
2020-08-18 11:04:05 +02:00
Mark Andrews
f6d7b8c20d RRSIG: reject records with empty SIG section 2020-08-18 11:04:05 +02:00
Ondřej Surý
ba2376b9e0 Update and cleanup the readline library support
This commit updates and simplifies the checks for the readline support
in nslookup and nsupdate:

  * Change the autoconf checks to pkg-config only, all supported
    libraries have accompanying .pc files now.
  * Add editline support in addition to libedit and GNU readline
  * Add isc/readline.h shim header that defines dummy readline()
    function when no readline library is available
2020-08-18 10:27:14 +02:00
Mark Andrews
7e49689746 X25: Check that record is all ASCII digits 2020-08-13 23:06:55 +10:00
Mark Andrews
9d446142d8 WKS: reject records with zero octets at the end of the bitmap 2020-08-13 23:06:55 +10:00
Mark Andrews
3429c35f52 TLSA: fix fromwire length checks 2020-08-13 23:06:55 +10:00
Mark Andrews
9b93e5d684 SIG: reject records with a zero length signature 2020-08-13 23:06:55 +10:00
Mark Andrews
73dd849655 NXT: fix fromwire bitmap checks 2020-08-13 23:06:55 +10:00
Mark Andrews
7dc8e720ff NSEC3PARAM: check that saltlen is consistent with the rdata length 2020-08-13 23:06:55 +10:00
Mark Andrews
031ee9e279 NSEC3: reject records with a zero length hash field 2020-08-13 23:06:55 +10:00
Mark Andrews
d7f7014803 IPSECKEY: require non-zero length public keys 2020-08-13 23:06:55 +10:00
Mark Andrews
a238f37239 CERT: reject records with a empty certificate field 2020-08-13 23:06:55 +10:00
Mark Andrews
3c492b3ef1 Get rid of type 'RESERVED0'. 2020-08-13 23:06:55 +10:00
Mark Andrews
6c7e50c267 base32_decode*() could incorrectly decode a input.
base32_decode_char() added a extra zero octet to the output
if the fifth character was a pad character.  The length
of octets to copy to the output was set to 3 instead of 2.
2020-08-13 23:06:55 +10:00
Mark Andrews
0b2555e8cf Address use after free between view, resolver and nta.
Hold a weak reference to the view so that it can't go away while
nta is performing its lookups.  Cancel nta timers once all external
references to the view have gone to prevent them triggering new work.
2020-08-11 11:00:49 +10:00
Mark Andrews
c9f019c931 Update managed keys log messages to be less confusing. 2020-08-11 00:10:10 +00:00