Commit aeb4d62572 for bind

commit aeb4d62572bad312c73601789c0b73e0d64f1c3e
Author: Štěpán Balážik <stepan@isc.org>
Date:   Wed Oct 21 13:14:04 2026 +0200

    Build the FORMERR test's KEY record with dnspython's KEY rdata type

    dnspython 2.9.0 added the KEY rdata type alongside SIG, so the one
    record the FORMERR test still packed by hand can be built the way the
    test builds its other records.

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

diff --git a/bin/tests/system/formerr/tests_formerr.py b/bin/tests/system/formerr/tests_formerr.py
index 5ab9e60ef9..ebbff84f9e 100644
--- a/bin/tests/system/formerr/tests_formerr.py
+++ b/bin/tests/system/formerr/tests_formerr.py
@@ -20,6 +20,7 @@ import dns.opcode
 import dns.rcode
 import dns.rdataclass
 import dns.rdatatype
+import dns.rdtypes.ANY.KEY
 import dns.rdtypes.ANY.NSEC3
 import dns.rdtypes.ANY.OPT
 import dns.rdtypes.ANY.RRSIG
@@ -179,28 +180,19 @@ def nsec3_rr(
     )


-def key_rdata(
-    *,
-    flags: int,
-    protocol: int,
-    algorithm: int,
-    keydata: bytes,
-) -> bytes:
-    # No dns.rdtypes.ANY.KEY.KEY class, so construct the rdata manually
-    return wire(u16(flags), bytes([protocol, algorithm]), keydata)
-
-
 def key_rr(*, rdclass: dns.rdataclass.RdataClass) -> bytes:
     return rr(
         root(),
         dns.rdatatype.RdataType.KEY,
         rdclass,
-        rdata=key_rdata(
+        rdata=dns.rdtypes.ANY.KEY.KEY(
+            rdclass,
+            dns.rdatatype.RdataType.KEY,
             flags=0,
             protocol=0,
             algorithm=248,
-            keydata=b"\x00",
-        ),
+            key=b"\x00",
+        ).to_wire(),
     )