summaryrefslogtreecommitdiff
path: root/ext/crypto/00_crypto.js
diff options
context:
space:
mode:
authorFilip Skokan <panva.ip@gmail.com>2022-10-15 07:23:35 +0200
committerGitHub <noreply@github.com>2022-10-15 10:53:35 +0530
commit225d516466a37a3695e051ca29456e424cb99aa2 (patch)
tree0ea582b946264f45bd778a406a98e7c207635343 /ext/crypto/00_crypto.js
parente7d7585065a70ea388bfccce3681671d25f737b4 (diff)
fix(ext/crypto): correct HMAC get key length op (#16201)
fixes #16180 `HMAC`'s `get key length` `op` uses the hash function's block size, not output size. refs https://github.com/cloudflare/workerd/issues/68#issuecomment-1271189657
Diffstat (limited to 'ext/crypto/00_crypto.js')
-rw-r--r--ext/crypto/00_crypto.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js
index 7b21c9287..857283623 100644
--- a/ext/crypto/00_crypto.js
+++ b/ext/crypto/00_crypto.js
@@ -393,16 +393,16 @@
if (algorithm.length === undefined) {
switch (algorithm.hash.name) {
case "SHA-1":
- length = 160;
+ length = 512;
break;
case "SHA-256":
- length = 256;
+ length = 512;
break;
case "SHA-384":
- length = 384;
+ length = 1024;
break;
case "SHA-512":
- length = 512;
+ length = 1024;
break;
default:
throw new DOMException(