diff options
author | Filip Skokan <panva.ip@gmail.com> | 2024-07-04 17:40:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-04 21:10:51 +0530 |
commit | f632b4a92e4e2c552cf31749792075bad0814c22 (patch) | |
tree | 60146d157e6dacbd3b7cd33102d6bb26a23641ca | |
parent | 147411e64b22fe74cb258125acab83f9182c9f81 (diff) |
feat(ext/crypto): make deriveBits length parameter optional and nullable (#24426)
Updates SubtleCrypto.prototype.deriveBits as per
https://github.com/w3c/webcrypto/pull/345
(WPT update in https://github.com/web-platform-tests/wpt/pull/43400)
-rw-r--r-- | ext/crypto/00_crypto.js | 4 | ||||
-rw-r--r-- | tests/wpt/runner/expectation.json | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js index 8f9c431ed..80a2e11c7 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<ArrayBuffer>} */ - 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, diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index 74eef8159..cd212f9c4 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": [ |