From 43ec829b0a0475aaefa103a2ac20d66b4ef07204 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Fri, 4 Dec 2026 11:45:52 +1000 Subject: [PATCH] Add TLS 1.3 test using only ML-KEM and ML-DSA Add a cipher suite test configuration that uses standalone ML-KEM key exchange and ML-DSA certificates with mutual authentication, so that no classical public key algorithm is used. The existing standalone ML-KEM tests use the build's default certificates, which are normally RSA. Pairs ML-KEM-512/768/1024 with ML-DSA-44/65/87. --- tests/include.am | 1 + tests/suites.c | 18 +++++++++ tests/test-tls13-pq-mlkem-mldsa.conf | 58 ++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 tests/test-tls13-pq-mlkem-mldsa.conf diff --git a/tests/include.am b/tests/include.am index 88ebab17809..93c64bcc7ac 100644 --- a/tests/include.am +++ b/tests/include.am @@ -46,6 +46,7 @@ EXTRA_DIST += tests/unit.h \ tests/test-tls13-null.conf \ tests/test-tls13-psk.conf \ tests/test-tls13-pq-standalone.conf \ + tests/test-tls13-pq-mlkem-mldsa.conf \ tests/test-tls13-pq-hybrid.conf \ tests/test-tls13-pq-hybrid-extra.conf \ tests/test-tls13-slhdsa-shake.conf \ diff --git a/tests/suites.c b/tests/suites.c index 4b5847be947..6a36f502d8f 100644 --- a/tests/suites.c +++ b/tests/suites.c @@ -1246,6 +1246,24 @@ int SuiteTest(int argc, char** argv) args.return_code = EXIT_FAILURE; goto exit; } + #if defined(TEST_HAVE_MLDSA_CERTS) && !defined(WOLFSSL_MLDSA_NO_ASN1) && \ + !defined(WOLFSSL_MLDSA_NO_MAKE_KEY) && \ + !defined(WOLFSSL_NO_ML_DSA_44) && !defined(WOLFSSL_NO_ML_DSA_65) && \ + !defined(WOLFSSL_NO_ML_DSA_87) + /* add TLSv13 ML-KEM key exchange with ML-DSA certificates tests. A + * certificate loads even when its ML-DSA level is not compiled in, so the + * harness can't skip by level and all of them are required. The private + * keys include the seed, which needs key generation to decode. */ + XSTRLCPY(argv0[1], "tests/test-tls13-pq-mlkem-mldsa.conf", + sizeof(argv0[1])); + printf("starting TLSv13 ML-KEM and ML-DSA only tests\n"); + test_harness(&args); + if (args.return_code != 0) { + printf("error from script %d\n", args.return_code); + args.return_code = EXIT_FAILURE; + goto exit; + } + #endif #endif /* !WOLFSSL_TLS_NO_MLKEM_STANDALONE */ #ifdef WOLFSSL_PQC_HYBRIDS /* add TLSv13 pq hybrid tests */ diff --git a/tests/test-tls13-pq-mlkem-mldsa.conf b/tests/test-tls13-pq-mlkem-mldsa.conf new file mode 100644 index 00000000000..0b3602815a0 --- /dev/null +++ b/tests/test-tls13-pq-mlkem-mldsa.conf @@ -0,0 +1,58 @@ +# Post-quantum only TLS 1.3: ML-KEM key exchange and ML-DSA authentication. +# +# Standalone (non-hybrid) ML-KEM groups and self-signed ML-DSA certificates with +# mutual authentication, so no classical public key algorithm is used. + +# server TLSv1.3 ML-KEM-512 key exchange, ML-DSA-44 certificates +-v 4 +-l TLS13-AES256-GCM-SHA384 +--pqc ML_KEM_512 +-c ./certs/mldsa/mldsa44-cert.pem +-k ./certs/mldsa/mldsa44-key.pem +-A ./certs/mldsa/mldsa44-cert.pem +-V + +# client TLSv1.3 ML-KEM-512 key exchange, ML-DSA-44 certificates +-v 4 +-l TLS13-AES256-GCM-SHA384 +--pqc ML_KEM_512 +-c ./certs/mldsa/mldsa44-cert.pem +-k ./certs/mldsa/mldsa44-key.pem +-A ./certs/mldsa/mldsa44-cert.pem +-C + +# server TLSv1.3 ML-KEM-768 key exchange, ML-DSA-65 certificates +-v 4 +-l TLS13-AES256-GCM-SHA384 +--pqc ML_KEM_768 +-c ./certs/mldsa/mldsa65-cert.pem +-k ./certs/mldsa/mldsa65-key.pem +-A ./certs/mldsa/mldsa65-cert.pem +-V + +# client TLSv1.3 ML-KEM-768 key exchange, ML-DSA-65 certificates +-v 4 +-l TLS13-AES256-GCM-SHA384 +--pqc ML_KEM_768 +-c ./certs/mldsa/mldsa65-cert.pem +-k ./certs/mldsa/mldsa65-key.pem +-A ./certs/mldsa/mldsa65-cert.pem +-C + +# server TLSv1.3 ML-KEM-1024 key exchange, ML-DSA-87 certificates +-v 4 +-l TLS13-AES256-GCM-SHA384 +--pqc ML_KEM_1024 +-c ./certs/mldsa/mldsa87-cert.pem +-k ./certs/mldsa/mldsa87-key.pem +-A ./certs/mldsa/mldsa87-cert.pem +-V + +# client TLSv1.3 ML-KEM-1024 key exchange, ML-DSA-87 certificates +-v 4 +-l TLS13-AES256-GCM-SHA384 +--pqc ML_KEM_1024 +-c ./certs/mldsa/mldsa87-cert.pem +-k ./certs/mldsa/mldsa87-key.pem +-A ./certs/mldsa/mldsa87-cert.pem +-C