]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
validate: fix when NS is both parent and child and child is insecure
authorMarek Vavruša <mvavrusa@cloudflare.com>
Mon, 18 Jun 2018 23:17:53 +0000 (16:17 -0700)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Fri, 7 Sep 2018 17:45:21 +0000 (10:45 -0700)
When NS is both parent and child, it would respond to the final query
without signature and resolver is supposed to ask for DS to prove the
transition to insecure. Previously, this was only checked for NS queries
(made during referral chasing), so it would work for intermediate
nameservers, but not for final.

lib/layer/validate.c

index 1d205aa6fe29f58dd5ea3735936d71fbac99571b..51bb4add9967ef85d9994cc33dd90a729012d04a 100644 (file)
@@ -710,7 +710,7 @@ static int check_signer(kr_layer_t *ctx, knot_pkt_t *pkt)
                         * to prove transition to INSECURE. */
                        const uint16_t qtype = knot_pkt_qtype(pkt);
                        const knot_dname_t *qname = knot_pkt_qname(pkt);
-                       if (qtype == KNOT_RRTYPE_NS &&
+                       if (qtype != KNOT_RRTYPE_DS &&
                            knot_dname_in_bailiwick(qname, qry->zone_cut.name) > 0) {
                                /* Server is authoritative
                                 * for both parent and child,