diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2021-08-05 01:19:27 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-04 21:49:27 +0200 |
commit | 87de8e82a157ecbcc596b0226b8a6fc0e81a8b1b (patch) | |
tree | 1b11766af8fce76db2cf2110bee4307f3681a0d5 /extensions/crypto/00_crypto.js | |
parent | 2ac031d6fd3cb9b98ffb1801033d96675291f577 (diff) |
feat(extensions/crypto): implement verify() for HMAC (#11387)
Diffstat (limited to 'extensions/crypto/00_crypto.js')
-rw-r--r-- | extensions/crypto/00_crypto.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/extensions/crypto/00_crypto.js b/extensions/crypto/00_crypto.js index a21469a81..449946295 100644 --- a/extensions/crypto/00_crypto.js +++ b/extensions/crypto/00_crypto.js @@ -80,6 +80,7 @@ "verify": { "RSASSA-PKCS1-v1_5": null, "RSA-PSS": "RsaPssParams", + "HMAC": null, }, "importKey": { "HMAC": "HmacImportParams", @@ -690,6 +691,15 @@ signature, }, data); } + case "HMAC": { + const hash = key[_algorithm].hash.name; + return await core.opAsync("op_crypto_verify_key", { + key: keyData, + algorithm: "HMAC", + hash, + signature, + }, data); + } } throw new TypeError("unreachable"); |