summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2021-08-17 14:59:32 +0530
committerGitHub <noreply@github.com>2021-08-17 11:29:32 +0200
commitaf97535b7cc64bf4586da77fc0afa146230e758c (patch)
treed19a22a169934112411e0a7bace222f21fb75175 /cli
parentc67f6c13cd1de22e32f81723bc9224b8e2103a7a (diff)
fix(ext/crypto): exportKey() for HMAC (#11737)
Fixes typings and innerKey processing (WPT doesn't test exportKey for HMAC so this wasn't caught earlier).
Diffstat (limited to 'cli')
-rw-r--r--cli/tests/unit/webcrypto_test.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/tests/unit/webcrypto_test.ts b/cli/tests/unit/webcrypto_test.ts
index 23a4e0c57..608e4660a 100644
--- a/cli/tests/unit/webcrypto_test.ts
+++ b/cli/tests/unit/webcrypto_test.ts
@@ -160,7 +160,7 @@ unitTest(async function testSignRSASSAKey() {
assert(signature);
});
-unitTest(async function subtleCryptoHmacImport() {
+unitTest(async function subtleCryptoHmacImportExport() {
// deno-fmt-ignore
const rawKey = new Uint8Array([
1, 2, 3, 4, 5, 6, 7, 8,
@@ -189,4 +189,7 @@ unitTest(async function subtleCryptoHmacImport() {
new Uint8Array(actual),
expected,
);
+
+ const exportedKey = await crypto.subtle.exportKey("raw", key);
+ assertEquals(new Uint8Array(exportedKey), rawKey);
});