Skip to content

crypto: runtime-deprecate calling digest() on HMAC more than once#63770

Open
EduardF1 wants to merge 1 commit into
nodejs:mainfrom
EduardF1:feat/runtime-hmac-deprecate-clean
Open

crypto: runtime-deprecate calling digest() on HMAC more than once#63770
EduardF1 wants to merge 1 commit into
nodejs:mainfrom
EduardF1:feat/runtime-hmac-deprecate-clean

Conversation

@EduardF1
Copy link
Copy Markdown

@EduardF1 EduardF1 commented Jun 7, 2026

Description

Fixes #62838

Currently, calling hmac.digest() multiple times on a finalized HMAC instance returns an empty buffer instead of throwing ERR_CRYPTO_HASH_FINALIZED (which is what standard hashes do). As noted in the issue, this inconsistency represents a security footgun.

Following the documentation-only deprecation introduced in #63121, this patch formally implements the runtime deprecation warning via emitDeprecationWarning('DEP0206').

Testing

Verified correct usage of getDeprecationWarningEmitter mapping.

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/userland-migrations

@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runtime-deprecate calling digest() on HMAC more than once

2 participants