Commit graph

24121 commits

Author SHA1 Message Date
Lennart Poettering 519d39deee man: add basic documentation for resolved.conf's DNSSEC= switch 2016-01-05 00:31:32 +01:00
Lennart Poettering 6f8a2c6817 update DNSSEC TODO 2016-01-04 22:43:25 +01:00
Lennart Poettering b2b796b8ab resolved: explicitly handle case when the trust anchor is empty
Since we honour RFC5011 revoked keys it might happen we end up with an
empty trust anchor, or one where there's no entry for the root left.
With this patch the logic is changed what to do in this case.

Before this patch we'd end up requesting the root DS, which returns with
NODATA but a signed NSEC we cannot verify, since the trust anchor is
empty after all. Thus we'd return a DNSSEC result of "missing-key", as
we lack a verified version of the key.

With this patch in place, look-ups for the root DS are explicitly
recognized, and not passed on to the DNS servers. Instead, if
downgrade-ok mode is on an unsigned NODATA response is synthesized, so
that the validator code continues under the assumption the root zone was
unsigned. If downgrade-ok mode is off a new transaction failure is
generated, that makes this case recognizable.
2016-01-04 22:42:10 +01:00
Lennart Poettering a761c1ca85 resolved: introduce a proper bus error for DNSSEC validation errors 2016-01-04 22:42:10 +01:00
Lennart Poettering f2992dc184 resolved: explicitly avoid cyclic transaction dependencies
We already try hard not to create cyclic transaction dependencies, where
a transaction requires another one for DNSSEC validation purposes, which
in turn (possibly indirectly) pulls in the original transaction again,
thus resulting in a cyclic dependency and ultimately a deadlock since
each transaction waits for another one forever.

So far we wanted to avoid such cyclic dependencies by only going "up the
tree" when requesting auxiliary RRs and only going from one RR type to
another, but never back. However this turned out to be insufficient.
Consider a domain that publishes one or more DNSKEY but which has no DS
for it. A request for the domain's DNSKEY triggers a request for the
domain's DS, which will then fail, but return an NSEC, signed by the
DNSKEY. To validate that we'd request the DNSKEY again. Thus a DNSKEY
request results in a DS request which results in the original DNSKEY
request again. If the original lookup had been a DS lookup we'd end up
in the same cyclic dependency, hence we cannot statically break one of
them, since both requests are of course fully valid. Hence, do full
cyclic dependency checking: each time we are about to add a dependency
to a transaction, check if the transaction is already a dependency of
the dependency (recursively down the tree).
2016-01-04 22:42:10 +01:00
Lennart Poettering 51e399bceb resolved: block transaction GC'ing while dns_transaction_request_dnssec_keys() is running
If any of the transactions started by
dns_transaction_request_dnssec_keys() finishes promptly without
requiring asynchronous operation this is reported back to the issuing
transaction from the same stackframe. This might ultimately result in
this transaction to be freed while we are still in its
_request_dnssec_keys() stack frame. To avoid memory corruption block the
transaction GC while in the call, and manually issue a GC after it
returned.
2016-01-04 22:42:10 +01:00
Lennart Poettering 3347e6a299 update RFCs 2016-01-04 22:42:10 +01:00
Lennart Poettering 0c85702874 resolved: partially implement RFC5011 Trust Anchor support
With this patch resolved will properly handle revoked keys, but not
augment the locally configured trust anchor database with newly learned
keys.

Specifically, resolved now refuses validating RRsets with
revoked keys, and it will remove revoked keys from the configured trust
anchors (only until reboot).

This patch does not add logic for adding new keys to the set of trust
anchors. This is a deliberate decision as this only can work with
persistent disk storage, and would result in a different update logic
for stateful and stateless systems.  Since we have to support stateless
systems anyway, and don't want to encourage two independent upgrade
paths we focus on upgrading the trust anchor database via the usual OS
upgrade logic.

Whenever a trust anchor entry is found revoked and removed from the
trust anchor a recognizable log message is written, encouraging the user
to update the trust anchor or update his operating system.
2016-01-04 22:42:10 +01:00
Lennart Poettering 85aeaccc10 resolved: fix DNSSEC canonical ordering logic
When applying canonical DNSSEC ordering for an RRset only order by the
wire format of the RRs' RDATA, not by the full wire formatting. The RFC
isn't particularly clear about this, but this is apparently how it is
done. This fixes validation of pentagon.gov's DS RRset.
2016-01-04 20:27:45 +01:00
Lennart Poettering beef6a5fc5 resolved: actually make use of message ID when logging about failed DNSSEC validation 2016-01-04 20:25:55 +01:00
Lennart Poettering 2a0d751be4 resolved: refuse revoked DNSKEYs in trust anchor 2016-01-03 17:57:44 +01:00
Lennart Poettering 28b8191e2f resolved: never authenticate RRsets with revoked keys 2016-01-03 17:56:50 +01:00
Lennart Poettering 1d3db294fc resolved: print a log message when we ignore an NSEC3 RR with an excessive amount of iterations 2016-01-03 17:54:01 +01:00
Lennart Poettering 05442a9cdc Merge pull request #2245 from ssahani/socket1
core: socket options fix SCTP_NODELAY
2016-01-03 14:19:37 +01:00
Lennart Poettering edcd8ae3ab Merge pull request #2254 from kelemeng/master
Updated Hungarian translations
2016-01-03 14:19:00 +01:00
Lennart Poettering 092500ec39 Merge pull request #2255 from teg/resolved-fixes-2
Fixes to NSEC3 proof v2
2016-01-03 14:18:05 +01:00
Tom Gundersen 113325b864 Merge pull request #2256 from poettering/dnssec10
Tenth DNSSEC patch set
2016-01-03 14:02:10 +01:00
Lennart Poettering c1dafe4f31 resolve: add RFC4501 URI support to systemd-resolve-host 2016-01-03 12:59:26 +01:00
Lennart Poettering 8e54f5d90a resolved: add negative trust anchro support, and add trust anchor configuration files
This adds negative trust anchor support and allows reading trust anchor
data from disk, from files
/etc/systemd/dnssec-trust-anchors.d/*.positive and
/etc/systemd/dnssec-trust-anchros.d/*.negative, as well as the matching
counterparts in /usr/lib and /run.

The positive trust anchor files are more or less compatible to normal
DNS zone files containing DNSKEY and DS RRs. The negative trust anchor
files contain only new-line separated hostnames for which to require no
signing.

By default no trust anchor files are installed, in which case the
compiled-in root domain DS RR is used, as before. As soon as at least
one positive root anchor for the root is defined via trust anchor files
this buil-in DS RR is not added though.
2016-01-03 12:59:26 +01:00
Tom Gundersen 35ad41d361 resolved: dnssec - properly take wildcards into account in NESC3 proof
For NXDOMAIN, it is not sufficient to prove that the next-closest
enclosure does not exist, we must also prove that there is no
wildcard domain directly below the closest enclosure which would
synthesise the name that has been requested.

For positive responses, in addition to exact matches, we should
accept wildcard ones. In that case we must first prove that
there is no precise match (i.e., that the closest encounter
is not the record itself) and secondly that the source of
synthesis exists.
2016-01-03 10:50:26 +01:00
Tom Gundersen 6f76ec5a7b resolved: dnssec - factor out hashed domain generation 2016-01-03 09:59:13 +01:00
Tom Gundersen 146035b3bb resolved: don't conclude NODATA if CNAME exists
Instead introduce the new return-code DNSSEC_NSEC_CNAME to indicate
this condition. See RFC 6840, Section 4.3.
2016-01-03 09:28:48 +01:00
Gabor Kelemen dc0c531b98 Add initial Hungarian message catalog translation 2016-01-02 23:17:27 +01:00
Gabor Kelemen e7df98beb4 Update Hungarian translation 2016-01-02 23:16:52 +01:00
Lennart Poettering e48b9a6490 resolved: fix serialization of the root domain 2016-01-02 22:16:16 +01:00
Lennart Poettering f2af5ea3cb resolved: only suffix RR key names with a dot if they don't have one yet 2016-01-02 22:16:16 +01:00
Lennart Poettering a8f158b929 resolved: don't accept NSEC3 iteration fields unbounded 2016-01-02 22:16:16 +01:00
Lennart Poettering 31d5192d0c basic: modernize conf-files.c a bit 2016-01-02 22:16:16 +01:00
Lennart Poettering 8ad182a124 resolved: explain why we don't check IP addresses/ports of incoming DNS UDP traffic 2016-01-02 22:16:16 +01:00
Lennart Poettering 7f10b629f8 resolved: extend RFCs list a bit 2016-01-02 22:16:16 +01:00
Tom Gundersen 964067666f resolved: dnssec - add reference to the algorithm we implement 2016-01-01 23:10:01 +01:00
Tom Gundersen b2c2a1b95d resolved: dnssec - prepend hashed labels to zone name
All hashed names consist of the hashed label prepended to the zone name, not to the
closest enclosure.
2016-01-01 23:10:01 +01:00
Tom Gundersen d1511b3338 resolved: dnssec - rename some variables
Makes the NSEC3 proof somewhat simpler to follow.
2016-01-01 23:10:01 +01:00
Tom Gundersen 935a999f7d resoled: dnssec - don't refuse to verify answer due to too many unrelated RRs
Let VERIFY_RRS_MAX be about the max number of RRs in an RRSet that we
actually try to verify, not about the total number of RRs in the RRSet.
2016-01-01 16:48:52 +01:00
Tom Gundersen ac04adbeb9 resolved: dnssec - fix off-by-one in RSA key parsing
If the first byte of the key is zero, the key-length is stored in
the second and third byte (not first and second).
2016-01-01 16:48:52 +01:00
Tom Gundersen 5809f340fd Merge pull request #2241 from poettering/dnssec9
Ninth DNSSEC patch set
2016-01-01 11:19:19 +01:00
Susant Sahani 62bc4efc7a core: socket options fix SCTP_NODELAY
SCTP_NODELAY is diffrent to TCP_NODELAY.
Apply proper options in case of SCTP.
2015-12-31 12:05:57 +05:30
Martin Pitt b485d2003e Merge pull request #2229 from cjmayo/m500
hwdb: move Logitech M-U0007 [M500] to 1000dpi
2015-12-30 11:27:52 +01:00
Lennart Poettering e9bb4ec69d resolved: add a list of DNS-related RFCs and their implementation status in resolved 2015-12-29 21:42:10 +01:00
Lennart Poettering 665408ac05 resolved: append RFC6975 algorithm data to EDNS OPT RR 2015-12-29 21:42:10 +01:00
Lennart Poettering d15ad74251 resolved: NSEC3 hash algorithms are distinct from DS digest algorithms
Previously, we'd use the same set of identifiers for both, but that's
actually incorrect. It didn't matter much since the only NSEC3 hash
algorithm defined (SHA-1) is mapped to code 1 which is also what it is
encoded as in DS digests, but we really should make sure to use two
distinct enumerations.
2015-12-29 21:42:10 +01:00
Lennart Poettering 0a9a2ac3d3 update DNSSEC TODO 2015-12-29 21:42:10 +01:00
Lennart Poettering 6af47493de resolved: add comments referencing various RFCs to various places 2015-12-29 21:42:10 +01:00
Lennart Poettering 6f717d0817 resolved: include GOST in list of DNSSEC algorithms
We don't implement it, and we have no intention to, but at least mention
that it exists.

(This also adds a couple of other algorithms to the algorithm string
list, where these strings were missing previously.)
2015-12-29 21:42:10 +01:00
Lennart Poettering efd46a696d resolved: use CLAMP() intsead of MIN(MAX()) 2015-12-29 21:42:10 +01:00
Lennart Poettering 7feea00bb0 resolved: don't allow RRs with TTL=0 and TTL!=0 in the same RRset 2015-12-29 21:42:09 +01:00
Lennart Poettering f3abbe2540 resolved: parse EDNS0 rcode extension bits 2015-12-29 21:42:09 +01:00
Lennart Poettering 0d0b52d79c resolved: reset RR TTL to 0, if MSB is set
RFC 2181, Section 8 suggests to treat an RR TTL with the MSB set as 0.
Implement this.
2015-12-29 21:42:09 +01:00
Lennart Poettering 9a1f0c283b resolved: properly handle SRV RRs with the DNS root as hostname 2015-12-29 21:42:09 +01:00
Lennart Poettering eebffed767 resolved: add errno mapping for BUS_ERROR_CONNECTION_FAILURE
This was missing when the error type was added in
ac720200b7.
2015-12-29 21:42:09 +01:00