Skip to content

Commit 8fa07f3

Browse files
committed
crypto: add CFRG curves to Web Crypto API
nodejs/node#42507
1 parent 9cc0a6f commit 8fa07f3

3 files changed

Lines changed: 49 additions & 5 deletions

File tree

lib/asar/fs-wrapper.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,6 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
414414
return Promise.resolve(archive.stat(filePath) !== false);
415415
};
416416

417-
console.log(fs);
418-
419417
const { existsSync } = fs;
420418
fs.existsSync = (pathArgument: string) => {
421419
const pathInfo = splitPath(pathArgument);

patches/node/fix_crypto_tests_to_run_with_bssl.patch

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ index b06f2fa2c53ea72f9a66f0d002dd9281d0259a0f..864fffeebfad75d95416fd47efdea7f2
948948

949949
const server = https.createServer(opts, (req, res) => {
950950
diff --git a/test/parallel/test-webcrypto-derivebits.js b/test/parallel/test-webcrypto-derivebits.js
951-
index 442423954b10b2ee1696eb7db56eaa4c88492122..93bdf4d33e440d2506605473f9f8611a548ae48b 100644
951+
index 442423954b10b2ee1696eb7db56eaa4c88492122..c65610245e7e328d5e844afc48f8f685c49be3b7 100644
952952
--- a/test/parallel/test-webcrypto-derivebits.js
953953
+++ b/test/parallel/test-webcrypto-derivebits.js
954954
@@ -37,6 +37,7 @@ const { subtle } = require('crypto').webcrypto;
@@ -967,8 +967,21 @@ index 442423954b10b2ee1696eb7db56eaa4c88492122..93bdf4d33e440d2506605473f9f8611a
967967

968968
// Test PBKDF2 bit derivation
969969
{
970+
@@ -101,6 +103,7 @@ const { subtle } = require('crypto').webcrypto;
971+
tests.then(common.mustCall());
972+
}
973+
974+
+/*
975+
// Test X25519 and X448 bit derivation
976+
{
977+
async function test(name) {
978+
@@ -126,3 +129,4 @@ const { subtle } = require('crypto').webcrypto;
979+
test('X25519').then(common.mustCall());
980+
test('X448').then(common.mustCall());
981+
}
982+
+*/
970983
diff --git a/test/parallel/test-webcrypto-derivekey.js b/test/parallel/test-webcrypto-derivekey.js
971-
index f8eb996000ec899abafbfd558f4f49bad2c69c9a..4c68dbf42f965e02e224af4dfb4368b717c7fec7 100644
984+
index f8eb996000ec899abafbfd558f4f49bad2c69c9a..0bf5c7811eeccff6194d8df41887df0a86a53823 100644
972985
--- a/test/parallel/test-webcrypto-derivekey.js
973986
+++ b/test/parallel/test-webcrypto-derivekey.js
974987
@@ -46,6 +46,7 @@ const { webcrypto: { subtle }, KeyObject } = require('crypto');
@@ -987,6 +1000,19 @@ index f8eb996000ec899abafbfd558f4f49bad2c69c9a..4c68dbf42f965e02e224af4dfb4368b7
9871000

9881001
// Test PBKDF2 key derivation
9891002
{
1003+
@@ -151,6 +153,7 @@ const { webcrypto: { subtle }, KeyObject } = require('crypto');
1004+
})().then(common.mustCall());
1005+
}
1006+
1007+
+/*
1008+
// Test X25519 and X448 key derivation
1009+
{
1010+
async function test(name) {
1011+
@@ -185,3 +188,4 @@ const { webcrypto: { subtle }, KeyObject } = require('crypto');
1012+
test('X25519').then(common.mustCall());
1013+
test('X448').then(common.mustCall());
1014+
}
1015+
+*/
9901016
diff --git a/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js b/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js
9911017
index 151eebd36c9765df086a020ba42920b2442b1b77..efe97ff2499cba909ac5500d827364fa389a0469 100644
9921018
--- a/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js
@@ -1000,6 +1026,23 @@ index 151eebd36c9765df086a020ba42920b2442b1b77..efe97ff2499cba909ac5500d827364fa
10001026
});
10011027
}
10021028

1029+
diff --git a/test/parallel/test-webcrypto-sign-verify.js b/test/parallel/test-webcrypto-sign-verify.js
1030+
index 6c6b15781549a4b37781bf0b8014054dc5d8c746..142d41b169c836201660d78c19383f3ffc469407 100644
1031+
--- a/test/parallel/test-webcrypto-sign-verify.js
1032+
+++ b/test/parallel/test-webcrypto-sign-verify.js
1033+
@@ -105,6 +105,7 @@ const { subtle } = require('crypto').webcrypto;
1034+
test('hello world').then(common.mustCall());
1035+
}
1036+
1037+
+/*
1038+
// Test Sign/Verify Ed25519
1039+
{
1040+
async function test(data) {
1041+
@@ -144,3 +145,4 @@ const { subtle } = require('crypto').webcrypto;
1042+
1043+
test('hello world').then(common.mustCall());
1044+
}
1045+
+*/
10031046
diff --git a/test/parallel/test-webcrypto-wrap-unwrap.js b/test/parallel/test-webcrypto-wrap-unwrap.js
10041047
index 1094845c73e14313860ad476fb7baba2a11b5af4..51972b4b34b191ac59145889dbf2da5c0d407dbe 100644
10051048
--- a/test/parallel/test-webcrypto-wrap-unwrap.js

script/node-disabled-tests.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,17 @@
104104
"parallel/test-trace-events-worker-metadata",
105105
"parallel/test-v8-untrusted-code-mitigations",
106106
"parallel/test-webcrypto-derivebits-node-dh",
107+
"parallel/test-webcrypto-derivebits-cfrg",
108+
"parallel/test-webcrypto-derivekey-cfrg",
107109
"parallel/test-webcrypto-ed25519-ed448",
108110
"parallel/test-webcrypto-encrypt-decrypt",
109111
"parallel/test-webcrypto-encrypt-decrypt-aes",
110112
"parallel/test-webcrypto-encrypt-decrypt-rsa",
113+
"parallel/test-webcrypto-export-import-cfrg",
111114
"parallel/test-webcrypto-keygen",
112115
"parallel/test-webcrypto-rsa-pss-params",
113116
"parallel/test-webcrypto-sign-verify-node-dsa",
114-
"parallel/test-webcrypto-x25519-x448",
117+
"parallel/test-webcrypto-sign-verify-eddsa",
115118
"parallel/test-worker-debug",
116119
"parallel/test-worker-stdio",
117120
"parallel/test-zlib-unused-weak",

0 commit comments

Comments
 (0)