summaryrefslogtreecommitdiff
path: root/test/parallel/test-crypto-keygen.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-crypto-keygen.js')
-rw-r--r--test/parallel/test-crypto-keygen.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js
index c27d5fe166..b80b351357 100644
--- a/test/parallel/test-crypto-keygen.js
+++ b/test/parallel/test-crypto-keygen.js
@@ -1283,3 +1283,19 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
}));
}
}
+
+{
+ // Proprietary Web Cryptography API ECDH/ECDSA namedCurve parameters
+ // should not be recognized in this API.
+ // See https://github.com/nodejs/node/issues/37055
+ const curves = ['NODE-ED25519', 'NODE-ED448', 'NODE-X25519', 'NODE-X448'];
+ for (const namedCurve of curves) {
+ assert.throws(
+ () => generateKeyPair('ec', { namedCurve }, common.mustNotCall()),
+ {
+ name: 'TypeError',
+ message: 'Invalid EC curve name'
+ }
+ );
+ }
+}