Vladimír Čunát [Thu, 14 Mar 2019 12:09:48 +0000 (13:09 +0100)]
module API+ABI: remove one level of indirection
... for layers and props. This breaks C module API+ABI.
It seemed weird to repeatedly call a function that returns a pointer
to a structure in which we find the function we want to actually call.
We've never used changing these functions AFAIK, and the target
functions could easily be written to change their behavior instead
(i.e. move the indirection *inside* the function).
When breaking this, I also removed these two (_layers and _props)
from the dynamic symbols (to be) exported from the C modules.
They always pointed to memory belonging inside the module,
and they seem quite sensible to be set up by the _init symbol instead.
Petr Špaček [Thu, 11 Apr 2019 13:57:06 +0000 (15:57 +0200)]
table_print: simplification
As far as I understand the debug.sethook('call') descrption we are not
going to have any locals except function parameters so we can simplify
the code.
Vladimír Čunát [Mon, 8 Apr 2019 13:54:43 +0000 (15:54 +0200)]
modules/http DoH: allocate req.qsource on req.pool
The problem is that C structures are not scanned by lua GC,
so we'd have to keep these alive in some other way; therefore
it's simpler to just use the mempool.
Vladimír Čunát [Mon, 8 Apr 2019 13:52:18 +0000 (15:52 +0200)]
lib/utils kr_straddr_socket(): support mempools
"Unfortunately", for FFI-bound C functions there it doesn't hold that
missing parameters would be converted to nil/NULL.
Still, this function seems unlikely to have been used outside the repo.
Petr Špaček [Thu, 4 Apr 2019 11:19:45 +0000 (13:19 +0200)]
doh: limit max query size to 1024 B
The value is kind of arbitrary, as precaution. 64k value was causing
cqueues to close connections with GET requests with "Broken pipe"
and it seems to work with 1024 B.
Petr Špaček [Tue, 2 Apr 2019 13:49:17 +0000 (15:49 +0200)]
doh: send out HTTP TTL
We intentionally compute max-age header as minimum over all RRs, doing
so only over ANSWER section does not make sense (and RFC 8484 allows us
to do so).
Vladimír Čunát [Fri, 29 Mar 2019 19:16:31 +0000 (20:16 +0100)]
cache: fix incorrect TTL of positive packets in cache
It's a regression of b00ee5fa8 (v3.0.0). Fortunately, since that
version we use cache for positive packets only when they are BOGUS
(see `bool want_pkt =`) so that they're available for +cd queries.
Therefore the impact was really negligible, until the DoT module.
Petr Špaček [Fri, 29 Mar 2019 15:35:31 +0000 (16:35 +0100)]
DoH experiment
First version which actually works with Firefox DoH in default
configuration.
Limitations:
- does not support HTTP GET method
- headers for HTTP cache are not generated
- error handling is largely missing
- no tests
- ACLs will not work, modules do not see source IP address of the HTTP
endpoint
Petr Špaček [Sat, 16 Mar 2019 10:06:21 +0000 (11:06 +0100)]
sandbox: table_print sorts table keys
This makes it much easier to navigate in complex data structures.
AFAIK table_print is not used for anything except user interface so it
is not performance critical and we can re-sort table every time.
Debian packaging as of 3.2.1-3 is no longer shipping libkres9 or
libkres-dev (see https://bugs.debian.org/923970). This brings the
upstream debian-style packaging in line with the Debian packaging on
that front.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Vladimír Čunát [Thu, 28 Mar 2019 07:34:26 +0000 (08:34 +0100)]
validate nitpick fix: unsupported algo edge case
kr_dnskeys_trusted() semantics is changed, but I do NOT consider that
a part of public API.
Go insecure due to algorithm support even if DNSKEY is NODATA.
I can't see how that's relevant to practical usage, but I think this new
behavior makes more sense. We still do try to fetch the DNSKEY even
though we have information about its un-usability beforehand.
I'd consider fixing that a premature optimization.
We'll still be affected if the DNSKEY query SERVFAILs or something.
Marek Vavruša [Tue, 5 Mar 2019 18:35:21 +0000 (10:35 -0800)]
nsrep: allow inclusion of good nameservers if there's space in selection
The current algorithm doesn't work if there's 3 unknown nameservers in the
address selection set, and the 4th is known working with higher score
than unknown.
The extra pointer layer was useless. Note: we couldn't put an UV handle
directly inside an array because their addresses can't be moved IIRC,
but we had it behind a pointer already.