Commit graph

13997 commits

Author SHA1 Message Date
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 092500ec39 Merge pull request #2255 from teg/resolved-fixes-2
Fixes to NSEC3 proof v2
2016-01-03 14:18:05 +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
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
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
Lennart Poettering fb85e6fd73 resolved: change mapping of BUS_ERROR_NO_NAME_SERVERS to ESRCH
EIO is really too generic, and indicates transmission problems.
2015-12-29 21:42:09 +01:00
Lennart Poettering d6c9d575e1 Merge pull request #2239 from evverx/fix-memory-leak-in-test-bus-marshal
tests: fix memory leak in test-bus-marshal
2015-12-29 21:31:29 +01:00
Evgeny Vereshchagin 49df985cef tests: fix memory leak in test-bus-marshal
Fixes:
```
$ ./configure ... --enable-dbus
$ make
$ make valgrind-tests TESTS=test-bus-marshal
...
==25301== 51 bytes in 1 blocks are definitely lost in loss record 7 of 18
==25301==    at 0x4C2DD9F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==25301==    by 0x5496B8C: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.3)
==25301==    by 0x54973E3: _dbus_string_append_printf_valist (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.3)
==25301==    by 0x547E5C2: _dbus_set_error_valist (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.3)
==25301==    by 0x547E73E: dbus_set_error (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.3)
==25301==    by 0x548969A: dbus_message_demarshal (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.3)
==25301==    by 0x115C1A: main (test-bus-marshal.c:244)
==25301==
```
2015-12-29 12:56:59 +00:00
Lennart Poettering 8ebdb652af Merge pull request #2233 from kinvolk/alban/cgroup2-userns
nspawn: userns and unified cgroup: chown cgroup.events
2015-12-29 12:39:25 +01:00
Tom Gundersen b038f6d1d8 Merge pull request #2231 from phomes/resolve-misc2
Resolve misc2
2015-12-28 17:27:42 +01:00
Lennart Poettering 160fbda907 resolved: update DNSSEC TODO 2015-12-28 14:46:39 +01:00
Lennart Poettering b211dc7e83 resolved: also use RRSIG expiry for negative caching
This makes sure that we also honour the RRSIG expiry for negative
caching.
2015-12-28 14:46:39 +01:00
Lennart Poettering ee3d6aff9b resolved: use RRSIG expiry and original TTL for cache management
When we verified a signature, fix up the RR's TTL to the original TTL
mentioned in the signature, and store the signature expiry information
in the RR, too. Then, use that when adding RRs to the cache.
2015-12-28 14:46:39 +01:00
Lennart Poettering f535705a45 resolved: clean up dns_transaction_stop()
This renames dns_transaction_stop() to dns_transaction_stop_timeout()
and makes it only about stopping the transaction timeout. This is safe,
as in most occasions we call dns_transaction_stop() at the same time as
dns_transaction_close_connection() anyway, which does the rest of what
dns_transaction_stop() used to do. And in the one where we don't call
it, it's implicitly called by the UDP emission or TCP connection code.

This also closes the connections as we enter the validation phase of a
transaction, so that no further messages may be received then.
2015-12-28 14:46:39 +01:00
Lennart Poettering ca994e853c resolved: only keep a single list of supported signature algorithms
This removes dnssec_algorithm_supported() and simply uses the
algorithm_to_gcrypt() result as indication whether a DNSSEC algorithm is
supported.

The patch also renames "algorithm" to "md_algorithm", in a few cases, in
order to avoid confusion between DNSSEC signature algorithms and gcrypt
message digest algorithms.
2015-12-28 14:46:39 +01:00
Lennart Poettering 502a798599 resolve-host: log RR parsing errors 2015-12-28 14:46:39 +01:00
Lennart Poettering e0240c64b7 resolved: add ECDSA signature support 2015-12-28 14:46:39 +01:00
Lennart Poettering c7feab7647 shared: relax restrictions on valid domain name characters a bit
Previously, we'd not allow control characters to be embedded in domain
names, even when escaped. Since cloudflare uses \000 however to
implement its synthethic minimally covering NSEC RRs, we should allow
them, as long as they are properly escaped.
2015-12-28 14:46:39 +01:00
Alban Crequy aa3be0dd36 nspawn: userns and unified cgroup: chown cgroup.events
When starting a container in a new user namespace, systemd-nspawn chowns
the cgroup knob files so they are usable by the container. But the
cgroup knob file "cgroup.events" was missing. This file exists when the
unified hierarchy is used.
2015-12-28 14:30:56 +01:00
Lennart Poettering ea3a892fe3 resolved: split out RSA-specific code from dnssec_verify_rrset()
In preparation for ECDSA support.
2015-12-28 01:18:55 +01:00
Lennart Poettering fbf1a66d78 resolved: simplify MD algorithm initialization a bit 2015-12-28 01:18:55 +01:00
Lennart Poettering af22c65b27 resolved: add SHA384 digest support 2015-12-28 01:18:55 +01:00
Thomas Hindoe Paaboel Andersen f770083430 resolve-host: add error checking 2015-12-28 00:05:17 +01:00