]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: validate authentic insecure delegation to CNAME
authorRonan Pigott <ronan@rjp.ie>
Tue, 30 Apr 2024 20:19:14 +0000 (13:19 -0700)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 1 May 2024 18:34:08 +0000 (20:34 +0200)
If the parent zone uses a non-opt-out method that provides authenticated
negative DS replies, we still can't expect signatures from the child
zone. sd-resolved was using the authenticated status of the DS reply to
require signatures for CNAMEs, even though it had already proved that no
signature exists.

Fixes: 47690634f157 ("resolved: don't request the SOA for every dns label")
src/resolve/resolved-dns-transaction.c

index 32b49807155518732807d5267a81bc375bb72c34..92ac0752fec117bf6a285d562d8327380a3060b7 100644 (file)
@@ -2936,7 +2936,12 @@ static int dns_transaction_requires_rrsig(DnsTransaction *t, DnsResourceRecord *
                         if (r == 0)
                                 continue;
 
-                        return FLAGS_SET(dt->answer_query_flags, SD_RESOLVED_AUTHENTICATED);
+                        if (!FLAGS_SET(dt->answer_query_flags, SD_RESOLVED_AUTHENTICATED))
+                                return false;
+
+                        /* We expect this to be signed when the DS record exists, and don't expect it to be
+                         * signed when the DS record is proven not to exist. */
+                        return dns_answer_match_key(dt->answer, dns_transaction_key(dt), NULL);
                 }
 
                 return true;