Commit 0b5673614f for bind

commit 0b5673614fef4434423cfcfaa93170081ef64c04
Author: Nicki Křížek <nicki@isc.org>
Date:   Fri Nov 6 13:09:17 2026 +0000

    Send the zero-modulus DNSKEY update from pytest

    The update came from a hex blob sent through packet.pl; dnspython
    builds the same packet, byte for byte but the message ID.  It runs as
    a second function of the enginepkcs11 module to reuse its servers; a
    module of its own would initialise the token and generate the keys all
    over again.  The test now also checks that the update is accepted,
    not just that named still answers.

    Assisted-by: Claude:claude-opus-5-5

diff --git a/bin/tests/system/enginepkcs11/2037-pk11_numbits-crash-test.pkt b/bin/tests/system/enginepkcs11/2037-pk11_numbits-crash-test.pkt
deleted file mode 100644
index b9c5a32ade..0000000000
--- a/bin/tests/system/enginepkcs11/2037-pk11_numbits-crash-test.pkt
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# SPDX-License-Identifier: MPL-2.0
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0.  If a copy of the MPL was not distributed with this
-# file, you can obtain one at https://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-edda 2800 0001 0000 0001 0000 0972 7361
-7368 6132 3536 0765 7861 6d70 6c65 0000
-0600 01c0 0c00 3000 0100 0001 2c01 0801
-0003 0803 0100 0100 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 0000 0000 0000 0000 0000
-0000 0000 0000 00
diff --git a/bin/tests/system/enginepkcs11/tests.sh b/bin/tests/system/enginepkcs11/tests.sh
index ce22820431..4764f3aed0 100644
--- a/bin/tests/system/enginepkcs11/tests.sh
+++ b/bin/tests/system/enginepkcs11/tests.sh
@@ -414,13 +414,5 @@ fi
 # Go back to main test dir.
 cd ..

-n=$((n + 1))
-ret=0
-echo_i "Checking for assertion failure in pk11_numbits()"
-$PERL ../packet.pl -a "10.53.0.1" -p "$PORT" -t udp 2037-pk11_numbits-crash-test.pkt
-dig_with_opts @10.53.0.1 version.bind. CH TXT >dig.out.pk11_numbits || ret=1
-test "$ret" -eq 0 || echo_i "failed"
-status=$((status + ret))
-
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1
diff --git a/bin/tests/system/enginepkcs11/tests_sh_enginepkcs11.py b/bin/tests/system/enginepkcs11/tests_sh_enginepkcs11.py
index 9c0ce12013..281ba9e653 100644
--- a/bin/tests/system/enginepkcs11/tests_sh_enginepkcs11.py
+++ b/bin/tests/system/enginepkcs11/tests_sh_enginepkcs11.py
@@ -14,8 +14,14 @@ from typing import Any

 import os

+import dns.dnssec
+import dns.rdataclass
+import dns.rdatatype
+import dns.rdtypes.ANY.DNSKEY
+import dns.update
 import pytest

+import isctest
 import isctest.mark
 import isctest.template

@@ -95,3 +101,20 @@ def bootstrap() -> dict[str, Any]:

 def test_enginepkcs11(run_tests_sh):
     run_tests_sh()
+
+
+def test_enginepkcs11_dnskey_with_zero_modulus(ns1):
+    # The native PKCS#11 code removed in 9.17 crashed on such a key (GL#2037)
+    dnskey = dns.rdtypes.ANY.DNSKEY.DNSKEY(
+        dns.rdataclass.IN,
+        dns.rdatatype.DNSKEY,
+        flags=256,
+        protocol=3,
+        algorithm=dns.dnssec.Algorithm.RSASHA256,
+        key=b"\x03\x01\x00\x01" + bytes(256),
+    )
+    update = dns.update.UpdateMessage("rsasha256.example.")
+    update.add("rsasha256.example.", 300, dnskey)
+
+    res = isctest.query.tcp(update, ns1.ip)
+    isctest.check.noerror(res)