@@ -11,7 +11,7 @@ before it's acceptable to upstream, as this patch comments out a couple
11
11
of tests that upstream probably cares about.
12
12
13
13
diff --git a/test/parallel/test-crypto-async-sign-verify.js b/test/parallel/test-crypto-async-sign-verify.js
14
- index b35dd08e6c49796418cd9d10eb5cc9d02b39961e..c5d701f6464694456813d2aadff2fe9ec0b0acd5 100644
14
+ index b35dd08e6c49796418cd9d10eb5cc9d02b39961e..97bcd79b331db140d157e6b1faf92625597edc98 100644
15
15
--- a/test/parallel/test-crypto-async-sign-verify.js
16
16
+++ b/test/parallel/test-crypto-async-sign-verify.js
17
17
@@ -89,6 +89,7 @@ test('rsa_public.pem', 'rsa_private.pem', 'sha256', false,
@@ -37,7 +37,7 @@ index b35dd08e6c49796418cd9d10eb5cc9d02b39961e..c5d701f6464694456813d2aadff2fe9e
37
37
- const expected = hasOpenSSL3 ?
38
38
- /operation not supported for this keytype/ : /no default digest/;
39
39
+ let expected = /no default digest/;
40
- + if (hasOpenSSL3 || ! process.features.openssl_is_boringssl) {
40
+ + if (hasOpenSSL3 || process.features.openssl_is_boringssl) {
41
41
+ expected = /operation[\s_]not[\s_]supported[\s_]for[\s_]this[\s_]keytype/i;
42
42
+ }
43
43
@@ -109,23 +109,29 @@ index 81a469c226c261564dee1e0b06b6571b18a41f1f..58b66045dba4201b7ebedd78b129420f
109
109
110
110
const availableCurves = new Set(crypto.getCurves());
111
111
diff --git a/test/parallel/test-crypto-dh-errors.js b/test/parallel/test-crypto-dh-errors.js
112
- index 0af4db0310750cea9350ecff7fc44404c6df6c83..85ab03f6019989ad4fe93b779c3b4772ce1f5130 100644
112
+ index 0af4db0310750cea9350ecff7fc44404c6df6c83..b14b4bbf88b902b6de916b92e3d48335c01df911 100644
113
113
--- a/test/parallel/test-crypto-dh-errors.js
114
114
+++ b/test/parallel/test-crypto-dh-errors.js
115
- @@ -33,9 +33,9 @@ for (const bits of [-1, 0, 1]) {
115
+ @@ -27,7 +27,7 @@ assert.throws(() => crypto.createDiffieHellman('abcdef', 13.37), {
116
+ for (const bits of [-1, 0, 1]) {
117
+ if (hasOpenSSL3) {
118
+ assert.throws(() => crypto.createDiffieHellman(bits), {
119
+ - code: 'ERR_OSSL_DH_MODULUS_TOO_SMALL',
120
+ + code: 'ERR_OSSL_BN_BITS_TOO_SMALL',
121
+ name: 'Error',
122
+ message: /modulus too small/,
116
123
});
117
- } else {
124
+ @@ -35,7 +35,7 @@ for (const bits of [-1, 0, 1]) {
118
125
assert.throws(() => crypto.createDiffieHellman(bits), {
119
- - code: 'ERR_OSSL_BN_BITS_TOO_SMALL',
120
- + code: /ERR_OSSL_BN_BITS_TOO_SMALL|ERR_OSSL_DH_MODULUS_TOO_LARGE/,
126
+ code: 'ERR_OSSL_BN_BITS_TOO_SMALL',
121
127
name: 'Error',
122
128
- message: /bits too small/,
123
- + message: /bits too small|BITS_TOO_SMALL|MODULUS_TOO_LARGE/ ,
129
+ + message: /bits[\s_] too[\s_] small/i ,
124
130
});
125
131
}
126
132
}
127
133
diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js
128
- index d7ffbe5eca92734aa2380f482c7f9bfe7e2a36c7..21ab2333431ea70bdf98dde43624e0b712566395 100644
134
+ index d7ffbe5eca92734aa2380f482c7f9bfe7e2a36c7..b4e7002d862907d2af3b4f8e985700bd03300809 100644
129
135
--- a/test/parallel/test-crypto-dh.js
130
136
+++ b/test/parallel/test-crypto-dh.js
131
137
@@ -60,18 +60,17 @@ const {
@@ -136,10 +142,10 @@ index d7ffbe5eca92734aa2380f482c7f9bfe7e2a36c7..21ab2333431ea70bdf98dde43624e0b7
136
142
- code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH',
137
143
- library: 'Provider routines',
138
144
- reason: 'wrong final block length'
139
- + message: /error:1C80006B:Provider routines:: wrong final block length|error:1e00007b:Cipher functions:OPENSSL_internal:WRONG_FINAL_BLOCK_LENGTH/ ,
145
+ + message: /wrong[\s_] final[\s_] block[\s_] length/i ,
140
146
+ code: /ERR_OSSL_(EVP_)?WRONG_FINAL_BLOCK_LENGTH/,
141
- + library: /digital envelope routines|Cipher functions/,
142
- + reason: /wrong final block length|WRONG_FINAL_BLOCK_LENGTH/
147
+ + library: /Provider routines|Cipher functions/,
148
+ + reason: /wrong[\s_] final[\s_] block[\s_] length/i,
143
149
};
144
150
} else {
145
151
wrongBlockLength = {
@@ -148,10 +154,10 @@ index d7ffbe5eca92734aa2380f482c7f9bfe7e2a36c7..21ab2333431ea70bdf98dde43624e0b7
148
154
- code: 'ERR_OSSL_EVP_WRONG_FINAL_BLOCK_LENGTH',
149
155
- library: 'digital envelope routines',
150
156
- reason: 'wrong final block length'
151
- + message: /error:0606506D:digital envelope routines:EVP_DecryptFinal_ex: wrong final block length|error:1e00007b:Cipher functions:OPENSSL_internal:WRONG_FINAL_BLOCK_LENGTH/ ,
157
+ + message: /wrong[\s_] final[\s_] block[\s_] length/i ,
152
158
+ code: /ERR_OSSL_(EVP_)?WRONG_FINAL_BLOCK_LENGTH/,
153
159
+ library: /digital envelope routines|Cipher functions/,
154
- + reason: /wrong final block length|WRONG_FINAL_BLOCK_LENGTH/
160
+ + reason: /wrong[\s_] final[\s_] block[\s_] length/i,
155
161
};
156
162
}
157
163
@@ -217,33 +223,46 @@ index 61145aee0727fbe0b9781acdb3eeb641e7010729..51693e637b310981f76f23c2f35d43e4
217
223
if (!hasOpenSSL(3, 4)) {
218
224
assert.strictEqual(crypto.createHash('shake128').digest('hex'),
219
225
diff --git a/test/parallel/test-crypto-padding.js b/test/parallel/test-crypto-padding.js
220
- index 48cd1ed4df61aaddeee8785cb90f83bdd9628187..a18aeb2bdffcc7a7e9ef12328b849994e39d6c27 100644
226
+ index 48cd1ed4df61aaddeee8785cb90f83bdd9628187..d09e01712c617597833bb1320a32a967bcf1d318 100644
221
227
--- a/test/parallel/test-crypto-padding.js
222
228
+++ b/test/parallel/test-crypto-padding.js
223
- @@ -88,10 +88,9 @@ assert.throws(function() {
224
- code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH',
225
- reason: 'wrong final block length',
229
+ @@ -84,14 +84,13 @@ assert.throws(function() {
230
+ // Input must have block length %.
231
+ enc(ODD_LENGTH_PLAIN, false);
232
+ }, hasOpenSSL3 ? {
233
+ - message: 'error:1C80006B:Provider routines::wrong final block length',
234
+ - code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH',
235
+ - reason: 'wrong final block length',
236
+ + message: /wrong[\s_]final[\s_]block[\s_]length/i,
237
+ + code: /ERR_OSSL(_EVP)?_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH/,
238
+ + message: /wrong[\s_]final[\s_]block[\s_]length/i,
226
239
} : {
227
240
- message: 'error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:' +
228
241
- 'data not multiple of block length',
229
242
- code: 'ERR_OSSL_EVP_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH',
230
243
- reason: 'data not multiple of block length',
231
- + message: /error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex: data not multiple of block length|error:1e00006a:Cipher functions:OPENSSL_internal:DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH/ ,
244
+ + message: /data[\s_] not[\s_] multiple[\s_]of[\s_] block[\s_] length/i ,
232
245
+ code: /ERR_OSSL(_EVP)?_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH/,
233
- + reason: /data not multiple of block length|DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH/ ,
246
+ + reason: /data[\s_] not[\s_] multiple[\s_]of[\s_] block[\s_] length/i ,
234
247
}
235
248
);
236
249
237
- @@ -115,10 +114,9 @@ assert.throws(function() {
238
- reason: 'bad decrypt',
239
- code: 'ERR_OSSL_BAD_DECRYPT',
240
- } : {
250
+ @@ -110,15 +109,10 @@ assert.strictEqual(dec(EVEN_LENGTH_ENCRYPTED, false).length, 48);
251
+ assert.throws(function() {
252
+ // Must have at least 1 byte of padding (PKCS):
253
+ assert.strictEqual(dec(EVEN_LENGTH_ENCRYPTED_NOPAD, true), EVEN_LENGTH_PLAIN);
254
+ - }, hasOpenSSL3 ? {
255
+ - message: 'error:1C800064:Provider routines::bad decrypt',
256
+ - reason: 'bad decrypt',
257
+ - code: 'ERR_OSSL_BAD_DECRYPT',
258
+ - } : {
241
259
- message: 'error:06065064:digital envelope routines:EVP_DecryptFinal_ex:' +
242
260
- 'bad decrypt',
243
261
- reason: 'bad decrypt',
244
262
- code: 'ERR_OSSL_EVP_BAD_DECRYPT',
245
- + message: /error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt|error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT/,
246
- + reason: /bad decrypt|BAD_DECRYPT/,
263
+ + }, {
264
+ + message: /bad[\s_]decrypt/i,
265
+ + reason: /bad[\s_]decrypt/i,
247
266
+ code: /ERR_OSSL(_EVP)?_BAD_DECRYPT/,
248
267
});
249
268
@@ -358,6 +377,23 @@ index 0589d60736e377f24dc8550f87a6b7624173fc44..113003826fc47a589cf2334f7345e33d
358
377
359
378
for (const [file, length] of keys) {
360
379
const privKey = fixtures.readKey(file);
380
+ diff --git a/test/parallel/test-crypto-stream.js b/test/parallel/test-crypto-stream.js
381
+ index 747af780469c22eb8e4c6c35424043e868f75c3d..ed0916b036a9af23d805007ebd609973ee954473 100644
382
+ --- a/test/parallel/test-crypto-stream.js
383
+ +++ b/test/parallel/test-crypto-stream.js
384
+ @@ -73,9 +73,9 @@ const cipher = crypto.createCipheriv('aes-128-cbc', key, iv);
385
+ const decipher = crypto.createDecipheriv('aes-128-cbc', badkey, iv);
386
+
387
+ cipher.pipe(decipher)
388
+ - .on('error', common.expectsError(hasOpenSSL3 ? {
389
+ - message: /bad[\s_]decrypt/,
390
+ - library: 'Provider routines',
391
+ + .on('error', common.expectsError((hasOpenSSL3 || process.features.openssl_is_boringssl) ? {
392
+ + message: /bad[\s_]decrypt/i,
393
+ + library: /Provider routines|Cipher functions/,
394
+ reason: /bad[\s_]decrypt/i,
395
+ } : {
396
+ message: /bad[\s_]decrypt/i,
361
397
diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js
362
398
index 84111740cd9ef6425b747e24e984e66e46b0b2ef..b1621d310536fae3fdec91a6a9d275ec8fc99a98 100644
363
399
--- a/test/parallel/test-crypto.js
@@ -415,6 +451,29 @@ index 84111740cd9ef6425b747e24e984e66e46b0b2ef..b1621d310536fae3fdec91a6a9d275ec
415
451
// Make sure memory isn't released before being returned
416
452
console.log(crypto.randomBytes(16));
417
453
454
+ diff --git a/test/parallel/test-tls-alert-handling.js b/test/parallel/test-tls-alert-handling.js
455
+ index 7bd42bbe721c4c9442410d524c5ca740078fc72c..de49dbdc2b75517f497af353a6b24b1beb11ed69 100644
456
+ --- a/test/parallel/test-tls-alert-handling.js
457
+ +++ b/test/parallel/test-tls-alert-handling.js
458
+ @@ -43,7 +43,8 @@ const errorHandler = common.mustCall((err) => {
459
+
460
+ assert.strictEqual(err.code, expectedErrorCode);
461
+ assert.strictEqual(err.library, 'SSL routines');
462
+ - if (!hasOpenSSL3) assert.strictEqual(err.function, 'ssl3_get_record');
463
+ + if (!hasOpenSSL3 && !process.features.openssl_is_boringssl)
464
+ + assert.strictEqual(err.function, 'ssl3_get_record');
465
+ assert.match(err.reason, expectedErrorReason);
466
+ errorReceived = true;
467
+ if (canCloseServer())
468
+ @@ -105,7 +106,7 @@ function sendBADTLSRecord() {
469
+ }
470
+ assert.strictEqual(err.code, expectedErrorCode);
471
+ assert.strictEqual(err.library, 'SSL routines');
472
+ - if (!hasOpenSSL3)
473
+ + if (!hasOpenSSL3 && !process.features.openssl_is_boringssl)
474
+ assert.strictEqual(err.function, 'ssl3_read_bytes');
475
+ assert.match(err.reason, expectedErrorReason);
476
+ }));
418
477
diff --git a/test/parallel/test-webcrypto-wrap-unwrap.js b/test/parallel/test-webcrypto-wrap-unwrap.js
419
478
index d1ca571af4be713082d32093bfb8a65f2aef9800..57b8df2ce18df58ff54b2d828af67e3c2e082fe0 100644
420
479
--- a/test/parallel/test-webcrypto-wrap-unwrap.js
0 commit comments