deno
4d747eaf - fix(ext/node): use correct block sizes for HMAC algorithms (#31775)

Commit
318 days ago
fix(ext/node): use correct block sizes for HMAC algorithms (#31775) The HMAC implementation was hardcoded to use 64-byte blocks for most algorithms and 128-byte blocks only for sha512/sha384. This is incorrect for many algorithms like sha3-* variants and blake2 which have different block sizes. Add a lookup table with correct block sizes for all supported hash algorithms and throw an error for unsupported algorithms. Fixes #31765 <!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> Co-authored-by: Divy <dj.srivastava23@gmail.com>
Author
Parents
Loading