Commit 39dbd26e6f for bind

commit 39dbd26e6f8ddf9ddf502358344b61e56299fe70
Author: Štěpán Balážik <stepan@isc.org>
Date:   Mon Oct 19 17:20:49 2026 +0200

    Give each nsec_synthesis zone a trust anchor of its own

    The resolver trusted f004, f007 and f023 with one key, the current
    module's.  Each module now hands the trust anchor of the zone it signs
    to the common template.

    Assisted-by: Claude:claude-fable-5-1

diff --git a/bin/tests/system/nsec_synthesis/ns2/named.conf.j2 b/bin/tests/system/nsec_synthesis/ns2/named.conf.j2
index 820c17f4de..d6eb8dccea 100644
--- a/bin/tests/system/nsec_synthesis/ns2/named.conf.j2
+++ b/bin/tests/system/nsec_synthesis/ns2/named.conf.j2
@@ -30,8 +30,4 @@ zone "evil.f023.test" {
 	server-addresses { 10.53.0.1; };
 };

-trust-anchors {
-	f004.test. static-key 257 3 13 "@DNSKEY@";
-	f007.test. static-key 257 3 13 "@DNSKEY@";
-	f023.test. static-key 257 3 13 "@DNSKEY@";
-};
+{% include "_common/trusted.conf.j2" %}
diff --git a/bin/tests/system/nsec_synthesis/tests_nsec_child_next.py b/bin/tests/system/nsec_synthesis/tests_nsec_child_next.py
index ff1ae30b10..ddd6efa6b4 100644
--- a/bin/tests/system/nsec_synthesis/tests_nsec_child_next.py
+++ b/bin/tests/system/nsec_synthesis/tests_nsec_child_next.py
@@ -13,6 +13,7 @@ from pathlib import Path

 import json

+from isctest.template import TrustAnchor
 from nsec_synthesis.common import (
     SIGNED_ZONE_MARKS,
     check_forged_nsec,
@@ -38,8 +39,9 @@ pytestmark = SIGNED_ZONE_MARKS
 def bootstrap():
     keys = {F023_ZONE: make_key(F023_ZONE)}
     Path("ans1/keys.json").write_text(json.dumps(keys, indent=2), encoding="ascii")
-    dnskey = "".join(keys[F023_ZONE]["dnskey"].split()[3:])
-    return {"DNSKEY": dnskey}
+    dnskey = keys[F023_ZONE]["dnskey"].split()
+    contents = f'{" ".join(dnskey[:3])} "{"".join(dnskey[3:])}"'
+    return {"trust_anchors": [TrustAnchor(F023_ZONE, "static-key", contents)]}


 def _prime_parent_for_aggressive_nsec():
diff --git a/bin/tests/system/nsec_synthesis/tests_nsec_exact_nodata.py b/bin/tests/system/nsec_synthesis/tests_nsec_exact_nodata.py
index 41d8cc3ad5..a89aba2cfd 100644
--- a/bin/tests/system/nsec_synthesis/tests_nsec_exact_nodata.py
+++ b/bin/tests/system/nsec_synthesis/tests_nsec_exact_nodata.py
@@ -13,6 +13,7 @@ from pathlib import Path

 import json

+from isctest.template import TrustAnchor
 from nsec_synthesis.common import (
     SIGNED_ZONE_MARKS,
     check_forged_nsec,
@@ -36,8 +37,9 @@ pytestmark = SIGNED_ZONE_MARKS
 def bootstrap():
     keys = {F004_ZONE: make_key(F004_ZONE)}
     Path("ans1/keys.json").write_text(json.dumps(keys, indent=2), encoding="ascii")
-    dnskey = "".join(keys[F004_ZONE]["dnskey"].split()[3:])
-    return {"DNSKEY": dnskey}
+    dnskey = keys[F004_ZONE]["dnskey"].split()
+    contents = f'{" ".join(dnskey[:3])} "{"".join(dnskey[3:])}"'
+    return {"trust_anchors": [TrustAnchor(F004_ZONE, "static-key", contents)]}


 def test_pending_exact_nodata_nsec_cache_poisoning():
diff --git a/bin/tests/system/nsec_synthesis/tests_nsec_pending_cd.py b/bin/tests/system/nsec_synthesis/tests_nsec_pending_cd.py
index f3a43ca103..a2f4ac37ad 100644
--- a/bin/tests/system/nsec_synthesis/tests_nsec_pending_cd.py
+++ b/bin/tests/system/nsec_synthesis/tests_nsec_pending_cd.py
@@ -13,6 +13,7 @@ from pathlib import Path

 import json

+from isctest.template import TrustAnchor
 from nsec_synthesis.common import (
     SIGNED_ZONE_MARKS,
     check_forged_nsec,
@@ -37,8 +38,9 @@ pytestmark = SIGNED_ZONE_MARKS
 def bootstrap():
     keys = {F004_ZONE: make_key(F004_ZONE)}
     Path("ans1/keys.json").write_text(json.dumps(keys, indent=2), encoding="ascii")
-    dnskey = "".join(keys[f"{F004_ZONE}"]["dnskey"].split()[3:])
-    return {"DNSKEY": dnskey}
+    dnskey = keys[F004_ZONE]["dnskey"].split()
+    contents = f'{" ".join(dnskey[:3])} "{"".join(dnskey[3:])}"'
+    return {"trust_anchors": [TrustAnchor(F004_ZONE, "static-key", contents)]}


 def test_pending_trust_nsec_cd_cache_poisoning():
diff --git a/bin/tests/system/nsec_synthesis/tests_nsec_selfloop.py b/bin/tests/system/nsec_synthesis/tests_nsec_selfloop.py
index 4898bfd9cb..b253336563 100644
--- a/bin/tests/system/nsec_synthesis/tests_nsec_selfloop.py
+++ b/bin/tests/system/nsec_synthesis/tests_nsec_selfloop.py
@@ -14,6 +14,7 @@ from pathlib import Path
 import pytest

 from isctest.run import EnvCmd
+from isctest.template import TrustAnchor
 from nsec_synthesis.common import check_nsec, get_nsec, has_a

 import isctest
@@ -78,11 +79,9 @@ victim A {VICTIM_A}
     signer(f"-o {PARENT} -f f007.test.db.signed f007.test.db", cwd="ns3")

     dnskey = str(isctest.kasp.Key(parent_ksk, keydir="ns3").dnskey).split()
-    ta = "".join(dnskey[7:])
+    contents = f'{" ".join(dnskey[4:7])} "{"".join(dnskey[7:])}"'

-    return {
-        "DNSKEY": ta,
-    }
+    return {"trust_anchors": [TrustAnchor(PARENT, "static-key", contents)]}


 def test_direct_child_self_loop_nsec_fixture():