summaryrefslogtreecommitdiff
path: root/ext/crypto/01_webidl.js
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2021-08-31 11:25:44 +0200
committerGitHub <noreply@github.com>2021-08-31 11:25:44 +0200
commitcee5be45394c77863dacbf8f1d0f0b90188d2cca (patch)
treea7f457682dc5a399641738ce903014e64c3d7b59 /ext/crypto/01_webidl.js
parentfcd0992dba9cce0539cc60cd11867f50c0cf5efb (diff)
feat(ext/crypto): AES key generation (#11869)
Support AES-CTR, AES-CBC, AES-GCM, and AES-KW in SubtleCrypto#generateKey.
Diffstat (limited to 'ext/crypto/01_webidl.js')
-rw-r--r--ext/crypto/01_webidl.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/crypto/01_webidl.js b/ext/crypto/01_webidl.js
index e781e4334..3ef3eb175 100644
--- a/ext/crypto/01_webidl.js
+++ b/ext/crypto/01_webidl.js
@@ -117,6 +117,19 @@
webidl.converters.EcKeyGenParams = webidl
.createDictionaryConverter("EcKeyGenParams", dictEcKeyGenParams);
+ const dictAesKeyGenParams = [
+ ...dictAlgorithm,
+ {
+ key: "length",
+ converter: (V, opts) =>
+ webidl.converters["unsigned short"](V, { ...opts, enforceRange: true }),
+ required: true,
+ },
+ ];
+
+ webidl.converters.AesKeyGenParams = webidl
+ .createDictionaryConverter("AesKeyGenParams", dictAesKeyGenParams);
+
const dictHmacKeyGenParams = [
...dictAlgorithm,
{