mirror of
https://github.com/electron/electron.git
synced 2026-01-06 22:24:03 -05:00
* chore: upgrade Node.js to v24.10.0 * chore: fixup crypto patch * chore: fixup crypto test patch * src: prepare for v8 sandboxing https://github.com/nodejs/node/pull/58376 * esm: fix module.exports export on CJS modules https://github.com/nodejs/node/pull/57366 * chore: fixup lazyload fs patch * esm: Source Phase Imports for WebAssembly https://github.com/nodejs/node/pull/56919 * module: remove --experimental-default-type https://github.com/nodejs/node/pull/56092 * lib,src: refactor assert to load error source from memory https://github.com/nodejs/node/pull/59751 * src: add source location to v8::TaskRunner https://github.com/nodejs/node/pull/54077 * src: remove dependency on wrapper-descriptor-based CppHeap https://github.com/nodejs/node/pull/54077 * src: do not use soon-to-be-deprecated V8 API https://github.com/nodejs/node/pull/53174 * src: stop using deprecated fields of v8::FastApiCallbackOptions https://github.com/nodejs/node/pull/54077 * test: update v8-stats test for V8 12.6 https://github.com/nodejs/node/pull/54077 * esm: unflag --experimental-wasm-modules https://github.com/nodejs/node/pull/57038 * test: adapt assert tests to stack trace changes https://github.com/nodejs/node/pull/58070 * src,test: unregister the isolate after disposal and before freeing https://github.com/nodejs/node/pull/58070 * src: use cppgc to manage ContextifyContext https://github.com/nodejs/node/pull/56522 * src: replace uses of FastApiTypedArray https://github.com/nodejs/node/pull/58070 * module: integrate TypeScript into compile cache https://github.com/nodejs/node/pull/56629 * deps: update ada to 3.2.7 https://github.com/nodejs/node/pull/59336 * src: make minor cleanups in encoding_binding.cc https://github.com/nodejs/node/pull/57448 * src: switch from `Get/SetPrototype` to `Get/SetPrototypeV2` https://github.com/nodejs/node/pull/55453 * src: use non-deprecated Get/SetPrototype methods https://github.com/nodejs/node/pull/59671 * src: simplify string_bytes with views https://github.com/nodejs/node/pull/54876 * src: improve utf8 string generation performance https://github.com/nodejs/node/pull/54873 * src: use non-deprecated Utf8LengthV2() method https://github.com/nodejs/node/pull/58070 * src: use non-deprecated WriteUtf8V2() method https://github.com/nodejs/node/pull/58070 * src: refactor WriteUCS2 and remove flags argument https://github.com/nodejs/node/pull/58163 * src: use String::WriteV2() in TwoByteValue https://github.com/nodejs/node/pull/58164 * node-api: use WriteV2 in napi_get_value_string_utf16 https://github.com/nodejs/node/pull/58165 * node-api: use WriteOneByteV2 in napi_get_value_string_latin1 https://github.com/nodejs/node/pull/58325 * src: migrate WriteOneByte to WriteOneByteV2 https://github.com/nodejs/node/pull/59634 * fs: introduce dirent\.parentPath https://github.com/nodejs/node/pull/50976 * src: avoid copy by using std::views::keys https://github.com/nodejs/node/pull/56080 * chore: fixup patch indices * fix: errant use of context->GetIsolate() * fix: tweak BoringSSL compat patch for new changes * fix: add back missing isolate dtor declaration * fixup! esm: fix module.exports export on CJS modules * cli: remove --no-experimental-fetch flag https://github.com/nodejs/node/pull/52611/files * esm: Source Phase Imports for WebAssembly https://github.com/nodejs/node/pull/56919 * fixup! src: prepare for v8 sandboxing * chore: bump @types/node to v24 * chore: fix const assignment in crypto test * fix: sandbox pointer patch issues * chore: rework source phase import patch * src: add percentage support to --max-old-space-size https://github.com/nodejs/node/pull/59082 * chore: fixup crypto tests * chore: HostImportModuleWithPhaseDynamically todo * fix: cjs esm failures * fix: v8::Object::Wrappable issues -b72a615754-490bac2496-4896a0dd69* chore: remove deleted specs * src: use v8::ExternalMemoryAccounter https://github.com/nodejs/node/pull/58070 * fs: port SonicBoom module to fs module as FastUtf8Stream https://github.com/nodejs/node/pull/58897 * chore: tweak sandboxed pr patch * test: disable parallel/test-os-checked-function * test: use WHATWG URL instead of url.parse * fix: OPENSSL_secure_zalloc doesn't work in BoringSSL * chore: fix accidental extra line * 7017517: [defer-import-eval] Parse import defer syntax https://chromium-review.googlesource.com/c/v8/v8/+/7017517
1487 lines
66 KiB
Diff
1487 lines
66 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jeremy Rose <nornagon@nornagon.net>
|
|
Date: Tue, 9 Feb 2021 12:34:46 -0800
|
|
Subject: fix crypto tests to run with bssl
|
|
|
|
This fixes some crypto tests so that they pass when compiled with
|
|
BoringSSL.
|
|
|
|
This should be upstreamed in some form, though it may need to be tweaked
|
|
before it's acceptable to upstream, as this patch comments out a couple
|
|
of tests that upstream probably cares about.
|
|
|
|
diff --git a/test/fixtures/crypto/ecdsa.js b/test/fixtures/crypto/ecdsa.js
|
|
index b8827b24d41965b355c6e8bbf33ebc2c034a9035..c3545fb20ec7df3e6c3d8e7c3396030af85637c0 100644
|
|
--- a/test/fixtures/crypto/ecdsa.js
|
|
+++ b/test/fixtures/crypto/ecdsa.js
|
|
@@ -72,18 +72,20 @@ module.exports = function() {
|
|
'b6a0a14d7e4bc6dd2eda82c9234f174b670b60c8f7d101f68fdf5889e02373b025' +
|
|
'dcbc4c82f2929b8e06c68535da98e38fe399c53a814b097935581ef21535eb',
|
|
'hex'),
|
|
- 'SHA3-256': Buffer.from(
|
|
- 'f6a48eb5557f484ed0c3e4b5c78a3cf497cbd346db06a4165d429248aa2cc51a69' +
|
|
- '747d09f57af145469a8b607a9b8b9709629d74e8f5ca337c6ddc581b6f6103',
|
|
- 'hex'),
|
|
- 'SHA3-384': Buffer.from(
|
|
- '777785978eb59da32888554dc7fd62d1ba1a3033cddaa8c36b8f3dcea8f85e1c8e' +
|
|
- '6db26f509747bd144dfa9436784bf4abbcaa6abcf1ecc09cea3b921d46738c',
|
|
- 'hex'),
|
|
- 'SHA3-512': Buffer.from(
|
|
- '0f01c2083b5dd7fccb2784563f88cd9a815d570a1690695e426643ab725780760d' +
|
|
- 'e972e26e18d67f5557be89f17b4cd0065ce2937de299bdb2e972ebf7635084',
|
|
- 'hex')
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'SHA3-256': Buffer.from(
|
|
+ 'f6a48eb5557f484ed0c3e4b5c78a3cf497cbd346db06a4165d429248aa2cc51a69' +
|
|
+ '747d09f57af145469a8b607a9b8b9709629d74e8f5ca337c6ddc581b6f6103',
|
|
+ 'hex'),
|
|
+ 'SHA3-384': Buffer.from(
|
|
+ '777785978eb59da32888554dc7fd62d1ba1a3033cddaa8c36b8f3dcea8f85e1c8e' +
|
|
+ '6db26f509747bd144dfa9436784bf4abbcaa6abcf1ecc09cea3b921d46738c',
|
|
+ 'hex'),
|
|
+ 'SHA3-512': Buffer.from(
|
|
+ '0f01c2083b5dd7fccb2784563f88cd9a815d570a1690695e426643ab725780760d' +
|
|
+ 'e972e26e18d67f5557be89f17b4cd0065ce2937de299bdb2e972ebf7635084',
|
|
+ 'hex')
|
|
+ } : {})
|
|
},
|
|
'P-384': {
|
|
'SHA-1': Buffer.from(
|
|
@@ -102,18 +104,20 @@ module.exports = function() {
|
|
'72fbdb369fd34c1c54264d07f4facd69b02e4206f8a8bb259b882a305c56fde2d3' +
|
|
'5107e493c53cd6b4af0b31306f4d03fd43cfc762a1030e17a3d775453a1212b142' +
|
|
'9f7b3d93066a5f42a10b138cd177dc09616e827d598822d78d4627b754e6', 'hex'),
|
|
- 'SHA3-256': Buffer.from(
|
|
- '0b07c078be30fa5925a307d6fc559c5f398e63fb5d007d6b24a834847f2d3d18d5' +
|
|
- 'b5e840711c52a7bc6626c3ced93301e873c013a706f6b297c12cc6d47a71e0529e' +
|
|
- '719f43957de9995621d3cb0217469adaa6fd3135470771d0aa9d05d7a9c6', 'hex'),
|
|
- 'SHA3-384': Buffer.from(
|
|
- '2f36e8b04af46f68ef900c2720e3518b06f5440865d44072bbad5d62288c575042' +
|
|
- 'b183a372acd70328c738668dcecb9866801462d62df3c35450fdc6c95433103fcd' +
|
|
- 'c77999b640e3f92bd4e9be6e27ab129d1bc4f0b2a4c829388666920892d3', 'hex'),
|
|
- 'SHA3-512': Buffer.from(
|
|
- '32a951e886c33ac57a008efe9643bc92aa3ece9521d115e0c7240caecf124d1f7c' +
|
|
- 'dcba7fabb9ad5202e04f7aa591ab01ed3f060f04f493e4f24430fe8159200612f0' +
|
|
- '2849108b8be6edc8494c328097ad9265928efe5cb9d91be2f013ee17ee4e', 'hex')
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'SHA3-256': Buffer.from(
|
|
+ '0b07c078be30fa5925a307d6fc559c5f398e63fb5d007d6b24a834847f2d3d18d5' +
|
|
+ 'b5e840711c52a7bc6626c3ced93301e873c013a706f6b297c12cc6d47a71e0529e' +
|
|
+ '719f43957de9995621d3cb0217469adaa6fd3135470771d0aa9d05d7a9c6', 'hex'),
|
|
+ 'SHA3-384': Buffer.from(
|
|
+ '2f36e8b04af46f68ef900c2720e3518b06f5440865d44072bbad5d62288c575042' +
|
|
+ 'b183a372acd70328c738668dcecb9866801462d62df3c35450fdc6c95433103fcd' +
|
|
+ 'c77999b640e3f92bd4e9be6e27ab129d1bc4f0b2a4c829388666920892d3', 'hex'),
|
|
+ 'SHA3-512': Buffer.from(
|
|
+ '32a951e886c33ac57a008efe9643bc92aa3ece9521d115e0c7240caecf124d1f7c' +
|
|
+ 'dcba7fabb9ad5202e04f7aa591ab01ed3f060f04f493e4f24430fe8159200612f0' +
|
|
+ '2849108b8be6edc8494c328097ad9265928efe5cb9d91be2f013ee17ee4e', 'hex')
|
|
+ } : {})
|
|
},
|
|
'P-521': {
|
|
'SHA-1': Buffer.from(
|
|
@@ -140,29 +144,35 @@ module.exports = function() {
|
|
'01f0071e6a32867fa70f695cd39c4e87e142b9e4134d38740bd6fee354a575167e' +
|
|
'13524e94832637910fe11e53a85fb21b91adb81bb1779c4e2b8bc87c717dc35084',
|
|
'hex'),
|
|
- 'SHA3-256': Buffer.from(
|
|
- '00463679f47a4c705e03447360dcf34d1743e0d4b2591cc66832a6bc80d92e538c' +
|
|
- '169a1fd330f98e7235ca7fec7e16ac44fb13095b8edf2c76b75c4845177d59e425' +
|
|
- '0127c4359f6a4c9ccb63e7a9ff8122c0b4a8b7408e28c96817ecc3baf8c559c413' +
|
|
- 'c3bb580447dec9f52139b2afde369cd51730f050bc94137556ae137f0509464219',
|
|
- 'hex'),
|
|
- 'SHA3-384': Buffer.from(
|
|
- '01969a4db0888bc067a68a31fe5d0fc97e0b701f570565f7b25cb27707c6f020ff' +
|
|
- '680f8553ec5c2d6885e9e91b39262ed1bde375525eb13fdf12089b7939c7689735' +
|
|
- '0101c8b8d1129a217e8e956bef78cf7b9a0458523b04ac8e0b84ce73d54326f7a8' +
|
|
- '704ee42fe183f3ef79d83e676f34dc5476e2342641a5b973d3d94e8503676fbbc5',
|
|
- 'hex'),
|
|
- 'SHA3-512': Buffer.from(
|
|
- '000f362e914ee0136663cf57bf4085c25604af6dc198b4818751e1195ee7e41a16' +
|
|
- '91be909dcbc2bae00b8917f6bb918eae3740ac1b76e0913137c2da1171d6400b55' +
|
|
- '01ec6e1dc5987a27fe16fc2ce5c8e954088f898a9bbefb176eaa8bbd9ccc264c4c' +
|
|
- 'cc38c83ac8b5a168f90228daf8405a2b9bf7829c263a646b4e1098e2ace38deec7',
|
|
- 'hex')
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'SHA3-256': Buffer.from(
|
|
+ '00463679f47a4c705e03447360dcf34d1743e0d4b2591cc66832a6bc80d92e538c' +
|
|
+ '169a1fd330f98e7235ca7fec7e16ac44fb13095b8edf2c76b75c4845177d59e425' +
|
|
+ '0127c4359f6a4c9ccb63e7a9ff8122c0b4a8b7408e28c96817ecc3baf8c559c413' +
|
|
+ 'c3bb580447dec9f52139b2afde369cd51730f050bc94137556ae137f0509464219',
|
|
+ 'hex'),
|
|
+ 'SHA3-384': Buffer.from(
|
|
+ '01969a4db0888bc067a68a31fe5d0fc97e0b701f570565f7b25cb27707c6f020ff' +
|
|
+ '680f8553ec5c2d6885e9e91b39262ed1bde375525eb13fdf12089b7939c7689735' +
|
|
+ '0101c8b8d1129a217e8e956bef78cf7b9a0458523b04ac8e0b84ce73d54326f7a8' +
|
|
+ '704ee42fe183f3ef79d83e676f34dc5476e2342641a5b973d3d94e8503676fbbc5',
|
|
+ 'hex'),
|
|
+ 'SHA3-512': Buffer.from(
|
|
+ '000f362e914ee0136663cf57bf4085c25604af6dc198b4818751e1195ee7e41a16' +
|
|
+ '91be909dcbc2bae00b8917f6bb918eae3740ac1b76e0913137c2da1171d6400b55' +
|
|
+ '01ec6e1dc5987a27fe16fc2ce5c8e954088f898a9bbefb176eaa8bbd9ccc264c4c' +
|
|
+ 'cc38c83ac8b5a168f90228daf8405a2b9bf7829c263a646b4e1098e2ace38deec7',
|
|
+ 'hex')
|
|
+ } : {})
|
|
}
|
|
}
|
|
|
|
const curves = ['P-256', 'P-384', 'P-521'];
|
|
- const hashes = ['SHA-1', 'SHA-256', 'SHA-384', 'SHA-512', 'SHA3-256', 'SHA3-384', 'SHA3-512'];
|
|
+ const hashes = ['SHA-1', 'SHA-256', 'SHA-384', 'SHA-512'];
|
|
+
|
|
+ if (!process.features.openssl_is_boringssl) {
|
|
+ hashes.push('SHA3-256', 'SHA3-384', 'SHA3-512');
|
|
+ }
|
|
|
|
const vectors = [];
|
|
curves.forEach((namedCurve) => {
|
|
diff --git a/test/fixtures/crypto/hmac.js b/test/fixtures/crypto/hmac.js
|
|
index 6505c6e2ae55b55b2474f1b9c53f2da1e66c852e..acdf3229a4bc7cfc45c664718e7396f71025624a 100644
|
|
--- a/test/fixtures/crypto/hmac.js
|
|
+++ b/test/fixtures/crypto/hmac.js
|
|
@@ -22,16 +22,18 @@ module.exports = function () {
|
|
'5dcc359443aaf652fa1375d6b3e61fdcf29bb4a28bd5d3dcfa40f82f906bb280' +
|
|
'0455db03b5d31fb972a15a6d0103a24e56d156a119c0e5a1e92a44c3c5657cf9',
|
|
'hex'),
|
|
- 'SHA3-256': Buffer.from(
|
|
- 'e588ec0811463d767241df1074b47ae4071b51f2ce36537ba69ccdc3fdc2b7a8',
|
|
- 'hex'),
|
|
- 'SHA3-384': Buffer.from(
|
|
- '6b1da28eab1f582ad9718effe05e23d5fd2c9877a2d9443f90bec093bece2ea7' +
|
|
- 'd2354cd0bdc5e147d2e9009373494488', 'hex'),
|
|
- 'SHA3-512': Buffer.from(
|
|
- '5dcc359443aaf652fa1375d6b3e61fdcf29bb4a28bd5d3dcfa40f82f906bb280' +
|
|
- '0455db03b5d31fb972a15a6d0103a24e56d156a119c0e5a1e92a44c3c5657cf9',
|
|
- 'hex')
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'SHA3-256': Buffer.from(
|
|
+ 'e588ec0811463d767241df1074b47ae4071b51f2ce36537ba69ccdc3fdc2b7a8',
|
|
+ 'hex'),
|
|
+ 'SHA3-384': Buffer.from(
|
|
+ '6b1da28eab1f582ad9718effe05e23d5fd2c9877a2d9443f90bec093bece2ea7' +
|
|
+ 'd2354cd0bdc5e147d2e9009373494488', 'hex'),
|
|
+ 'SHA3-512': Buffer.from(
|
|
+ '5dcc359443aaf652fa1375d6b3e61fdcf29bb4a28bd5d3dcfa40f82f906bb280' +
|
|
+ '0455db03b5d31fb972a15a6d0103a24e56d156a119c0e5a1e92a44c3c5657cf9',
|
|
+ 'hex')
|
|
+ } : {})
|
|
}
|
|
|
|
const signatures = {
|
|
@@ -46,16 +48,18 @@ module.exports = function () {
|
|
'61fb278c3ffb0cce2bf1cf723ddfd8ef1f931c0c618c25907324605939e3f9a2' +
|
|
'c6f4af690bda3407dc2f5770f6a0a44b954d64a332e3ee0821abf82b7f3e99c1',
|
|
'hex'),
|
|
- 'SHA3-256': Buffer.from(
|
|
- 'c1ac5e11fcd50c48bf567f6e296632f5801c4eb07a8a47579b41dee971a3099b',
|
|
- 'hex'),
|
|
- 'SHA3-384': Buffer.from(
|
|
- 'ac8c97f6dd8d9e16101063077c16b23fe291a5e6d149653e9ac7002365159317' +
|
|
- 'adcfad511996578b0053a5c14b75f16c', 'hex'),
|
|
- 'SHA3-512': Buffer.from(
|
|
- '2162c2a8907e6b2f68599a69e81a464d8f076b5eeb555d98b4d20330034df3c7' +
|
|
- 'cf35b1fa958a074ca12f0d242df39f0da3d4f1dbfb3629057798fe1f883974ee',
|
|
- 'hex')
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'SHA3-256': Buffer.from(
|
|
+ 'c1ac5e11fcd50c48bf567f6e296632f5801c4eb07a8a47579b41dee971a3099b',
|
|
+ 'hex'),
|
|
+ 'SHA3-384': Buffer.from(
|
|
+ 'ac8c97f6dd8d9e16101063077c16b23fe291a5e6d149653e9ac7002365159317' +
|
|
+ 'adcfad511996578b0053a5c14b75f16c', 'hex'),
|
|
+ 'SHA3-512': Buffer.from(
|
|
+ '2162c2a8907e6b2f68599a69e81a464d8f076b5eeb555d98b4d20330034df3c7' +
|
|
+ 'cf35b1fa958a074ca12f0d242df39f0da3d4f1dbfb3629057798fe1f883974ee',
|
|
+ 'hex')
|
|
+ } : {})
|
|
}
|
|
|
|
const vectors = [];
|
|
diff --git a/test/fixtures/crypto/rsa_pkcs.js b/test/fixtures/crypto/rsa_pkcs.js
|
|
index 4630e4af9135800ad0fc604f99ac578d36984ca2..d54c44b6d820d83f997cc5e1b94fe5b5f151c013 100644
|
|
--- a/test/fixtures/crypto/rsa_pkcs.js
|
|
+++ b/test/fixtures/crypto/rsa_pkcs.js
|
|
@@ -97,33 +97,35 @@ module.exports = function () {
|
|
'7a6335c70e193235dcda48add6858626bd96311e60f7e5ea4491b6c1e6248afe12b' +
|
|
'bbd54f8869b043a5b0444562813f0a98b300356f306e6b783a29f3bec97ca40ea20' +
|
|
'062cab8926ec5d96aa387cc84821a6d72b8ea126e7d', 'hex'),
|
|
- 'sha3-256': Buffer.from(
|
|
- 'be1b476c1911a01d71710fd8a2f3158d6f7839e91443b01bed30dfdd04336d80c6b' +
|
|
- 'f692c06fad254877901c10a73853e8fb202a29cddefdf16c3adcda1fc123625897d' +
|
|
- '1b81b32a9dec38957e023be221d8f31e7470ad32e761edce9170eefa37ec19bd0c3' +
|
|
- 'e0b0ad2a244e98f54a08f873efb63c6fad14d7322b50eb05b6bae767305da92a90a' +
|
|
- '53cdae52b0d81e158a00003ec626e50423b7377a34a7b28cc7483b55bfde05bd431' +
|
|
- 'cfa436c38c285531e0d476ee13f151c8ae832ffd51ba00f2ab06f1844e73c0fe0f6' +
|
|
- 'ce17d966b1e07727af4161368aa0a74a594a6fdb782b46a9ae6098799c366fc0d71' +
|
|
- '1b2d965cf5eeeed9175b39b1d0bcefdd7df376e8ac9', 'hex'),
|
|
- 'sha3-384': Buffer.from(
|
|
- '002eaf5837443f1a33dc03729a308c503888d7a8cc013be424a91bce18105f7334a' +
|
|
- '499a5eddc5f4fab2fdf80f52988d53bf8bd5e78c3ce1a43abaf3b8146c260b6ce8b' +
|
|
- 'ffc9857f4b35c190cea85921c46d3ab573113744472d1afb637a0e9ab5021bcb355' +
|
|
- '7f5b52faf89fa864a7d3bf5799096c54ee53fa139e1bc13842a2a5bf0f1d85f041d' +
|
|
- 'a4e0e87425b421f22f0240ad62ef77ba6f090e0d48e17c07fd1e477c7e16a3196f5' +
|
|
- '0142d0f0c5e525a10325569e5a1f50cb4577e782a643972857cc918ae5409587d9e' +
|
|
- '44e1c1e89540e87deed7dda5005ac63ba609f522fdd92c81d95c1ffa383558a10f3' +
|
|
- '064f59ca0534bfad31acbf3e2807cb7d3147c59ee4d', 'hex'),
|
|
- 'sha3-512': Buffer.from(
|
|
- '561585b621c916453762285c8bb6ede3f303074ad6f2826ca15b3900e49c4d94c07' +
|
|
- 'aab0b875eaa79049ba2ed97e9a87c44fff9bffe638a1bf8c4db69c627b6adbe8fca' +
|
|
- '2b38cb8b4c2810a16286bef498327b9db4b53043ed5012c7c58f037edf669baf772' +
|
|
- '9b58e413e133ebb90a5fcb6dc3936f4f87971c0e85f362189b4279bbb2d9293a427' +
|
|
- '5653068c1bc8772cebc4733a5d1df0b454d4f628c645c22bb1c8cc601fbc92dc091' +
|
|
- 'db38fad4a36289ae9ed424c46643a8161a102ae511877d25f2eab7342dff6b92bf3' +
|
|
- '65951e76ee84c2bd84a595f63d7cc04d00e1589870956491e518b3ba245efc37a28' +
|
|
- 'ec018d8788a92ab93a90bb314f9ab0788a0b5b50489', 'hex')
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'sha3-256': Buffer.from(
|
|
+ 'be1b476c1911a01d71710fd8a2f3158d6f7839e91443b01bed30dfdd04336d80c6b' +
|
|
+ 'f692c06fad254877901c10a73853e8fb202a29cddefdf16c3adcda1fc123625897d' +
|
|
+ '1b81b32a9dec38957e023be221d8f31e7470ad32e761edce9170eefa37ec19bd0c3' +
|
|
+ 'e0b0ad2a244e98f54a08f873efb63c6fad14d7322b50eb05b6bae767305da92a90a' +
|
|
+ '53cdae52b0d81e158a00003ec626e50423b7377a34a7b28cc7483b55bfde05bd431' +
|
|
+ 'cfa436c38c285531e0d476ee13f151c8ae832ffd51ba00f2ab06f1844e73c0fe0f6' +
|
|
+ 'ce17d966b1e07727af4161368aa0a74a594a6fdb782b46a9ae6098799c366fc0d71' +
|
|
+ '1b2d965cf5eeeed9175b39b1d0bcefdd7df376e8ac9', 'hex'),
|
|
+ 'sha3-384': Buffer.from(
|
|
+ '002eaf5837443f1a33dc03729a308c503888d7a8cc013be424a91bce18105f7334a' +
|
|
+ '499a5eddc5f4fab2fdf80f52988d53bf8bd5e78c3ce1a43abaf3b8146c260b6ce8b' +
|
|
+ 'ffc9857f4b35c190cea85921c46d3ab573113744472d1afb637a0e9ab5021bcb355' +
|
|
+ '7f5b52faf89fa864a7d3bf5799096c54ee53fa139e1bc13842a2a5bf0f1d85f041d' +
|
|
+ 'a4e0e87425b421f22f0240ad62ef77ba6f090e0d48e17c07fd1e477c7e16a3196f5' +
|
|
+ '0142d0f0c5e525a10325569e5a1f50cb4577e782a643972857cc918ae5409587d9e' +
|
|
+ '44e1c1e89540e87deed7dda5005ac63ba609f522fdd92c81d95c1ffa383558a10f3' +
|
|
+ '064f59ca0534bfad31acbf3e2807cb7d3147c59ee4d', 'hex'),
|
|
+ 'sha3-512': Buffer.from(
|
|
+ '561585b621c916453762285c8bb6ede3f303074ad6f2826ca15b3900e49c4d94c07' +
|
|
+ 'aab0b875eaa79049ba2ed97e9a87c44fff9bffe638a1bf8c4db69c627b6adbe8fca' +
|
|
+ '2b38cb8b4c2810a16286bef498327b9db4b53043ed5012c7c58f037edf669baf772' +
|
|
+ '9b58e413e133ebb90a5fcb6dc3936f4f87971c0e85f362189b4279bbb2d9293a427' +
|
|
+ '5653068c1bc8772cebc4733a5d1df0b454d4f628c645c22bb1c8cc601fbc92dc091' +
|
|
+ 'db38fad4a36289ae9ed424c46643a8161a102ae511877d25f2eab7342dff6b92bf3' +
|
|
+ '65951e76ee84c2bd84a595f63d7cc04d00e1589870956491e518b3ba245efc37a28' +
|
|
+ 'ec018d8788a92ab93a90bb314f9ab0788a0b5b50489', 'hex')
|
|
+ } : {})
|
|
}
|
|
|
|
const vectors = [
|
|
@@ -159,30 +161,32 @@ module.exports = function () {
|
|
plaintext,
|
|
signature: signatures['sha-512']
|
|
},
|
|
- {
|
|
- publicKeyBuffer: spki,
|
|
- privateKeyBuffer: pkcs8,
|
|
- algorithm: { name: 'RSASSA-PKCS1-v1_5' },
|
|
- hash: 'SHA3-256',
|
|
- plaintext,
|
|
- signature: signatures['sha3-256']
|
|
- },
|
|
- {
|
|
- publicKeyBuffer: spki,
|
|
- privateKeyBuffer: pkcs8,
|
|
- algorithm: { name: 'RSASSA-PKCS1-v1_5' },
|
|
- hash: 'SHA3-384',
|
|
- plaintext,
|
|
- signature: signatures['sha3-384']
|
|
- },
|
|
- {
|
|
- publicKeyBuffer: spki,
|
|
- privateKeyBuffer: pkcs8,
|
|
- algorithm: { name: 'RSASSA-PKCS1-v1_5' },
|
|
- hash: 'SHA3-512',
|
|
- plaintext,
|
|
- signature: signatures['sha3-512']
|
|
- },
|
|
+ ...(!process.features.openssl_is_boringssl ? [
|
|
+ {
|
|
+ publicKeyBuffer: spki,
|
|
+ privateKeyBuffer: pkcs8,
|
|
+ algorithm: { name: 'RSASSA-PKCS1-v1_5' },
|
|
+ hash: 'SHA3-256',
|
|
+ plaintext,
|
|
+ signature: signatures['sha3-256']
|
|
+ },
|
|
+ {
|
|
+ publicKeyBuffer: spki,
|
|
+ privateKeyBuffer: pkcs8,
|
|
+ algorithm: { name: 'RSASSA-PKCS1-v1_5' },
|
|
+ hash: 'SHA3-384',
|
|
+ plaintext,
|
|
+ signature: signatures['sha3-384']
|
|
+ },
|
|
+ {
|
|
+ publicKeyBuffer: spki,
|
|
+ privateKeyBuffer: pkcs8,
|
|
+ algorithm: { name: 'RSASSA-PKCS1-v1_5' },
|
|
+ hash: 'SHA3-512',
|
|
+ plaintext,
|
|
+ signature: signatures['sha3-512']
|
|
+ },
|
|
+ ] : []),
|
|
];
|
|
|
|
return vectors;
|
|
diff --git a/test/fixtures/crypto/rsa_pss.js b/test/fixtures/crypto/rsa_pss.js
|
|
index 101122b2ffe31c8dc903ff8852212d9f55c0badd..fa0bcceb5697486930a9530732f9a9ab6e1bb5b0 100644
|
|
--- a/test/fixtures/crypto/rsa_pss.js
|
|
+++ b/test/fixtures/crypto/rsa_pss.js
|
|
@@ -1,6 +1,6 @@
|
|
'use strict';
|
|
|
|
-module.exports = function() {
|
|
+module.exports = function () {
|
|
const pkcs8 = Buffer.from(
|
|
'308204bf020100300d06092a864886f70d0101010500048204a9308204a5020100028' +
|
|
'2010100d3576092e62957364544e7e4233b7bdb293db2085122c479328546f9f0f712' +
|
|
@@ -150,42 +150,44 @@ module.exports = function() {
|
|
'b68c04bfe452c3adc6c10066a915231b7b404727eb6201b4921eb96d9407de2b963' +
|
|
'3879ceb71d759d9828d7b4d062f6ef100757d8328187caf57dfb859d1555345207c' +
|
|
'1cce7905c3564c08fec78867a53d5a2cf84810e1ffa', 'hex'),
|
|
- 'sha3-512, no salt': Buffer.from(
|
|
- 'd2430dc87abeaa7d13f7cec8510f1a296e1c608f44b1696829c59a99e8eefe9b2ee' +
|
|
- '6ee8ad6fdc93c24fcba2f04d1da195924b6209717e1992c10ed9f4783478765fe34' +
|
|
- '3e761203bff9d326bb6dc2061b0a7554c8ce0814b29249136c20c8e30054df0c6bc' +
|
|
- '656509a82845149368896690e32ff5dd32ef01543686f01d6a69bb438b049e66a8b' +
|
|
- 'df485a13edcd7dc482da4cc57d0b740aca3e56f0da247794e600afd27b22b6da13b' +
|
|
- 'cc15dd2059b525f8cb6bcd07540aa843f0ae51d4b0eea27045485914b908bdd01d0' +
|
|
- 'a9d42379f9f7180f4ad162ff73df5fed0200eb02ad01473975d54a77c15a9c61a3c' +
|
|
- 'b5e27de5d1eecc363d45506f7123a5ddd115c5e4c9e', 'hex'),
|
|
- 'sha3-256, salted': Buffer.from(
|
|
- '59cb9cce6ae838eb20d38d6af4acb9b866b0753bb7df9e441037d788512c03279e8' +
|
|
- '3d9a9cf5c0921fe1c0b6e8e895a8c0ad24a18b123f809b34ef2a3a1f05974030320' +
|
|
- '435692ef5d378cef4368c3658c098a25371dfaf1c0b6910f653a4ec15f2c08956c1' +
|
|
- '405136c2aba7f25a808fa7dbf57a4cb2978bd91af710b27ee239d955c8cac7a76ae' +
|
|
- '9085cefeda2a585a99cc948f064b5da66a9c4aa4f3f767ac905a9f314b47038e05c' +
|
|
- '3608fbb7e67a278e4f009a62c3cd3fdf43692e759d9361be1217999a76a69d4d119' +
|
|
- 'f8791a90e207e46b3f6125721f56fd819292d06a3cdae2c62c9a1dc0d964a06036c' +
|
|
- '8c18661cc6c873532a3536ab51e1ce210926db299e2', 'hex'),
|
|
- 'sha3-384, salted': Buffer.from(
|
|
- '8d1f9297c8169f27f0c58827dba991d862de58c1155f612ad2995d2bf862d051c4a' +
|
|
- '91b48571849b0412384382e5b77990de6a3c84010046b35c4a504f175a3479483d9' +
|
|
- '5c58f86bb96d53a27e59d6f67fddaae295ce90610f5086acc711557c2c85aac32d3' +
|
|
- '24199cff2367ae44e1d91307a98c8cbfb085a8bce6b1c20714711bc15b0eddb7881' +
|
|
- '823227d4be477ffdad8093663a6a1fc62eb39c49c2c3a821c2b202cf7904b49ca92' +
|
|
- '3c83819602bb13931577354a80f99309030044935b1cd41f0513160e661db1959fb' +
|
|
- '1ec15f087f3d288e875d54cbf070ec860b0aeecc951ea65e97cd5460750d4b7de52' +
|
|
- '22cb9e7466b1f506ecf6a81fc399dfd8334160f9084', 'hex'),
|
|
- 'sha3-512, salted': Buffer.from(
|
|
- '7b6d7be418c5d37cc8070698b8b03d818ecd8b673d047d34921913f6d59c69cb496' +
|
|
- '172d6118207d9ff92b8e1246acf0e03a845d935a70f8a82c3d5d6db6a1a0e337269' +
|
|
- '4b904372413dcbaa7ac5486bc8ccaf70d7e9470be82b928a90017e272cf9761ed26' +
|
|
- 'c160fe874a2675a4fb2acad72c50fbfffdd70b5a6f2919553d7ea1829934670f8de' +
|
|
- 'f2a5c2816404b1aa153323c92c58400622f184b9b0463fa48d6b27091f68c287e3f' +
|
|
- '6d9ab9eb451711a5d984c547f3d56f14a686a89ddf36c47ce25092b8c6530904de9' +
|
|
- '5df7fc602fe9394315f1b1847aae304cb5ad71e2cb78acfbc997a87a9d62a6898bb' +
|
|
- '6d84a81bb89b50186265f4be171a93d837a4bf777c8', 'hex')
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'sha3-512, no salt': Buffer.from(
|
|
+ 'd2430dc87abeaa7d13f7cec8510f1a296e1c608f44b1696829c59a99e8eefe9b2ee' +
|
|
+ '6ee8ad6fdc93c24fcba2f04d1da195924b6209717e1992c10ed9f4783478765fe34' +
|
|
+ '3e761203bff9d326bb6dc2061b0a7554c8ce0814b29249136c20c8e30054df0c6bc' +
|
|
+ '656509a82845149368896690e32ff5dd32ef01543686f01d6a69bb438b049e66a8b' +
|
|
+ 'df485a13edcd7dc482da4cc57d0b740aca3e56f0da247794e600afd27b22b6da13b' +
|
|
+ 'cc15dd2059b525f8cb6bcd07540aa843f0ae51d4b0eea27045485914b908bdd01d0' +
|
|
+ 'a9d42379f9f7180f4ad162ff73df5fed0200eb02ad01473975d54a77c15a9c61a3c' +
|
|
+ 'b5e27de5d1eecc363d45506f7123a5ddd115c5e4c9e', 'hex'),
|
|
+ 'sha3-256, salted': Buffer.from(
|
|
+ '59cb9cce6ae838eb20d38d6af4acb9b866b0753bb7df9e441037d788512c03279e8' +
|
|
+ '3d9a9cf5c0921fe1c0b6e8e895a8c0ad24a18b123f809b34ef2a3a1f05974030320' +
|
|
+ '435692ef5d378cef4368c3658c098a25371dfaf1c0b6910f653a4ec15f2c08956c1' +
|
|
+ '405136c2aba7f25a808fa7dbf57a4cb2978bd91af710b27ee239d955c8cac7a76ae' +
|
|
+ '9085cefeda2a585a99cc948f064b5da66a9c4aa4f3f767ac905a9f314b47038e05c' +
|
|
+ '3608fbb7e67a278e4f009a62c3cd3fdf43692e759d9361be1217999a76a69d4d119' +
|
|
+ 'f8791a90e207e46b3f6125721f56fd819292d06a3cdae2c62c9a1dc0d964a06036c' +
|
|
+ '8c18661cc6c873532a3536ab51e1ce210926db299e2', 'hex'),
|
|
+ 'sha3-384, salted': Buffer.from(
|
|
+ '8d1f9297c8169f27f0c58827dba991d862de58c1155f612ad2995d2bf862d051c4a' +
|
|
+ '91b48571849b0412384382e5b77990de6a3c84010046b35c4a504f175a3479483d9' +
|
|
+ '5c58f86bb96d53a27e59d6f67fddaae295ce90610f5086acc711557c2c85aac32d3' +
|
|
+ '24199cff2367ae44e1d91307a98c8cbfb085a8bce6b1c20714711bc15b0eddb7881' +
|
|
+ '823227d4be477ffdad8093663a6a1fc62eb39c49c2c3a821c2b202cf7904b49ca92' +
|
|
+ '3c83819602bb13931577354a80f99309030044935b1cd41f0513160e661db1959fb' +
|
|
+ '1ec15f087f3d288e875d54cbf070ec860b0aeecc951ea65e97cd5460750d4b7de52' +
|
|
+ '22cb9e7466b1f506ecf6a81fc399dfd8334160f9084', 'hex'),
|
|
+ 'sha3-512, salted': Buffer.from(
|
|
+ '7b6d7be418c5d37cc8070698b8b03d818ecd8b673d047d34921913f6d59c69cb496' +
|
|
+ '172d6118207d9ff92b8e1246acf0e03a845d935a70f8a82c3d5d6db6a1a0e337269' +
|
|
+ '4b904372413dcbaa7ac5486bc8ccaf70d7e9470be82b928a90017e272cf9761ed26' +
|
|
+ 'c160fe874a2675a4fb2acad72c50fbfffdd70b5a6f2919553d7ea1829934670f8de' +
|
|
+ 'f2a5c2816404b1aa153323c92c58400622f184b9b0463fa48d6b27091f68c287e3f' +
|
|
+ '6d9ab9eb451711a5d984c547f3d56f14a686a89ddf36c47ce25092b8c6530904de9' +
|
|
+ '5df7fc602fe9394315f1b1847aae304cb5ad71e2cb78acfbc997a87a9d62a6898bb' +
|
|
+ '6d84a81bb89b50186265f4be171a93d837a4bf777c8', 'hex')
|
|
+ } : {})
|
|
}
|
|
|
|
const vectors = [
|
|
@@ -253,54 +255,56 @@ module.exports = function() {
|
|
plaintext,
|
|
signature: signatures['sha-512, salted']
|
|
},
|
|
- {
|
|
- publicKeyBuffer: spki,
|
|
- privateKeyBuffer: pkcs8,
|
|
- algorithm: { name: 'RSA-PSS', saltLength: 0 },
|
|
- hash: 'SHA3-256',
|
|
- plaintext,
|
|
- signature: signatures['sha3-256, no salt']
|
|
- },
|
|
- {
|
|
- publicKeyBuffer: spki,
|
|
- privateKeyBuffer: pkcs8,
|
|
- algorithm: { name: 'RSA-PSS', saltLength: 0 },
|
|
- hash: 'SHA3-384',
|
|
- plaintext,
|
|
- signature: signatures['sha3-384, no salt']
|
|
- },
|
|
- {
|
|
- publicKeyBuffer: spki,
|
|
- privateKeyBuffer: pkcs8,
|
|
- algorithm: { name: 'RSA-PSS', saltLength: 0 },
|
|
- hash: 'SHA3-512',
|
|
- plaintext,
|
|
- signature: signatures['sha3-512, no salt']
|
|
- },
|
|
- {
|
|
- publicKeyBuffer: spki,
|
|
- privateKeyBuffer: pkcs8,
|
|
- algorithm: { name: 'RSA-PSS', saltLength: 32 },
|
|
- hash: 'SHA3-256',
|
|
- plaintext,
|
|
- signature: signatures['sha3-256, salted']
|
|
- },
|
|
- {
|
|
- publicKeyBuffer: spki,
|
|
- privateKeyBuffer: pkcs8,
|
|
- algorithm: { name: 'RSA-PSS', saltLength: 48 },
|
|
- hash: 'SHA3-384',
|
|
- plaintext,
|
|
- signature: signatures['sha3-384, salted']
|
|
- },
|
|
- {
|
|
- publicKeyBuffer: spki,
|
|
- privateKeyBuffer: pkcs8,
|
|
- algorithm: { name: 'RSA-PSS', saltLength: 64 },
|
|
- hash: 'SHA3-512',
|
|
- plaintext,
|
|
- signature: signatures['sha3-512, salted']
|
|
- }
|
|
+ ...(!process.features.openssl_is_boringssl ? [
|
|
+ {
|
|
+ publicKeyBuffer: spki,
|
|
+ privateKeyBuffer: pkcs8,
|
|
+ algorithm: { name: 'RSA-PSS', saltLength: 0 },
|
|
+ hash: 'SHA3-256',
|
|
+ plaintext,
|
|
+ signature: signatures['sha3-256, no salt']
|
|
+ },
|
|
+ {
|
|
+ publicKeyBuffer: spki,
|
|
+ privateKeyBuffer: pkcs8,
|
|
+ algorithm: { name: 'RSA-PSS', saltLength: 0 },
|
|
+ hash: 'SHA3-384',
|
|
+ plaintext,
|
|
+ signature: signatures['sha3-384, no salt']
|
|
+ },
|
|
+ {
|
|
+ publicKeyBuffer: spki,
|
|
+ privateKeyBuffer: pkcs8,
|
|
+ algorithm: { name: 'RSA-PSS', saltLength: 0 },
|
|
+ hash: 'SHA3-512',
|
|
+ plaintext,
|
|
+ signature: signatures['sha3-512, no salt']
|
|
+ },
|
|
+ {
|
|
+ publicKeyBuffer: spki,
|
|
+ privateKeyBuffer: pkcs8,
|
|
+ algorithm: { name: 'RSA-PSS', saltLength: 32 },
|
|
+ hash: 'SHA3-256',
|
|
+ plaintext,
|
|
+ signature: signatures['sha3-256, salted']
|
|
+ },
|
|
+ {
|
|
+ publicKeyBuffer: spki,
|
|
+ privateKeyBuffer: pkcs8,
|
|
+ algorithm: { name: 'RSA-PSS', saltLength: 48 },
|
|
+ hash: 'SHA3-384',
|
|
+ plaintext,
|
|
+ signature: signatures['sha3-384, salted']
|
|
+ },
|
|
+ {
|
|
+ publicKeyBuffer: spki,
|
|
+ privateKeyBuffer: pkcs8,
|
|
+ algorithm: { name: 'RSA-PSS', saltLength: 64 },
|
|
+ hash: 'SHA3-512',
|
|
+ plaintext,
|
|
+ signature: signatures['sha3-512, salted']
|
|
+ }
|
|
+ ] : []),
|
|
];
|
|
|
|
return vectors;
|
|
diff --git a/test/fixtures/webcrypto/supports-modern-algorithms.mjs b/test/fixtures/webcrypto/supports-modern-algorithms.mjs
|
|
index 337ed577b143062d41e378cc1f820945e76cea08..76d5e805cbc0e756aef0013373baec31bd320f44 100644
|
|
--- a/test/fixtures/webcrypto/supports-modern-algorithms.mjs
|
|
+++ b/test/fixtures/webcrypto/supports-modern-algorithms.mjs
|
|
@@ -9,6 +9,7 @@ const shake256 = crypto.getHashes().includes('shake256');
|
|
const chacha = crypto.getCiphers().includes('chacha20-poly1305');
|
|
const ocb = hasOpenSSL(3);
|
|
const kmac = hasOpenSSL(3);
|
|
+const boringSSL = process.features.openssl_is_boringssl;
|
|
|
|
const { subtle } = globalThis.crypto;
|
|
const X25519 = await subtle.generateKey('X25519', false, ['deriveBits', 'deriveKey']);
|
|
@@ -108,9 +109,9 @@ export const vectors = {
|
|
[true, 'RSA-PSS'],
|
|
[true, 'RSASSA-PKCS1-v1_5'],
|
|
[true, 'X25519'],
|
|
- [true, 'X448'],
|
|
+ [!boringSSL, 'X448'],
|
|
[true, 'Ed25519'],
|
|
- [true, 'Ed448'],
|
|
+ [!boringSSL, 'Ed448'],
|
|
[true, 'ECDH'],
|
|
[true, 'ECDSA'],
|
|
[pqc, 'ML-DSA-44'],
|
|
diff --git a/test/parallel/test-crypto-async-sign-verify.js b/test/parallel/test-crypto-async-sign-verify.js
|
|
index d385926e9943052bbe1793d4b1e39846e1a69562..dbf7b04afa77f132aaa466c9ee02c5ffad0296bc 100644
|
|
--- a/test/parallel/test-crypto-async-sign-verify.js
|
|
+++ b/test/parallel/test-crypto-async-sign-verify.js
|
|
@@ -89,6 +89,7 @@ test('rsa_public.pem', 'rsa_private.pem', 'sha256', false,
|
|
// ED25519
|
|
test('ed25519_public.pem', 'ed25519_private.pem', undefined, true);
|
|
// ED448
|
|
+if (!process.features.openssl_is_boringssl) {
|
|
test('ed448_public.pem', 'ed448_private.pem', undefined, true);
|
|
|
|
// ECDSA w/ der signature encoding
|
|
@@ -110,6 +111,7 @@ test('dsa_public.pem', 'dsa_private.pem', 'sha256',
|
|
// DSA w/ ieee-p1363 signature encoding
|
|
test('dsa_public.pem', 'dsa_private.pem', 'sha256', false,
|
|
{ dsaEncoding: 'ieee-p1363' });
|
|
+}
|
|
|
|
// Test Parallel Execution w/ KeyObject is threadsafe in openssl3
|
|
{
|
|
@@ -150,7 +152,10 @@ MCowBQYDK2VuAyEA6pwGRbadNQAI/tYN8+/p/0/hbsdHfOEGr1ADiLVk/Gc=
|
|
const data = crypto.randomBytes(32);
|
|
const signature = crypto.randomBytes(16);
|
|
|
|
- const expected = hasOpenSSL3 ? /operation not supported for this keytype/ : /no default digest/;
|
|
+ let expected = hasOpenSSL3 ? /operation not supported for this keytype/ : /no default digest/;
|
|
+ if (hasOpenSSL3 || process.features.openssl_is_boringssl) {
|
|
+ expected = /operation[\s_]not[\s_]supported[\s_]for[\s_]this[\s_]keytype/i;
|
|
+ }
|
|
|
|
crypto.verify(undefined, data, untrustedKey, signature, common.mustCall((err) => {
|
|
assert.ok(err);
|
|
@@ -164,6 +169,6 @@ MCowBQYDK2VuAyEA6pwGRbadNQAI/tYN8+/p/0/hbsdHfOEGr1ADiLVk/Gc=
|
|
});
|
|
crypto.sign('sha512', 'message', privateKey, common.mustCall((err) => {
|
|
assert.ok(err);
|
|
- assert.match(err.message, /digest too big for rsa key/);
|
|
+ assert.match(err.message, /digest[\s_]too[\s_]big[\s_]for[\s_]rsa[\s_]key/i);
|
|
}));
|
|
}
|
|
diff --git a/test/parallel/test-crypto-certificate.js b/test/parallel/test-crypto-certificate.js
|
|
index 4a5f1f149fe6c739f7f1d2ee17df6e61a942d621..b3287f428ce6b3fde11d449c601a57ff5e3843f9 100644
|
|
--- a/test/parallel/test-crypto-certificate.js
|
|
+++ b/test/parallel/test-crypto-certificate.js
|
|
@@ -40,8 +40,10 @@ function copyArrayBuffer(buf) {
|
|
}
|
|
|
|
function checkMethods(certificate) {
|
|
-
|
|
+ /* spkacValid has a md5 based signature which is not allowed in boringssl
|
|
+ https://boringssl.googlesource.com/boringssl/+/33d7e32ce40c04e8f1b99c05964956fda187819f
|
|
assert.strictEqual(certificate.verifySpkac(spkacValid), true);
|
|
+ */
|
|
assert.strictEqual(certificate.verifySpkac(spkacFail), false);
|
|
|
|
assert.strictEqual(
|
|
@@ -56,10 +58,12 @@ function checkMethods(certificate) {
|
|
);
|
|
assert.strictEqual(certificate.exportChallenge(spkacFail), '');
|
|
|
|
+ /* spkacValid has a md5 based signature which is not allowed in boringssl
|
|
const ab = copyArrayBuffer(spkacValid);
|
|
assert.strictEqual(certificate.verifySpkac(ab), true);
|
|
assert.strictEqual(certificate.verifySpkac(new Uint8Array(ab)), true);
|
|
assert.strictEqual(certificate.verifySpkac(new DataView(ab)), true);
|
|
+ */
|
|
}
|
|
|
|
{
|
|
diff --git a/test/parallel/test-crypto-cipheriv-decipheriv.js b/test/parallel/test-crypto-cipheriv-decipheriv.js
|
|
index 6742722f9e90914b4dc8c079426d10040d476f72..8801ddfe7023fd0f7d5657b86a9164d75765322e 100644
|
|
--- a/test/parallel/test-crypto-cipheriv-decipheriv.js
|
|
+++ b/test/parallel/test-crypto-cipheriv-decipheriv.js
|
|
@@ -62,6 +62,10 @@ function testCipher2(key, iv) {
|
|
|
|
|
|
function testCipher3(key, iv) {
|
|
+ if (!crypto.getCiphers().includes('id-aes128-wrap')) {
|
|
+ common.printSkipMessage(`unsupported id-aes128-wrap test`);
|
|
+ return;
|
|
+ }
|
|
// Test encryption and decryption with explicit key and iv.
|
|
// AES Key Wrap test vector comes from RFC3394
|
|
const plaintext = Buffer.from('00112233445566778899AABBCCDDEEFF', 'hex');
|
|
diff --git a/test/parallel/test-crypto-dh-curves.js b/test/parallel/test-crypto-dh-curves.js
|
|
index 81a469c226c261564dee1e0b06b6571b18a41f1f..58b66045dba4201b7ebedd78b129420ffc316051 100644
|
|
--- a/test/parallel/test-crypto-dh-curves.js
|
|
+++ b/test/parallel/test-crypto-dh-curves.js
|
|
@@ -16,7 +16,7 @@ const p = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74' +
|
|
crypto.createDiffieHellman(p, 'hex');
|
|
|
|
// Confirm DH_check() results are exposed for optional examination.
|
|
-const bad_dh = crypto.createDiffieHellman('02', 'hex');
|
|
+const bad_dh = crypto.createDiffieHellman('abcd', 'hex', 0);
|
|
assert.notStrictEqual(bad_dh.verifyError, 0);
|
|
|
|
const availableCurves = new Set(crypto.getCurves());
|
|
diff --git a/test/parallel/test-crypto-dh-errors.js b/test/parallel/test-crypto-dh-errors.js
|
|
index 0af4db0310750cea9350ecff7fc44404c6df6c83..b14b4bbf88b902b6de916b92e3d48335c01df911 100644
|
|
--- a/test/parallel/test-crypto-dh-errors.js
|
|
+++ b/test/parallel/test-crypto-dh-errors.js
|
|
@@ -27,7 +27,7 @@ assert.throws(() => crypto.createDiffieHellman('abcdef', 13.37), {
|
|
for (const bits of [-1, 0, 1]) {
|
|
if (hasOpenSSL3) {
|
|
assert.throws(() => crypto.createDiffieHellman(bits), {
|
|
- code: 'ERR_OSSL_DH_MODULUS_TOO_SMALL',
|
|
+ code: 'ERR_OSSL_BN_BITS_TOO_SMALL',
|
|
name: 'Error',
|
|
message: /modulus too small/,
|
|
});
|
|
@@ -35,7 +35,7 @@ for (const bits of [-1, 0, 1]) {
|
|
assert.throws(() => crypto.createDiffieHellman(bits), {
|
|
code: 'ERR_OSSL_BN_BITS_TOO_SMALL',
|
|
name: 'Error',
|
|
- message: /bits too small/,
|
|
+ message: /bits[\s_]too[\s_]small/i,
|
|
});
|
|
}
|
|
}
|
|
diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js
|
|
index d7ffbe5eca92734aa2380f482c7f9bfe7e2a36c7..b4e7002d862907d2af3b4f8e985700bd03300809 100644
|
|
--- a/test/parallel/test-crypto-dh.js
|
|
+++ b/test/parallel/test-crypto-dh.js
|
|
@@ -60,18 +60,17 @@ const {
|
|
let wrongBlockLength;
|
|
if (hasOpenSSL3) {
|
|
wrongBlockLength = {
|
|
- message: 'error:1C80006B:Provider routines::wrong final block length',
|
|
- code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH',
|
|
- library: 'Provider routines',
|
|
- reason: 'wrong final block length'
|
|
+ message: /wrong[\s_]final[\s_]block[\s_]length/i,
|
|
+ code: /ERR_OSSL_(EVP_)?WRONG_FINAL_BLOCK_LENGTH/,
|
|
+ library: /Provider routines|Cipher functions/,
|
|
+ reason: /wrong[\s_]final[\s_]block[\s_]length/i,
|
|
};
|
|
} else {
|
|
wrongBlockLength = {
|
|
- message: 'error:0606506D:digital envelope' +
|
|
- ' routines:EVP_DecryptFinal_ex:wrong final block length',
|
|
- code: 'ERR_OSSL_EVP_WRONG_FINAL_BLOCK_LENGTH',
|
|
- library: 'digital envelope routines',
|
|
- reason: 'wrong final block length'
|
|
+ message: /wrong[\s_]final[\s_]block[\s_]length/i,
|
|
+ code: /ERR_OSSL_(EVP_)?WRONG_FINAL_BLOCK_LENGTH/,
|
|
+ library: /digital envelope routines|Cipher functions/,
|
|
+ reason: /wrong[\s_]final[\s_]block[\s_]length/i,
|
|
};
|
|
}
|
|
|
|
@@ -98,17 +97,23 @@ const {
|
|
dh3.computeSecret('');
|
|
}, { message: hasOpenSSL3 && !hasOpenSSL3WithNewErrorMessage ?
|
|
'Unspecified validation error' :
|
|
- 'Supplied key is too small' });
|
|
+ 'Supplied key is invalid' });
|
|
}
|
|
}
|
|
|
|
// Through a fluke of history, g=0 defaults to DH_GENERATOR (2).
|
|
{
|
|
const g = 0;
|
|
- crypto.createDiffieHellman('abcdef', g);
|
|
+ assert.throws(() => crypto.createDiffieHellman('abcdef', g), {
|
|
+ code: /ERR_CRYPTO_OPERATION_FAILED/,
|
|
+ name: 'Error'
|
|
+ });
|
|
crypto.createDiffieHellman('abcdef', 'hex', g);
|
|
}
|
|
|
|
{
|
|
- crypto.createDiffieHellman('abcdef', Buffer.from([2])); // OK
|
|
+ assert.throws(() => crypto.createDiffieHellman('abcdef', Buffer.from([2])), {
|
|
+ code: /ERR_CRYPTO_OPERATION_FAILED/,
|
|
+ name: 'Error'
|
|
+ });
|
|
}
|
|
diff --git a/test/parallel/test-crypto-hash-stream-pipe.js b/test/parallel/test-crypto-hash-stream-pipe.js
|
|
index d22281abbd5c3cab3aaa3ac494301fa6b4a8a968..5f0c6a4aed2e868a1a1049212edf218791cd6868 100644
|
|
--- a/test/parallel/test-crypto-hash-stream-pipe.js
|
|
+++ b/test/parallel/test-crypto-hash-stream-pipe.js
|
|
@@ -30,11 +30,11 @@ const crypto = require('crypto');
|
|
|
|
const stream = require('stream');
|
|
const s = new stream.PassThrough();
|
|
-const h = crypto.createHash('sha3-512');
|
|
-const expect = '36a38a2a35e698974d4e5791a3f05b05' +
|
|
- '198235381e864f91a0e8cd6a26b677ec' +
|
|
- 'dcde8e2b069bd7355fabd68abd6fc801' +
|
|
- '19659f25e92f8efc961ee3a7c815c758';
|
|
+const h = crypto.createHash('sha512');
|
|
+const expect = 'fba055c6fd0c5b6645407749ed7a8b41' +
|
|
+ 'b8f629f2163c3ca3701d864adabda1f8' +
|
|
+ '93c37bf82b22fdd151ba8e357f611da4' +
|
|
+ '88a74b6a5525dd9b69554c6ce5138ad7';
|
|
|
|
s.pipe(h).on('data', common.mustCall(function(c) {
|
|
assert.strictEqual(c, expect);
|
|
diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js
|
|
index 929dd36c669239804f2cfc5168bd3bf6e15855e6..8ebe599bbd21ad30e5041e0eab1e5898caf33e49 100644
|
|
--- a/test/parallel/test-crypto-hash.js
|
|
+++ b/test/parallel/test-crypto-hash.js
|
|
@@ -182,7 +182,7 @@ assert.throws(
|
|
}
|
|
|
|
// Test XOF hash functions and the outputLength option.
|
|
-{
|
|
+if (!process.features.openssl_is_boringssl) {
|
|
// Default outputLengths.
|
|
assert.strictEqual(crypto.createHash('shake128').digest('hex'),
|
|
'7f9c2ba4e88f827d616045507605853e');
|
|
diff --git a/test/parallel/test-crypto-oneshot-hash-xof.js b/test/parallel/test-crypto-oneshot-hash-xof.js
|
|
index 75cb4800ff1bd51fedd7bc4e2d7e6af6f4f48346..b4363c31592763235116d970a5f45d4cf63de373 100644
|
|
--- a/test/parallel/test-crypto-oneshot-hash-xof.js
|
|
+++ b/test/parallel/test-crypto-oneshot-hash-xof.js
|
|
@@ -7,6 +7,10 @@ if (!common.hasCrypto) common.skip('missing crypto');
|
|
const assert = require('assert');
|
|
const crypto = require('crypto');
|
|
|
|
+if (process.features.openssl_is_boringssl) {
|
|
+ common.skip('BoringSSL does not support XOF hash functions');
|
|
+}
|
|
+
|
|
// Test XOF hash functions and the outputLength option.
|
|
{
|
|
// Default outputLengths.
|
|
diff --git a/test/parallel/test-crypto-padding.js b/test/parallel/test-crypto-padding.js
|
|
index 48cd1ed4df61aaddeee8785cb90f83bdd9628187..d09e01712c617597833bb1320a32a967bcf1d318 100644
|
|
--- a/test/parallel/test-crypto-padding.js
|
|
+++ b/test/parallel/test-crypto-padding.js
|
|
@@ -84,14 +84,13 @@ assert.throws(function() {
|
|
// Input must have block length %.
|
|
enc(ODD_LENGTH_PLAIN, false);
|
|
}, hasOpenSSL3 ? {
|
|
- message: 'error:1C80006B:Provider routines::wrong final block length',
|
|
- code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH',
|
|
- reason: 'wrong final block length',
|
|
+ message: /wrong[\s_]final[\s_]block[\s_]length/i,
|
|
+ code: /ERR_OSSL(_EVP)?_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH/,
|
|
+ message: /wrong[\s_]final[\s_]block[\s_]length/i,
|
|
} : {
|
|
- message: 'error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:' +
|
|
- 'data not multiple of block length',
|
|
- code: 'ERR_OSSL_EVP_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH',
|
|
- reason: 'data not multiple of block length',
|
|
+ message: /data[\s_]not[\s_]multiple[\s_]of[\s_]block[\s_]length/i,
|
|
+ code: /ERR_OSSL(_EVP)?_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH/,
|
|
+ reason: /data[\s_]not[\s_]multiple[\s_]of[\s_]block[\s_]length/i,
|
|
}
|
|
);
|
|
|
|
@@ -110,15 +109,10 @@ assert.strictEqual(dec(EVEN_LENGTH_ENCRYPTED, false).length, 48);
|
|
assert.throws(function() {
|
|
// Must have at least 1 byte of padding (PKCS):
|
|
assert.strictEqual(dec(EVEN_LENGTH_ENCRYPTED_NOPAD, true), EVEN_LENGTH_PLAIN);
|
|
-}, hasOpenSSL3 ? {
|
|
- message: 'error:1C800064:Provider routines::bad decrypt',
|
|
- reason: 'bad decrypt',
|
|
- code: 'ERR_OSSL_BAD_DECRYPT',
|
|
-} : {
|
|
- message: 'error:06065064:digital envelope routines:EVP_DecryptFinal_ex:' +
|
|
- 'bad decrypt',
|
|
- reason: 'bad decrypt',
|
|
- code: 'ERR_OSSL_EVP_BAD_DECRYPT',
|
|
+}, {
|
|
+ message: /bad[\s_]decrypt/i,
|
|
+ reason: /bad[\s_]decrypt/i,
|
|
+ code: /ERR_OSSL(_EVP)?_BAD_DECRYPT/,
|
|
});
|
|
|
|
// No-pad encrypted string should return the same:
|
|
diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js
|
|
index 119bc3c2d20ea7d681f0b579f9d91ad46cdc3634..8d13b105fa426015a873c411ad1d7f64b3d9580e 100644
|
|
--- a/test/parallel/test-crypto-rsa-dsa.js
|
|
+++ b/test/parallel/test-crypto-rsa-dsa.js
|
|
@@ -29,12 +29,11 @@ const dsaPkcs8KeyPem = fixtures.readKey('dsa_private_pkcs8.pem');
|
|
const ec = new TextEncoder();
|
|
|
|
const openssl1DecryptError = {
|
|
- message: 'error:06065064:digital envelope routines:EVP_DecryptFinal_ex:' +
|
|
- 'bad decrypt',
|
|
- code: 'ERR_OSSL_EVP_BAD_DECRYPT',
|
|
- reason: 'bad decrypt',
|
|
- function: 'EVP_DecryptFinal_ex',
|
|
- library: 'digital envelope routines',
|
|
+ message: /error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt|error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT/,
|
|
+ code: /ERR_OSSL(_EVP)?_BAD_DECRYPT/,
|
|
+ reason: /bad decrypt|BAD_DECRYPT/,
|
|
+ function: /EVP_DecryptFinal_ex|OPENSSL_internal/,
|
|
+ library: /digital envelope routines|Cipher functions/,
|
|
};
|
|
|
|
const decryptError = hasOpenSSL3 ?
|
|
@@ -223,7 +222,7 @@ function test_rsa(padding, encryptOaepHash, decryptOaepHash) {
|
|
}, bufferToEncrypt);
|
|
|
|
|
|
- if (padding === constants.RSA_PKCS1_PADDING) {
|
|
+ if (!process.features.openssl_is_boringssl) {
|
|
if (!process.config.variables.node_shared_openssl) {
|
|
// TODO(richardlau) remove check and else branch after deps/openssl
|
|
// is upgraded.
|
|
@@ -489,7 +488,7 @@ assert.throws(() => {
|
|
//
|
|
// Test DSA signing and verification
|
|
//
|
|
-{
|
|
+if (!process.features.openssl_is_boringssl) {
|
|
const input = 'I AM THE WALRUS';
|
|
|
|
// DSA signatures vary across runs so there is no static string to verify
|
|
diff --git a/test/parallel/test-crypto-scrypt.js b/test/parallel/test-crypto-scrypt.js
|
|
index eafdfe392bde8eb1fde1dc7e7e9ae51682c74b87..2907e0175379266c90acb9df829d10283bd46652 100644
|
|
--- a/test/parallel/test-crypto-scrypt.js
|
|
+++ b/test/parallel/test-crypto-scrypt.js
|
|
@@ -192,7 +192,7 @@ for (const options of incompatibleOptions) {
|
|
|
|
for (const options of toobig) {
|
|
const expected = {
|
|
- message: /Invalid scrypt params:.*memory limit exceeded/,
|
|
+ message: /Invalid scrypt params/,
|
|
code: 'ERR_CRYPTO_INVALID_SCRYPT_PARAMS',
|
|
};
|
|
assert.throws(() => crypto.scrypt('pass', 'salt', 1, options, () => {}),
|
|
diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js
|
|
index a66f0a94efd7c952c1d2320fbc7a39fe3a88a8a1..dc5846db0e3dcf8f7cb5f7efcdbc81c1d767ab88 100644
|
|
--- a/test/parallel/test-crypto-sign-verify.js
|
|
+++ b/test/parallel/test-crypto-sign-verify.js
|
|
@@ -33,7 +33,7 @@ const keySize = 2048;
|
|
}
|
|
|
|
// Test handling of exceptional conditions
|
|
-{
|
|
+if (!process.features.openssl_is_boringssl) {
|
|
const library = {
|
|
configurable: true,
|
|
set() {
|
|
@@ -345,15 +345,15 @@ assert.throws(
|
|
padding: crypto.constants.RSA_PKCS1_OAEP_PADDING
|
|
});
|
|
}, hasOpenSSL(3) ? {
|
|
- code: 'ERR_OSSL_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE',
|
|
- message: /illegal or unsupported padding mode/,
|
|
+ code: /^ERR_OSSL_(RSA|EVP)_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE$/,
|
|
+ message: /illegal or unsupported padding mode|ILLEGAL_OR_UNSUPPORTED_PADDING_MODE/,
|
|
} : {
|
|
- code: 'ERR_OSSL_RSA_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE',
|
|
- message: /illegal or unsupported padding mode/,
|
|
- opensslErrorStack: [
|
|
+ code: /^ERR_OSSL_(RSA|EVP)_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE$/,
|
|
+ message: /illegal or unsupported padding mode|ILLEGAL_OR_UNSUPPORTED_PADDING_MODE/,
|
|
+ /*opensslErrorStack: [
|
|
'error:06089093:digital envelope routines:EVP_PKEY_CTX_ctrl:' +
|
|
'command not supported',
|
|
- ],
|
|
+ ],*/
|
|
});
|
|
}
|
|
|
|
@@ -423,11 +423,13 @@ assert.throws(
|
|
public: fixtures.readKey('ed25519_public.pem', 'ascii'),
|
|
algo: null,
|
|
sigLen: 64 },
|
|
+ /*
|
|
{ private: fixtures.readKey('ed448_private.pem', 'ascii'),
|
|
public: fixtures.readKey('ed448_public.pem', 'ascii'),
|
|
algo: null,
|
|
supportsContext: true,
|
|
sigLen: 114 },
|
|
+ */
|
|
{ private: fixtures.readKey('rsa_private_2048.pem', 'ascii'),
|
|
public: fixtures.readKey('rsa_public_2048.pem', 'ascii'),
|
|
algo: 'sha1',
|
|
@@ -547,7 +549,7 @@ assert.throws(
|
|
|
|
{
|
|
const data = Buffer.from('Hello world');
|
|
- const keys = [['ec-key.pem', 64], ['dsa_private_1025.pem', 40]];
|
|
+ const keys = [['ec-key.pem', 64]/*, ['dsa_private_1025.pem', 40]*/];
|
|
|
|
for (const [file, length] of keys) {
|
|
const privKey = fixtures.readKey(file);
|
|
diff --git a/test/parallel/test-crypto-stream.js b/test/parallel/test-crypto-stream.js
|
|
index 747af780469c22eb8e4c6c35424043e868f75c3d..ed0916b036a9af23d805007ebd609973ee954473 100644
|
|
--- a/test/parallel/test-crypto-stream.js
|
|
+++ b/test/parallel/test-crypto-stream.js
|
|
@@ -73,9 +73,9 @@ const cipher = crypto.createCipheriv('aes-128-cbc', key, iv);
|
|
const decipher = crypto.createDecipheriv('aes-128-cbc', badkey, iv);
|
|
|
|
cipher.pipe(decipher)
|
|
- .on('error', common.expectsError(hasOpenSSL3 ? {
|
|
- message: /bad[\s_]decrypt/,
|
|
- library: 'Provider routines',
|
|
+ .on('error', common.expectsError((hasOpenSSL3 || process.features.openssl_is_boringssl) ? {
|
|
+ message: /bad[\s_]decrypt/i,
|
|
+ library: /Provider routines|Cipher functions/,
|
|
reason: /bad[\s_]decrypt/i,
|
|
} : {
|
|
message: /bad[\s_]decrypt/i,
|
|
diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js
|
|
index 84111740cd9ef6425b747e24e984e66e46b0b2ef..b1621d310536fae3fdec91a6a9d275ec8fc99a98 100644
|
|
--- a/test/parallel/test-crypto.js
|
|
+++ b/test/parallel/test-crypto.js
|
|
@@ -62,7 +62,7 @@ assert.throws(() => {
|
|
// Throws general Error, so there is no opensslErrorStack property.
|
|
return err instanceof Error &&
|
|
err.name === 'Error' &&
|
|
- /^Error: mac verify failure$/.test(err) &&
|
|
+ (/^Error: (mac verify failure|INCORRECT_PASSWORD)$/.test(err)) &&
|
|
!('opensslErrorStack' in err);
|
|
});
|
|
|
|
@@ -72,7 +72,7 @@ assert.throws(() => {
|
|
// Throws general Error, so there is no opensslErrorStack property.
|
|
return err instanceof Error &&
|
|
err.name === 'Error' &&
|
|
- /^Error: mac verify failure$/.test(err) &&
|
|
+ (/^Error: (mac verify failure|INCORRECT_PASSWORD)$/.test(err)) &&
|
|
!('opensslErrorStack' in err);
|
|
});
|
|
|
|
@@ -82,7 +82,7 @@ assert.throws(() => {
|
|
// Throws general Error, so there is no opensslErrorStack property.
|
|
return err instanceof Error &&
|
|
err.name === 'Error' &&
|
|
- /^Error: not enough data$/.test(err) &&
|
|
+ /^Error: (not enough data|BAD_PKCS12_DATA)$/.test(err) &&
|
|
!('opensslErrorStack' in err);
|
|
});
|
|
|
|
@@ -145,8 +145,6 @@ assert(crypto.getHashes().includes('sha1'));
|
|
assert(crypto.getHashes().includes('sha256'));
|
|
assert(!crypto.getHashes().includes('SHA1'));
|
|
assert(!crypto.getHashes().includes('SHA256'));
|
|
-assert(crypto.getHashes().includes('RSA-SHA1'));
|
|
-assert(!crypto.getHashes().includes('rsa-sha1'));
|
|
validateList(crypto.getHashes());
|
|
// Make sure all of the hashes are supported by OpenSSL
|
|
for (const algo of crypto.getHashes())
|
|
@@ -197,6 +195,7 @@ assert.throws(
|
|
}
|
|
);
|
|
|
|
+if (!process.features.openssl_is_boringssl) {
|
|
assert.throws(() => {
|
|
const priv = [
|
|
'-----BEGIN RSA PRIVATE KEY-----',
|
|
@@ -253,7 +252,7 @@ if (!hasOpenSSL3) {
|
|
return true;
|
|
});
|
|
}
|
|
-
|
|
+}
|
|
// Make sure memory isn't released before being returned
|
|
console.log(crypto.randomBytes(16));
|
|
|
|
diff --git a/test/parallel/test-tls-alert-handling.js b/test/parallel/test-tls-alert-handling.js
|
|
index 7bd42bbe721c4c9442410d524c5ca740078fc72c..de49dbdc2b75517f497af353a6b24b1beb11ed69 100644
|
|
--- a/test/parallel/test-tls-alert-handling.js
|
|
+++ b/test/parallel/test-tls-alert-handling.js
|
|
@@ -43,7 +43,8 @@ const errorHandler = common.mustCall((err) => {
|
|
|
|
assert.strictEqual(err.code, expectedErrorCode);
|
|
assert.strictEqual(err.library, 'SSL routines');
|
|
- if (!hasOpenSSL3) assert.strictEqual(err.function, 'ssl3_get_record');
|
|
+ if (!hasOpenSSL3 && !process.features.openssl_is_boringssl)
|
|
+ assert.strictEqual(err.function, 'ssl3_get_record');
|
|
assert.match(err.reason, expectedErrorReason);
|
|
errorReceived = true;
|
|
if (canCloseServer())
|
|
@@ -105,7 +106,7 @@ function sendBADTLSRecord() {
|
|
}
|
|
assert.strictEqual(err.code, expectedErrorCode);
|
|
assert.strictEqual(err.library, 'SSL routines');
|
|
- if (!hasOpenSSL3)
|
|
+ if (!hasOpenSSL3 && !process.features.openssl_is_boringssl)
|
|
assert.strictEqual(err.function, 'ssl3_read_bytes');
|
|
assert.match(err.reason, expectedErrorReason);
|
|
}));
|
|
diff --git a/test/parallel/test-webcrypto-derivebits-hkdf.js b/test/parallel/test-webcrypto-derivebits-hkdf.js
|
|
index 0629f85b0fb538cabf77479132f8c3e4ea958b19..2759223e76a0609d0ff98da73f8f6e67b325d8f3 100644
|
|
--- a/test/parallel/test-webcrypto-derivebits-hkdf.js
|
|
+++ b/test/parallel/test-webcrypto-derivebits-hkdf.js
|
|
@@ -91,18 +91,20 @@ const kDerivations = {
|
|
empty: '9e4b719033742101e90f1ad61e2ff3b4' +
|
|
'256863667296d74389f1f02af2c4e6a6'
|
|
},
|
|
- 'SHA3-256': {
|
|
- normal: '386b0693d7a58c4ddf01b49bfbbd2fa87c6f911991543995170ba20ed28df599',
|
|
- empty: 'd029bc828b6c6c8bb16ce3d25f5058f19c7d2517745e11c5d65c6d242e82e47f',
|
|
- },
|
|
- 'SHA3-384': {
|
|
- normal: '8c3b72e659bad40bcd14bdc1f7c3836059d24253795ab046a272973fd0456508',
|
|
- empty: '3211ff4c676f761494c1ca2683d2d4662fe1d770ae5c58ebf6af6acb181c7d71',
|
|
- },
|
|
- 'SHA3-512': {
|
|
- normal: '5588c5c70cb3dd2f95323da2e9d5f299ca99c301d920a499330c449d21c645cd',
|
|
- empty: '2c944b916c2751a71a1b5e57fcb487939c624335683995770b9f7cc7cbbb21f0',
|
|
- },
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'SHA3-256': {
|
|
+ normal: '386b0693d7a58c4ddf01b49bfbbd2fa87c6f911991543995170ba20ed28df599',
|
|
+ empty: 'd029bc828b6c6c8bb16ce3d25f5058f19c7d2517745e11c5d65c6d242e82e47f',
|
|
+ },
|
|
+ 'SHA3-384': {
|
|
+ normal: '8c3b72e659bad40bcd14bdc1f7c3836059d24253795ab046a272973fd0456508',
|
|
+ empty: '3211ff4c676f761494c1ca2683d2d4662fe1d770ae5c58ebf6af6acb181c7d71',
|
|
+ },
|
|
+ 'SHA3-512': {
|
|
+ normal: '5588c5c70cb3dd2f95323da2e9d5f299ca99c301d920a499330c449d21c645cd',
|
|
+ empty: '2c944b916c2751a71a1b5e57fcb487939c624335683995770b9f7cc7cbbb21f0',
|
|
+ },
|
|
+ } : {}),
|
|
},
|
|
empty: {
|
|
'SHA-384': {
|
|
@@ -129,18 +131,20 @@ const kDerivations = {
|
|
empty: 'c8e12774135305c9147f2cc4766e5ead' +
|
|
'25d8f457b9a1953d52677361ced558fb'
|
|
},
|
|
- 'SHA3-256': {
|
|
- normal: '9befc557f5baf4075b5fb38c014b41b92ab7534150baf64201069e8807d0e83d',
|
|
- empty: '54d1fa1aa7cad99dab0622b772170e775c103756183bac36a228fd817a98a3f6',
|
|
- },
|
|
- 'SHA3-384': {
|
|
- normal: '46b54c015e368677edf7ac16963bccd9d2ba8246eef0e8beb04d8d188774b91b',
|
|
- empty: '46eb0b2649bb0f605d70e4818ffc8176ee1be9782396e69fb4d0fd7cfe902b55',
|
|
- },
|
|
- 'SHA3-512': {
|
|
- normal: 'aa4375c82b5d7a3cac88a0423250b3882f140c253e98e8e7a0f6055b0908e4c2',
|
|
- empty: '6613003f98602ddb53ac35f5aa256c9f5279d50ee65bb08fdf2ecf65cc5df27f',
|
|
- },
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'SHA3-256': {
|
|
+ normal: '9befc557f5baf4075b5fb38c014b41b92ab7534150baf64201069e8807d0e83d',
|
|
+ empty: '54d1fa1aa7cad99dab0622b772170e775c103756183bac36a228fd817a98a3f6',
|
|
+ },
|
|
+ 'SHA3-384': {
|
|
+ normal: '46b54c015e368677edf7ac16963bccd9d2ba8246eef0e8beb04d8d188774b91b',
|
|
+ empty: '46eb0b2649bb0f605d70e4818ffc8176ee1be9782396e69fb4d0fd7cfe902b55',
|
|
+ },
|
|
+ 'SHA3-512': {
|
|
+ normal: 'aa4375c82b5d7a3cac88a0423250b3882f140c253e98e8e7a0f6055b0908e4c2',
|
|
+ empty: '6613003f98602ddb53ac35f5aa256c9f5279d50ee65bb08fdf2ecf65cc5df27f',
|
|
+ },
|
|
+ } : {}),
|
|
}
|
|
},
|
|
long: {
|
|
@@ -169,18 +173,20 @@ const kDerivations = {
|
|
empty: 'e579d1f9e7f08e6f990ffcfcce1ed201' +
|
|
'c5e37e62cdf606f0ba4aca80427fbc44'
|
|
},
|
|
- 'SHA3-256': {
|
|
- normal: '24f38fd1905554b7cbf8395cc3976292d11ce24a0b3131da0fd4b109832d27e3',
|
|
- empty: '33d0a5151c0f52e4bb7fb67cf7a17063127624dc3e685903f49ebb07872084d1',
|
|
- },
|
|
- 'SHA3-384': {
|
|
- normal: '15777581a1ea81ad0baac8a97d954df4142f7260d9e8351aa7f6ef6de2d04632',
|
|
- empty: 'ada4da4e28dc971633a8760b265b3019db57baf17e7bf7e13cf78b1a676f6d44',
|
|
- },
|
|
- 'SHA3-512': {
|
|
- normal: '621e4602b07fcba55ed6b976a8bef513b0f7c4ad0c546e0f852993051d887408',
|
|
- empty: 'f1292af65b05c86cf7146b739bc65785c707450316f3207ee54a3f596a7d0f7b',
|
|
- },
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'SHA3-256': {
|
|
+ normal: '24f38fd1905554b7cbf8395cc3976292d11ce24a0b3131da0fd4b109832d27e3',
|
|
+ empty: '33d0a5151c0f52e4bb7fb67cf7a17063127624dc3e685903f49ebb07872084d1',
|
|
+ },
|
|
+ 'SHA3-384': {
|
|
+ normal: '15777581a1ea81ad0baac8a97d954df4142f7260d9e8351aa7f6ef6de2d04632',
|
|
+ empty: 'ada4da4e28dc971633a8760b265b3019db57baf17e7bf7e13cf78b1a676f6d44',
|
|
+ },
|
|
+ 'SHA3-512': {
|
|
+ normal: '621e4602b07fcba55ed6b976a8bef513b0f7c4ad0c546e0f852993051d887408',
|
|
+ empty: 'f1292af65b05c86cf7146b739bc65785c707450316f3207ee54a3f596a7d0f7b',
|
|
+ },
|
|
+ } : {}),
|
|
},
|
|
empty: {
|
|
'SHA-384': {
|
|
@@ -207,18 +213,20 @@ const kDerivations = {
|
|
empty: 'b4f7e7557674d501cbfbc0148ad800c0' +
|
|
'750189fe295a2aca5e1bf4122c85edf9'
|
|
},
|
|
- 'SHA3-256': {
|
|
- normal: 'fe32459f7339dd2e8df6c6fc874ed9e81e3b7aad669edad9b71196f53ed95b12',
|
|
- empty: '04519be1eb94079c91306cc5b21946b3de6a78ad35ec83d4f4a37bafbda678d7',
|
|
- },
|
|
- 'SHA3-384': {
|
|
- normal: 'a474e8289cb4a0511e90b87eaf9ec29cadd74d4c1f2ee1fb8cb5f7d08f91a379',
|
|
- empty: '726c8c4b39083a7d5755604d3a67e9aa6139db00c08028ac9e69f7fb1525bf1d',
|
|
- },
|
|
- 'SHA3-512': {
|
|
- normal: 'c7a7f5004d1d595c6896498c169642ac24b946e13296ff53e12b534962a88675',
|
|
- empty: '7b543480b5696932551abb3100d72e05c18f57fbb63aa44fe020bef1eec3555c',
|
|
- },
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'SHA3-256': {
|
|
+ normal: 'fe32459f7339dd2e8df6c6fc874ed9e81e3b7aad669edad9b71196f53ed95b12',
|
|
+ empty: '04519be1eb94079c91306cc5b21946b3de6a78ad35ec83d4f4a37bafbda678d7',
|
|
+ },
|
|
+ 'SHA3-384': {
|
|
+ normal: 'a474e8289cb4a0511e90b87eaf9ec29cadd74d4c1f2ee1fb8cb5f7d08f91a379',
|
|
+ empty: '726c8c4b39083a7d5755604d3a67e9aa6139db00c08028ac9e69f7fb1525bf1d',
|
|
+ },
|
|
+ 'SHA3-512': {
|
|
+ normal: 'c7a7f5004d1d595c6896498c169642ac24b946e13296ff53e12b534962a88675',
|
|
+ empty: '7b543480b5696932551abb3100d72e05c18f57fbb63aa44fe020bef1eec3555c',
|
|
+ },
|
|
+ } : {}),
|
|
}
|
|
},
|
|
};
|
|
diff --git a/test/parallel/test-webcrypto-derivekey.js b/test/parallel/test-webcrypto-derivekey.js
|
|
index 422384f4447bda80c3137ea8784c1bd70c3c285f..c7c6343194a29f14d80db44cf6574e4cd6f34786 100644
|
|
--- a/test/parallel/test-webcrypto-derivekey.js
|
|
+++ b/test/parallel/test-webcrypto-derivekey.js
|
|
@@ -135,14 +135,21 @@ const { KeyObject } = require('crypto');
|
|
'201509b012c9cd2fbe7ea938f0c509b36ecb140f38bf9130e96923f55f46756d'],
|
|
['hello', 'there', 5, 'SHA-512',
|
|
'2e8d981741f98193e0af9c79870af0e985089341221edad9a130d297eae1984b'],
|
|
- ['hello', 'there', 5, 'SHA3-256',
|
|
- '0aed29b61b3ca3978aea34a9793276574ea997b69e8d03727438199f90571649'],
|
|
- ['hello', 'there', 5, 'SHA3-384',
|
|
- '7aa4a274aa19b4623c5d3091c4b06355de85ff6f25e53a83e3126cbb86ae68df'],
|
|
- ['hello', 'there', 5, 'SHA3-512',
|
|
- '4d909c47a81c625f866d1f9406248e6bc3c7ea89225fbccf1f08820254c9ef56'],
|
|
];
|
|
|
|
+ if (!process.features.openssl_is_boringssl) {
|
|
+ kTests.push(
|
|
+ ['hello', 'there', 5, 'SHA3-256',
|
|
+ '0aed29b61b3ca3978aea34a9793276574ea997b69e8d03727438199f90571649'],
|
|
+ ['hello', 'there', 5, 'SHA3-384',
|
|
+ '7aa4a274aa19b4623c5d3091c4b06355de85ff6f25e53a83e3126cbb86ae68df'],
|
|
+ ['hello', 'there', 5, 'SHA3-512',
|
|
+ '4d909c47a81c625f866d1f9406248e6bc3c7ea89225fbccf1f08820254c9ef56']
|
|
+ );
|
|
+ } else {
|
|
+ common.printSkipMessage('Skipping unsupported SHA-3 test cases');
|
|
+ }
|
|
+
|
|
const tests = Promise.all(kTests.map((args) => test(...args)));
|
|
|
|
tests.then(common.mustCall());
|
|
@@ -158,16 +165,23 @@ const { KeyObject } = require('crypto');
|
|
// Not long enough secret generated by ECDH
|
|
[{ name: 'HMAC', hash: 'SHA-384' }, 'sign', 1024],
|
|
[{ name: 'HMAC', hash: 'SHA-512' }, 'sign', 1024],
|
|
- [{ name: 'HMAC', hash: 'SHA3-256', length: 256 }, 'sign', 256],
|
|
- [{ name: 'HMAC', hash: 'SHA3-384', length: 384 }, 'sign', 384],
|
|
- [{ name: 'HMAC', hash: 'SHA3-512', length: 512 }, 'sign', 512],
|
|
- // This interaction is not defined for now.
|
|
- // https://github.com/WICG/webcrypto-modern-algos/issues/23
|
|
- // [{ name: 'HMAC', hash: 'SHA3-256' }, 'sign', 256],
|
|
- // [{ name: 'HMAC', hash: 'SHA3-384' }, 'sign', 384],
|
|
- // [{ name: 'HMAC', hash: 'SHA3-512' }, 'sign', 512],
|
|
];
|
|
|
|
+ if (!process.features.openssl_is_boringssl) {
|
|
+ vectors.push(
|
|
+ [{ name: 'HMAC', hash: 'SHA3-256', length: 256 }, 'sign', 256],
|
|
+ [{ name: 'HMAC', hash: 'SHA3-384', length: 384 }, 'sign', 384],
|
|
+ [{ name: 'HMAC', hash: 'SHA3-512', length: 512 }, 'sign', 512]
|
|
+ // This interaction is not defined for now.
|
|
+ // https://github.com/WICG/webcrypto-modern-algos/issues/23
|
|
+ // [{ name: 'HMAC', hash: 'SHA3-256' }, 'sign', 256],
|
|
+ // [{ name: 'HMAC', hash: 'SHA3-384' }, 'sign', 384],
|
|
+ // [{ name: 'HMAC', hash: 'SHA3-512' }, 'sign', 512],
|
|
+ );
|
|
+ } else {
|
|
+ common.printSkipMessage('Skipping unsupported SHA-3 test cases');
|
|
+ }
|
|
+
|
|
if (hasOpenSSL(3)) {
|
|
vectors.push(
|
|
['KMAC128', 'sign', 128],
|
|
@@ -211,16 +225,23 @@ const { KeyObject } = require('crypto');
|
|
[{ name: 'HMAC', hash: 'SHA-256' }, 'sign', 512],
|
|
[{ name: 'HMAC', hash: 'SHA-384' }, 'sign', 1024],
|
|
[{ name: 'HMAC', hash: 'SHA-512' }, 'sign', 1024],
|
|
- [{ name: 'HMAC', hash: 'SHA3-256', length: 256 }, 'sign', 256],
|
|
- [{ name: 'HMAC', hash: 'SHA3-384', length: 384 }, 'sign', 384],
|
|
- [{ name: 'HMAC', hash: 'SHA3-512', length: 512 }, 'sign', 512],
|
|
- // This interaction is not defined for now.
|
|
- // https://github.com/WICG/webcrypto-modern-algos/issues/23
|
|
- // [{ name: 'HMAC', hash: 'SHA3-256' }, 'sign', 256],
|
|
- // [{ name: 'HMAC', hash: 'SHA3-384' }, 'sign', 384],
|
|
- // [{ name: 'HMAC', hash: 'SHA3-512' }, 'sign', 512],
|
|
];
|
|
|
|
+ if (!process.features.openssl_is_boringssl) {
|
|
+ vectors.push(
|
|
+ [{ name: 'HMAC', hash: 'SHA3-256', length: 256 }, 'sign', 256],
|
|
+ [{ name: 'HMAC', hash: 'SHA3-384', length: 384 }, 'sign', 384],
|
|
+ [{ name: 'HMAC', hash: 'SHA3-512', length: 512 }, 'sign', 512],
|
|
+ // This interaction is not defined for now.
|
|
+ // https://github.com/WICG/webcrypto-modern-algos/issues/23
|
|
+ // [{ name: 'HMAC', hash: 'SHA3-256' }, 'sign', 256],
|
|
+ // [{ name: 'HMAC', hash: 'SHA3-384' }, 'sign', 384],
|
|
+ // [{ name: 'HMAC', hash: 'SHA3-512' }, 'sign', 512],
|
|
+ );
|
|
+ } else {
|
|
+ common.printSkipMessage('Skipping unsupported SHA-3 test cases');
|
|
+ }
|
|
+
|
|
if (hasOpenSSL(3)) {
|
|
vectors.push(
|
|
['KMAC128', 'sign', 128],
|
|
diff --git a/test/parallel/test-webcrypto-digest.js b/test/parallel/test-webcrypto-digest.js
|
|
index 04507d77b59142be9c9fe81c746f1c0003429262..e91214047dea431913c1a3d47ed55dd573888daf 100644
|
|
--- a/test/parallel/test-webcrypto-digest.js
|
|
+++ b/test/parallel/test-webcrypto-digest.js
|
|
@@ -148,65 +148,67 @@ const kDigestedData = {
|
|
'60b22aab8d36a4c2a3affdb71234f49276737c575ddf7' +
|
|
'4d14054cbd6fdb98fd0ddcbcb46f91ad76b6ee'
|
|
},
|
|
- 'cshake128': {
|
|
- empty: '7f9c2ba4e88f827d616045507605853ed73b8093f6e' +
|
|
- 'fbc88eb1a6eacfa66ef26',
|
|
- short: 'dea62d73e6b59cf725d0320d660089a4475cbbd3b85' +
|
|
- '39e36691f150d47556794',
|
|
- medium: 'b1acd53a03e76a221e52ea578e042f686a68c3d1c9' +
|
|
- '832ab18285cf4f304ca32d',
|
|
- long: '3a5bf5676955e5dec87d430e526925558971ca14c370' +
|
|
- 'ee5d7cf572b94c7c63d7'
|
|
- },
|
|
- 'cshake256': {
|
|
- empty: '46b9dd2b0ba88d13233b3feb743eeb243fcd52ea62b' +
|
|
- '81b82b50c27646ed5762fd75dc4ddd8c0f200cb0501' +
|
|
- '9d67b592f6fc821c49479ab48640292eacb3b7c4be',
|
|
- short: '1738113f5abb3ee5320ee18aa266c3617a7475dbd8e' +
|
|
- 'd9a985994fddd6112ad999ec8e2ebdfeafb96e76f6b' +
|
|
- 'b3a3adba43da60f00cd12496df5af3e28ae6d3de42',
|
|
- medium: '4146c13d86d9bc186b0b309ab6a124ee0c74ba26b8' +
|
|
- 'c60dcc7b3ed505969aa8d19028c6317999a085b1e6' +
|
|
- 'b6a785ce4ff632aeb27493227e44232fb7b3952141' +
|
|
- '7b',
|
|
- long: '0c42bfd1e282622fd8144aa29b072fd09fc2bae70885' +
|
|
- 'd5290933492f9d17411926a613dd0611668c2ac999e8' +
|
|
- 'c011aabaa9004323425fbad75b0f58ee6e777a94'
|
|
- },
|
|
- 'sha3-256': {
|
|
- empty: 'a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a',
|
|
- short: '3059af7aa33b517084e8ad7bbc4fb208a44c28ef32b4698d103dd540e4f91aa1',
|
|
- medium: '1fa7cd1da74cd8046417508c8314e74a9a4a9d38f9f18e6cb215b8c891a0a80e',
|
|
- long: 'b2cfc61e0386cdaef5e10a2be189891f5ef52a7624bfcd8edc893acc64fec600'
|
|
- },
|
|
- 'sha3-384': {
|
|
- empty: '0c63a75b845e4f7d01107d852e4c2485c51a50aaaa9' +
|
|
- '4fc61995e71bbee983a2ac3713831264adb47fb6bd1' +
|
|
- 'e058d5f004',
|
|
- short: '54b8f0e4cf4974de740098f66b3024479b01631315a' +
|
|
- '6773606c33eadc32556a6e778e08f0225ae79265aec' +
|
|
- '666cb2390b',
|
|
- medium: '437b7d8b68b250b5c1739ea4cc86db2033879dfb18' +
|
|
- 'de292c9c50d9c193a4c79a08a6cae3f4e483c2795e' +
|
|
- 'a5d1ef7e69d2',
|
|
- long: '3b39c4c97ad87613305d0ccc987181713e2d5e84b1f9' +
|
|
- '760011bcce0c297499005bdce8a3d2409b5ad0164f32' +
|
|
- 'bb8778d0'
|
|
- },
|
|
- 'sha3-512': {
|
|
- empty: 'a69f73cca23a9ac5c8b567dc185a756e97c982164fe' +
|
|
- '25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9' +
|
|
- '402c3ac558f500199d95b6d3e301758586281dcd26',
|
|
- short: '2dd2e07a62e6ad0498ba84f313c4d4024cb46001f78' +
|
|
- 'f75db336b0d4d8bd2a9ec152c4ad20878735d82ba08' +
|
|
- '72ecf59608ef3ced2b2a8669427e7da31e362333d8',
|
|
- medium: 'e640a21909536640369e9b0a48931c5cb2efcbc91f' +
|
|
- 'ecf247306bc96a0e4ca33307cb8e1b9af367946dd01' +
|
|
- 'c243f3907508d04f1692a3161df1f898de8ee25febe',
|
|
- long: 'bd262cecf565c338032de5ba0138f0aacfe7dde83d27' +
|
|
- '2d0d37d952829ed25de1a1342d98659ef7d2fa4aca7c' +
|
|
- 'e2b1aa0784d8fc1dcbf81bcec7a7431a3da36bf7'
|
|
- }
|
|
+ ...(!process.features.openssl_is_boringssl ? {
|
|
+ 'cshake128': {
|
|
+ empty: '7f9c2ba4e88f827d616045507605853ed73b8093f6e' +
|
|
+ 'fbc88eb1a6eacfa66ef26',
|
|
+ short: 'dea62d73e6b59cf725d0320d660089a4475cbbd3b85' +
|
|
+ '39e36691f150d47556794',
|
|
+ medium: 'b1acd53a03e76a221e52ea578e042f686a68c3d1c9' +
|
|
+ '832ab18285cf4f304ca32d',
|
|
+ long: '3a5bf5676955e5dec87d430e526925558971ca14c370' +
|
|
+ 'ee5d7cf572b94c7c63d7'
|
|
+ },
|
|
+ 'cshake256': {
|
|
+ empty: '46b9dd2b0ba88d13233b3feb743eeb243fcd52ea62b' +
|
|
+ '81b82b50c27646ed5762fd75dc4ddd8c0f200cb0501' +
|
|
+ '9d67b592f6fc821c49479ab48640292eacb3b7c4be',
|
|
+ short: '1738113f5abb3ee5320ee18aa266c3617a7475dbd8e' +
|
|
+ 'd9a985994fddd6112ad999ec8e2ebdfeafb96e76f6b' +
|
|
+ 'b3a3adba43da60f00cd12496df5af3e28ae6d3de42',
|
|
+ medium: '4146c13d86d9bc186b0b309ab6a124ee0c74ba26b8' +
|
|
+ 'c60dcc7b3ed505969aa8d19028c6317999a085b1e6' +
|
|
+ 'b6a785ce4ff632aeb27493227e44232fb7b3952141' +
|
|
+ '7b',
|
|
+ long: '0c42bfd1e282622fd8144aa29b072fd09fc2bae70885' +
|
|
+ 'd5290933492f9d17411926a613dd0611668c2ac999e8' +
|
|
+ 'c011aabaa9004323425fbad75b0f58ee6e777a94'
|
|
+ },
|
|
+ 'sha3-256': {
|
|
+ empty: 'a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a',
|
|
+ short: '3059af7aa33b517084e8ad7bbc4fb208a44c28ef32b4698d103dd540e4f91aa1',
|
|
+ medium: '1fa7cd1da74cd8046417508c8314e74a9a4a9d38f9f18e6cb215b8c891a0a80e',
|
|
+ long: 'b2cfc61e0386cdaef5e10a2be189891f5ef52a7624bfcd8edc893acc64fec600'
|
|
+ },
|
|
+ 'sha3-384': {
|
|
+ empty: '0c63a75b845e4f7d01107d852e4c2485c51a50aaaa9' +
|
|
+ '4fc61995e71bbee983a2ac3713831264adb47fb6bd1' +
|
|
+ 'e058d5f004',
|
|
+ short: '54b8f0e4cf4974de740098f66b3024479b01631315a' +
|
|
+ '6773606c33eadc32556a6e778e08f0225ae79265aec' +
|
|
+ '666cb2390b',
|
|
+ medium: '437b7d8b68b250b5c1739ea4cc86db2033879dfb18' +
|
|
+ 'de292c9c50d9c193a4c79a08a6cae3f4e483c2795e' +
|
|
+ 'a5d1ef7e69d2',
|
|
+ long: '3b39c4c97ad87613305d0ccc987181713e2d5e84b1f9' +
|
|
+ '760011bcce0c297499005bdce8a3d2409b5ad0164f32' +
|
|
+ 'bb8778d0'
|
|
+ },
|
|
+ 'sha3-512': {
|
|
+ empty: 'a69f73cca23a9ac5c8b567dc185a756e97c982164fe' +
|
|
+ '25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9' +
|
|
+ '402c3ac558f500199d95b6d3e301758586281dcd26',
|
|
+ short: '2dd2e07a62e6ad0498ba84f313c4d4024cb46001f78' +
|
|
+ 'f75db336b0d4d8bd2a9ec152c4ad20878735d82ba08' +
|
|
+ '72ecf59608ef3ced2b2a8669427e7da31e362333d8',
|
|
+ medium: 'e640a21909536640369e9b0a48931c5cb2efcbc91f' +
|
|
+ 'ecf247306bc96a0e4ca33307cb8e1b9af367946dd01' +
|
|
+ 'c243f3907508d04f1692a3161df1f898de8ee25febe',
|
|
+ long: 'bd262cecf565c338032de5ba0138f0aacfe7dde83d27' +
|
|
+ '2d0d37d952829ed25de1a1342d98659ef7d2fa4aca7c' +
|
|
+ 'e2b1aa0784d8fc1dcbf81bcec7a7431a3da36bf7'
|
|
+ }
|
|
+ } : {}),
|
|
};
|
|
|
|
async function testDigest(size, alg) {
|
|
diff --git a/test/parallel/test-webcrypto-sign-verify-rsa.js b/test/parallel/test-webcrypto-sign-verify-rsa.js
|
|
index 7e90388cc4c270200ecfbda541828c5b237e0d69..ca99ad79fea59f583726f96a58271e86d5c7b5d7 100644
|
|
--- a/test/parallel/test-webcrypto-sign-verify-rsa.js
|
|
+++ b/test/parallel/test-webcrypto-sign-verify-rsa.js
|
|
@@ -245,7 +245,7 @@ async function testSaltLength(keyLength, hash, hLen) {
|
|
['SHA3-384', 48],
|
|
['SHA3-512', 64],
|
|
]) {
|
|
- if (hash.startsWith('SHA-3') && !process.features.openssl_is_boringssl) {
|
|
+ if (hash.startsWith('SHA3') && !process.features.openssl_is_boringssl) {
|
|
variations.push(testSaltLength(keyLength, hash, hLen));
|
|
}
|
|
}
|
|
diff --git a/test/parallel/test-webcrypto-wrap-unwrap.js b/test/parallel/test-webcrypto-wrap-unwrap.js
|
|
index bd788ec4ed88289d35798b8af8c9490a68e081a2..1a5477ba928bce93320f8056db02e1a7b8ddcdf3 100644
|
|
--- a/test/parallel/test-webcrypto-wrap-unwrap.js
|
|
+++ b/test/parallel/test-webcrypto-wrap-unwrap.js
|
|
@@ -20,14 +20,15 @@ const kWrappingData = {
|
|
wrap: { label: new Uint8Array(8) },
|
|
pair: true
|
|
},
|
|
- 'AES-CTR': {
|
|
+ 'AES-CBC': {
|
|
generate: { length: 128 },
|
|
- wrap: { counter: new Uint8Array(16), length: 64 },
|
|
+ wrap: { iv: new Uint8Array(16) },
|
|
pair: false
|
|
},
|
|
- 'AES-CBC': {
|
|
+ /*
|
|
+ 'AES-CTR': {
|
|
generate: { length: 128 },
|
|
- wrap: { iv: new Uint8Array(16) },
|
|
+ wrap: { counter: new Uint8Array(16), length: 64 },
|
|
pair: false
|
|
},
|
|
'AES-GCM': {
|
|
@@ -46,30 +47,9 @@ if (!process.features.openssl_is_boringssl) {
|
|
generate: { length: 128 },
|
|
wrap: { },
|
|
pair: false
|
|
- };
|
|
- kWrappingData['ChaCha20-Poly1305'] = {
|
|
- wrap: {
|
|
- iv: new Uint8Array(12),
|
|
- additionalData: new Uint8Array(16),
|
|
- tagLength: 128
|
|
- },
|
|
- pair: false
|
|
- };
|
|
-} else {
|
|
- common.printSkipMessage('Skipping unsupported AES-KW test case');
|
|
-}
|
|
-
|
|
-if (hasOpenSSL(3)) {
|
|
- kWrappingData['AES-OCB'] = {
|
|
- generate: { length: 128 },
|
|
- wrap: {
|
|
- iv: new Uint8Array(15),
|
|
- additionalData: new Uint8Array(16),
|
|
- tagLength: 128
|
|
- },
|
|
- pair: false
|
|
- };
|
|
-}
|
|
+ }
|
|
+ */
|
|
+};
|
|
|
|
function generateWrappingKeys() {
|
|
return Promise.all(Object.keys(kWrappingData).map(async (name) => {
|
|
diff --git a/test/parallel/test-x509-escaping.js b/test/parallel/test-x509-escaping.js
|
|
index b507af88e1f7f3424b7b5d6d683a295b9d208e5e..825ba4c8dce775f401080a0522565bb7a087bcc3 100644
|
|
--- a/test/parallel/test-x509-escaping.js
|
|
+++ b/test/parallel/test-x509-escaping.js
|
|
@@ -448,7 +448,7 @@ const { hasOpenSSL3 } = require('../common/crypto');
|
|
assert.strictEqual(certX509.checkHost(servername, { subject: 'default' }),
|
|
undefined);
|
|
assert.strictEqual(certX509.checkHost(servername, { subject: 'always' }),
|
|
- servername);
|
|
+ undefined);
|
|
assert.strictEqual(certX509.checkHost(servername, { subject: 'never' }),
|
|
undefined);
|
|
|
|
@@ -483,11 +483,11 @@ const { hasOpenSSL3 } = require('../common/crypto');
|
|
assert.strictEqual(certX509.subjectAltName, 'IP Address:1.2.3.4');
|
|
|
|
// The newer X509Certificate API allows customizing this behavior:
|
|
- assert.strictEqual(certX509.checkHost(servername), servername);
|
|
+ assert.strictEqual(certX509.checkHost(servername), undefined);
|
|
assert.strictEqual(certX509.checkHost(servername, { subject: 'default' }),
|
|
- servername);
|
|
+ undefined);
|
|
assert.strictEqual(certX509.checkHost(servername, { subject: 'always' }),
|
|
- servername);
|
|
+ undefined);
|
|
assert.strictEqual(certX509.checkHost(servername, { subject: 'never' }),
|
|
undefined);
|
|
|