Enable Edwards curves with PKCS#11

Ed25519 and Ed448 support (PKCS#11 v3.2) was added to libp11-0.4.17.
This commit is contained in:
Michal Nowak 2026-02-23 17:30:50 +01:00
parent 90b44f0bc5
commit 6811a8490a
3 changed files with 30 additions and 7 deletions

View 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 :)

View 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"

View 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):