1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 07:44:48 -05:00

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)
This commit is contained in:
Filip Skokan 2024-07-04 17:40:51 +02:00 committed by GitHub
parent 147411e64b
commit f632b4a92e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -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,

View file

@ -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": [