-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Expand file tree
/
Copy pathWebCryptoAPI.cjs
More file actions
133 lines (116 loc) Β· 5.03 KB
/
Copy pathWebCryptoAPI.cjs
File metadata and controls
133 lines (116 loc) Β· 5.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
'use strict';
const os = require('node:os');
const { hasOpenSSL } = require('../../common/crypto.js');
const s390x = os.arch() === 's390x';
const conditionalFileSkips = {};
const conditionalSubtestSkips = {};
function skip(...files) {
for (const file of files) {
conditionalFileSkips[file] = {
'skip': 'Unsupported in ' + (process.features.openssl_is_boringssl ? 'BoringSSL' : `OpenSSL ${process.versions.openssl}`),
};
}
}
function skipSubtests(...entries) {
for (const [file, regexp] of entries) {
conditionalSubtestSkips[file] ||= {
'skipTests': [],
};
conditionalSubtestSkips[file].skipTests.push(regexp);
}
}
if (!hasOpenSSL(3, 0)) {
skip(
'encrypt_decrypt/aes_ocb.tentative.https.any.js',
'generateKey/failures_AES-OCB.tentative.https.any.js',
'generateKey/failures_kmac.tentative.https.any.js',
'generateKey/successes_AES-OCB.tentative.https.any.js',
'generateKey/successes_kmac.tentative.https.any.js',
'import_export/AES-OCB_importKey.tentative.https.any.js',
'import_export/KMAC_importKey.tentative.https.any.js',
'serialization/aes-ocb.tentative.https.any.js',
'serialization/kmac.tentative.https.any.js',
'sign_verify/kmac.tentative.https.any.js');
}
if (!hasOpenSSL(3, 2)) {
skip(
'derive_bits_keys/argon2.tentative.https.any.js',
'import_export/Argon2_importKey.tentative.https.any.js');
}
if (!hasOpenSSL(3, 5) && !process.features.openssl_is_boringssl) {
skip(
'encap_decap/encap_decap_bits.tentative.https.any.js',
'encap_decap/encap_decap_keys.tentative.https.any.js',
'generateKey/failures_ML-DSA.tentative.https.any.js',
'generateKey/failures_ML-KEM.tentative.https.any.js',
'generateKey/successes_ML-DSA.tentative.https.any.js',
'generateKey/successes_ML-KEM.tentative.https.any.js',
'import_export/ML-DSA_importKey.tentative.https.any.js',
'import_export/ML-KEM_importKey.tentative.https.any.js',
'serialization/mldsa.tentative.https.any.js',
'serialization/mlkem.tentative.https.any.js',
'sign_verify/mldsa.tentative.https.any.js');
skipSubtests(
['getPublicKey.tentative.https.any.js', /ml-(?:kem|dsa)/i],
['supports-modern.tentative.https.any.js', /ml-(?:kem|dsa)/i]);
}
if (process.features.openssl_is_boringssl) {
skip(
'derive_bits_keys/cfrg_curves_bits_curve448.tentative.https.any.js',
'derive_bits_keys/cfrg_curves_keys_curve448.tentative.https.any.js',
'digest/cshake.tentative.https.any.js',
'digest/sha3.tentative.https.any.js',
'generateKey/failures_Ed448.tentative.https.any.js',
'generateKey/failures_X448.tentative.https.any.js',
'generateKey/successes_Ed448.tentative.https.any.js',
'generateKey/successes_X448.tentative.https.any.js',
'import_export/okp_importKey_Ed448.tentative.https.any.js',
'import_export/okp_importKey_failures_Ed448.tentative.https.any.js',
'import_export/okp_importKey_failures_X448.tentative.https.any.js',
'import_export/okp_importKey_X448.tentative.https.any.js',
'serialization/ed448.tentative.https.any.js',
'serialization/x448.tentative.https.any.js',
'sign_verify/eddsa_curve448.tentative.https.any.js');
skipSubtests(
['encap_decap/encap_decap_bits.tentative.https.any.js', /ml-kem-512/i],
['encap_decap/encap_decap_keys.tentative.https.any.js', /ml-kem-512/i],
['generateKey/failures_ML-KEM.tentative.https.any.js', /ml-kem-512/i],
['generateKey/successes_ML-KEM.tentative.https.any.js', /ml-kem-512/i],
['getPublicKey.tentative.https.any.js', /ml-kem-512/i],
['import_export/ML-KEM_importKey.tentative.https.any.js', /ml-kem-512/i],
['serialization/mlkem.tentative.https.any.js', /ml-kem-512/i],
['supports-modern.tentative.https.any.js', /ml-kem-512/i]);
}
function assertNoOverlap(fileSkips, subtestSkips) {
const subtestSkipFiles = new Set(Object.keys(subtestSkips));
const overlap = Object.keys(fileSkips).filter((file) => subtestSkipFiles.has(file));
if (overlap.length !== 0) {
throw new Error(`conditionalFileSkips and conditionalSubtestSkips overlap: ${overlap.join(', ')}`);
}
}
assertNoOverlap(conditionalFileSkips, conditionalSubtestSkips);
module.exports = {
...conditionalFileSkips,
...conditionalSubtestSkips,
'algorithm-discards-context.https.window.js': {
'skip': 'Not relevant in Node.js context',
},
'historical.any.js': {
'skip': 'Not relevant in Node.js context',
},
'sign_verify/eddsa_small_order_points.https.any.js': {
'fail': {
'note': 'see https://github.com/nodejs/node/issues/54572',
'expected': [
'Ed25519 Verification checks with small-order key of order - Test 1',
'Ed25519 Verification checks with small-order key of order - Test 2',
'Ed25519 Verification checks with small-order key of order - Test 12',
'Ed25519 Verification checks with small-order key of order - Test 13',
...(s390x ? [] : [
'Ed25519 Verification checks with small-order key of order - Test 0',
'Ed25519 Verification checks with small-order key of order - Test 11',
]),
],
},
},
};