From 8ccbe8e38430d278455ac2ed3a5e2aa4c7acfcce Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Fri, 13 Mar 2026 22:22:20 +0100 Subject: [PATCH] crypto: reject ML-KEM/ML-DSA PKCS#8 import without seed in SubtleCrypto Reject importing ML-KEM and ML-DSA PKCS#8 private keys that do not include a seed, throwing NotSupportedError. Also add tests for importing PKCS#8 keys with a mismatched expanded key. Refs: https://redirect.github.com/WICG/webcrypto-modern-algos/pull/34 PR-URL: https://github.com/nodejs/node/pull/62218 Reviewed-By: Yagiz Nizipli Reviewed-By: Mattias Buelens --- doc/api/webcrypto.md | 4 ++ lib/internal/crypto/ml_dsa.js | 13 ++++ lib/internal/crypto/ml_kem.js | 13 ++++ .../test-webcrypto-export-import-ml-dsa.js | 68 ++++++++++--------- .../test-webcrypto-export-import-ml-kem.js | 68 ++++++++++--------- 5 files changed, 104 insertions(+), 62 deletions(-) diff --git a/doc/api/webcrypto.md b/doc/api/webcrypto.md index ce31a590f11..56383228cf0 100644 --- a/doc/api/webcrypto.md +++ b/doc/api/webcrypto.md @@ -1260,6 +1260,10 @@ The {CryptoKey} (secret key) generating algorithms supported include: