Home | History | Annotate | Line # | Download | only in dnssec
      1 # Copyright (C) Internet Systems Consortium, Inc. ("ISC")
      2 #
      3 # SPDX-License-Identifier: MPL-2.0
      4 #
      5 # This Source Code Form is subject to the terms of the Mozilla Public
      6 # License, v. 2.0.  If a copy of the MPL was not distributed with this
      7 # file, you can obtain one at https://mozilla.org/MPL/2.0/.
      8 #
      9 # See the COPYRIGHT file distributed with this work for additional
     10 # information regarding copyright ownership.
     11 
     12 
     13 from dns import rdatatype
     14 
     15 import pytest
     16 
     17 import isctest
     18 import isctest.mark
     19 
     20 pytestmark = pytest.mark.extra_artifacts(
     21     [
     22         "*/K*",
     23         "*/NSEC*",
     24         "*/dsset-*",
     25         "*/*.bk",
     26         "*/*.conf",
     27         "*/*.db",
     28         "*/*.id",
     29         "*/*.jnl",
     30         "*/*.jbk",
     31         "*/*.key",
     32         "*/*.signed",
     33         "*/settime.out.*",
     34         "ans*/ans.run",
     35         "*/trusted.keys",
     36         "*/*.bad",
     37         "*/*.next",
     38         "*/*.stripped",
     39         "*/*.tmp",
     40         "*/*.stage?",
     41         "*/*.patched",
     42         "*/*.lower",
     43         "*/*.upper",
     44         "*/*.unsplit",
     45     ]
     46 )
     47 
     48 
     49 def test_positive_validation_dname_at_apex():
     50     # an apex DNAME is signed by the DNSKEY living at the DNAME owner
     51     # name itself; fetching that key must not be mistaken for a
     52     # non-advancing alias chain (GL #6176)
     53     msg = isctest.query.create("a.dname-at-apex-nsec3.example", "A")
     54     res = isctest.query.tcp(msg, "10.53.0.4")
     55     isctest.check.noerror(res)
     56     isctest.check.adflag(res)
     57     answers = {(str(rr.name), rr.rdtype) for rr in res.answer}
     58     assert ("dname-at-apex-nsec3.example.", rdatatype.DNAME) in answers
     59     assert ("a.example.", rdatatype.A) in answers
     60