Skip to content

crypto: doc-deprecate multiple Hmac.digest() calls (DEP0206)#30

Open
tuo-git wants to merge 1 commit intomainfrom
fake-pr-branch-63121
Open

crypto: doc-deprecate multiple Hmac.digest() calls (DEP0206)#30
tuo-git wants to merge 1 commit intomainfrom
fake-pr-branch-63121

Conversation

@tuo-git
Copy link
Copy Markdown
Owner

@tuo-git tuo-git commented May 5, 2026

Original author: @Anshikakalpana

Fixes: nodejs#62838

Situation

Calling digest() on an already-finalized Hmac instance currently returns an empty buffer silently instead of throwing an error. This is inconsistent with Hash behavior which throws ERR_CRYPTO_HASH_FINALIZED and is a potential security footgun.

Change

Add a runtime deprecation warning (DEP0206) when digest() is called more than once on an Hmac instance. The existing behavior (returning an empty buffer) is preserved during the deprecation cycle to avoid breaking changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant