Commit graph

13983 commits

Author SHA1 Message Date
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
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
Thomas Hindoe Paaboel Andersen c03cba007a resolve: remove unused variables 2015-12-28 00:05:17 +01:00
Tom Gundersen f791b677a8 Merge pull request #2225 from poettering/dnssec7
Seventh DNSSEC patchset
2015-12-27 21:19:28 +01:00
Lennart Poettering f4461e5641 resolved: rename "features" variables to "feature_level"
The name "features" suggests an orthogonal bitmap or suchlike, but the
variables really encode only a linear set of feature levels. The type
used is already called DnsServerFeatureLevel, hence fix up the variables
accordingly, too.
2015-12-27 01:41:40 +01:00
Lennart Poettering 519ef04651 resolved: rework OPT RR generation logic
This moves management of the OPT RR out of the scope management and into
the server and packet management. There are now explicit calls for
appending and truncating the OPT RR from a packet
(dns_packet_append_opt() and dns_packet_truncate_opt()) as well as a
call to do the right thing depending on a DnsServer's feature level
(dns_server_adjust_opt()).

This also unifies the code to pick a server between the TCP and UDP code
paths, and makes sure the feature level used for the transaction is
selected at the time the server is picked, and not changed until the
next time we pick a server. The server selction code is now unified in
dns_transaction_pick_server().

This all fixes problems when changing between UDP and TCP communication
for the same server, and makes sure the UDP and TCP codepaths are more
alike. It also makes sure we never keep the UDP port open when switchung
to TCP, so that we don't have to handle incoming datagrams on the latter
we don't expect.

As the new code picks the DNS server at the time we make a connection,
we don't need to invalidate the DNS server anymore when changing to the
next one, thus dns_transaction_next_dns_server() has been removed.
2015-12-27 01:41:40 +01:00
Lennart Poettering 97cc656cf4 resolved: reuse dns_transaction_stop() when destructing transaction objects 2015-12-27 01:41:40 +01:00
Lennart Poettering f32f0e57ca resolved: add dns_transaction_close_connection()
This new call unifies how we shut down all connection resources, such as
UDP sockets, event sources, and TCP stream objects.

This patch just adds the basic hook-up, this function will be used more
in later commits.
2015-12-27 01:41:39 +01:00
Lennart Poettering 919c2ae05c resolved: make sure we reset the DNSSEC result when we accept a response packet 2015-12-27 01:41:39 +01:00
Lennart Poettering 2c6bf498b6 resolved: improve some log messages a bit
Indicate thar we ignore invalid messages
2015-12-27 01:41:39 +01:00
Lennart Poettering 2a6658ef55 resolved: never proceed processing truncated packets
Make sure we don't end up processing packets that are truncated.
Instead, actually let the TCP connection do its thing.
2015-12-27 01:41:39 +01:00
Lennart Poettering cbe4216dd1 resolved: remember explicitly whether we already tried a stream connection
On LLMNR we never want to retry stream connections (since local TCP
connections should work, and we don't want to unnecessarily delay
operation), explicitly remember whether we already tried one, instead of
deriving this from a still stored stream object. This way, we can free
the stream early, without forgetting that we tried it.
2015-12-27 01:41:39 +01:00
Lennart Poettering 598f44bd2c resolved: make sure we GC stream transactions properly
Make sure to GC a transaction after dealing with a reply, even if the
transaction is not complete yet.
2015-12-27 01:41:39 +01:00
Lennart Poettering 5a7e41a370 resolved: ignore additional DNS responses we get while validating
No need to choke on them.
2015-12-27 01:41:39 +01:00
Lennart Poettering c61d2b441a resolved: introduce dns_transaction_reset_answer()
Let's unify how we reset the answer data we collected, after all pretty
much every time we do it incompletely so far, let's fix it.
2015-12-27 01:41:39 +01:00
Lennart Poettering 5651285934 shared: fix handling of suffix "." in dns_name_compare_func()
All our other domain name handling functions make no destinction between
domain names that end in a dot plus a NUL, or those just ending in a
NUL. Make sure dns_name_compare_func() and dns_label_unescape_suffix()
do the same.
2015-12-27 01:41:39 +01:00