Skip to content

Commit f8fcf3d

Browse files
committed
resolved: probe for dnssec support in allow-downgrade mode
Previously, sd-resolved unnecessarily requested SOA records for each dns label in the query, even though they are not needed for the chain of trust. Since 4769063, only the necessary records are queried when validating. This is actually a problem in allow-downgrade mode, since we will no longer attempt a query for a record that we know is signed a priori, and will therefore never update our belief about the state of dnssec support in the recursive resolver. Rectify this by reintroducing a query for the the root zone SOA in the allow-downgrade case, specifically to test that the resolver attaches the RRSIGs which we know must exist. Fixes: 4769063 ("resolved: don't request the SOA for every dns label")
1 parent ba2caa8 commit f8fcf3d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/resolve/resolved-dns-transaction.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2647,7 +2647,7 @@ int dns_transaction_request_dnssec_keys(DnsTransaction *t) {
26472647
case DNS_TYPE_DS:
26482648
case DNS_TYPE_CNAME:
26492649
case DNS_TYPE_DNAME: {
2650-
_cleanup_(dns_resource_key_unrefp) DnsResourceKey *ds = NULL;
2650+
_cleanup_(dns_resource_key_unrefp) DnsResourceKey *ds = NULL, *soa = NULL;
26512651
const char *name;
26522652

26532653
/* CNAMEs and DNAMEs cannot be located at a
@@ -2695,6 +2695,21 @@ int dns_transaction_request_dnssec_keys(DnsTransaction *t) {
26952695
if (r < 0)
26962696
return r;
26972697

2698+
if (t->scope->dnssec_mode == DNSSEC_ALLOW_DOWNGRADE && dns_name_is_root(name)) {
2699+
/* We made it all the way to the root zone. If we are in allow-downgrade
2700+
* mode, we need to make at least one request that we can be certain should
2701+
* have been signed, to test for servers that are not dnssec aware. */
2702+
soa = dns_resource_key_new(rr->key->class, DNS_TYPE_SOA, name);
2703+
if (!soa)
2704+
return -ENOMEM;
2705+
2706+
log_debug("Requesting root zone SOA to probe dnssec support");
2707+
r = dns_transaction_request_dnssec_rr(t, soa);
2708+
if (r < 0)
2709+
return r;
2710+
2711+
}
2712+
26982713
break;
26992714
}
27002715

0 commit comments

Comments
 (0)