From 23fb51283786c5981d59bf9a29824b0ba9d656cf Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Thu, 4 Jul 2024 14:38:11 +0200 Subject: [PATCH 1/2] feat(ext/crypto): make deriveBits length parameter optional and nullable --- ext/crypto/00_crypto.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js index 8f9c431edfccbd..80a2e11c7c9bdf 100644 --- a/ext/crypto/00_crypto.js +++ b/ext/crypto/00_crypto.js @@ -1131,10 +1131,10 @@ class SubtleCrypto { * @param {number | null} length * @returns {Promise} */ - async deriveBits(algorithm, baseKey, length) { + async deriveBits(algorithm, baseKey, length = null) { webidl.assertBranded(this, SubtleCryptoPrototype); const prefix = "Failed to execute 'deriveBits' on 'SubtleCrypto'"; - webidl.requiredArguments(arguments.length, 3, prefix); + webidl.requiredArguments(arguments.length, 2, prefix); algorithm = webidl.converters.AlgorithmIdentifier( algorithm, prefix, From 01532432a8654546bd73f1ffdfab8c4b1bb06060 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Thu, 4 Jul 2024 15:43:35 +0200 Subject: [PATCH 2/2] update expectations --- tests/wpt/runner/expectation.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index 74eef815944dc2..cd212f9c4ea64c 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -909,10 +909,12 @@ "historical.any.html": false, "historical.any.worker.html": false, "idlharness.https.any.html": [ - "Window interface: attribute crypto" + "Window interface: attribute crypto", + "SubtleCrypto interface: operation deriveBits(AlgorithmIdentifier, CryptoKey, unsigned long)" ], "idlharness.https.any.worker.html": [ - "WorkerGlobalScope interface: attribute crypto" + "WorkerGlobalScope interface: attribute crypto", + "SubtleCrypto interface: operation deriveBits(AlgorithmIdentifier, CryptoKey, unsigned long)" ], "import_export": { "ec_importKey.https.any.html": [