]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Enable Edwards curves with PKCS#11
authorMichal Nowak <mnowak@isc.org>
Mon, 23 Feb 2026 16:30:50 +0000 (17:30 +0100)
committerMichal Nowak <mnowak@isc.org>
Tue, 26 May 2026 11:13:52 +0000 (11:13 +0000)
Ed25519 and Ed448 support (PKCS#11 v3.2) was added to libp11-0.4.17.

bin/tests/system/enginepkcs11/setup.sh
bin/tests/system/enginepkcs11/tests.sh
bin/tests/system/keyfromlabel/tests_keyfromlabel.py

index 0f6cbc693234e5ea8e156933cda6d8cbed2debef..459a6ea6239cbb24a9b4adb5c83d4442dacd1cee 100644 (file)
@@ -49,8 +49,8 @@ mkdir ns1/keys
 dir="ns1"
 infile="${dir}/template.db.in"
 for algtypebits in rsasha256:rsa:2048 rsasha512:rsa:2048 \
-  ecdsap256sha256:EC:prime256v1 ecdsap384sha384:EC:prime384v1; do # Edwards curves are not yet supported by OpenSC
-  # ed25519:EC:edwards25519 ed448:EC:edwards448
+  ecdsap256sha256:EC:prime256v1 ecdsap384sha384:EC:prime384v1 \
+  ed25519:EC:Ed25519 ed448:EC:Ed448; do
   alg=$(echo "$algtypebits" | cut -f 1 -d :)
   type=$(echo "$algtypebits" | cut -f 2 -d :)
   bits=$(echo "$algtypebits" | cut -f 3 -d :)
index 138b0483a8158340072ca2421ac859631ce5b279..0546a7c62ae1b42e10dd18502b00e00950e30991 100644 (file)
@@ -50,11 +50,17 @@ check_keys() {
 cd ns1
 
 for algtypebits in rsasha256:rsa:2048 rsasha512:rsa:2048 \
-  ecdsap256sha256:EC:prime256v1 ecdsap384sha384:EC:prime384v1; do # Edwards curves are not yet supported by OpenSC
-  # ed25519:EC:edwards25519 ed448:EC:edwards448
+  ecdsap256sha256:EC:prime256v1 ecdsap384sha384:EC:prime384v1 \
+  ed25519:EC:Ed25519 ed448:EC:Ed448; do
   alg=$(echo "$algtypebits" | cut -f 1 -d :)
   type=$(echo "$algtypebits" | cut -f 2 -d :)
   bits=$(echo "$algtypebits" | cut -f 3 -d :)
+  alg_upper=$(echo "$alg" | tr '[:lower:]' '[:upper:]')
+  supported=$(eval "echo \$${alg_upper}_SUPPORTED")
+  if [ "${supported}" != 1 ]; then
+    echo_i "skipping test for ${alg}:${type}:${bits}, not supported by this build"
+    continue
+  fi
   zone="${alg}.example"
   zonefile="zone.${zone}.db.signed"
 
index ad3ad0160398509d575f006254413528f98598d2..948d308ef930092a804cb7a957be53193c4107aa 100644 (file)
@@ -17,6 +17,8 @@ import shutil
 
 import pytest
 
+from isctest.util import param
+
 import isctest.mark
 
 pytestmark = [
@@ -93,9 +95,24 @@ def token_init_and_cleanup():
         ("rsasha512", "rsa", "2048"),
         ("ecdsap256sha256", "EC", "prime256v1"),
         ("ecdsap384sha384", "EC", "prime384v1"),
-        # Edwards curves are not yet supported by OpenSC
-        # ("ed25519","EC","edwards25519"),
-        # ("ed448","EC","edwards448")
+        param(
+            "ed25519",
+            "EC",
+            "Ed25519",
+            marks=pytest.mark.skipif(
+                os.environ.get("ED25519_SUPPORTED") != "1",
+                reason="Ed25519 not supported by this build",
+            ),
+        ),
+        param(
+            "ed448",
+            "EC",
+            "Ed448",
+            marks=pytest.mark.skipif(
+                os.environ.get("ED448_SUPPORTED") != "1",
+                reason="Ed448 not supported by this build",
+            ),
+        ),
     ],
 )
 def test_keyfromlabel(alg_name, alg_type, alg_bits):