Skip to content

crypto: move DEP0179 and DEP0181 to End-of-Life - #67490

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
jasnell:crypto-eol-dep0179-dep0181
Nov 17, 2026
Merged

nodejs-github-bot merged 2 commits into
nodejs:mainfrom
jasnell:crypto-eol-dep0179-dep0181

Conversation

@jasnell

@jasnell jasnell commented Nov 15, 2026

Copy link
Copy Markdown
Member

Calling the Hash or Hmac constructors directly, with or without new, now throws ERR_ILLEGAL_CONSTRUCTOR. Instances must be created with crypto.createHash() and crypto.createHmac().

The classes remain exported from node:crypto so that instanceof checks continue to work. Internally, instances are constructed through a private symbol, and the createHash() and createHmac() factories now live alongside the classes in internal/crypto/hash.

Both have been runtime deprecations since v22.0.0.

Refs: #51880
Refs: #52071

Calling the Hash or Hmac constructors directly, with or without new,
now throws ERR_ILLEGAL_CONSTRUCTOR. Instances must be created with
crypto.createHash() and crypto.createHmac().

The classes remain exported from node:crypto so that instanceof checks
continue to work. Internally, instances are constructed through a
private symbol, and the createHash() and createHmac() factories now
live alongside the classes in internal/crypto/hash.

Both have been runtime deprecations since v22.0.0.

Refs: nodejs#51880
Refs: nodejs#52071
Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
@jasnell
jasnell requested a review from a team November 15, 2026 16:36
@jasnell jasnell added crypto Issues and PRs related to the crypto subsystem. semver-major PRs that contain breaking changes and should be released in the next major version. deprecations Issues and PRs related to deprecations. labels Nov 15, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

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

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Nov 15, 2026
Comment thread doc/api/crypto.md Resolved
Comment thread doc/api/crypto.md Resolved
Comment thread doc/api/deprecations.md Resolved
Comment thread doc/api/deprecations.md Resolved
Co-authored-by: James M Snell <jasnell@gmail.com>
@panva panva added the commit-queue-squash PRs the Commit Queue should land as one squashed commit. label Nov 15, 2026
@panva
panva requested a review from a team November 15, 2026 16:44
@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 15, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 15, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.67%. Comparing base (d105ef7) to head (391630a).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #67490   +/-   ##
=======================================
  Coverage   90.67%   90.67%           
=======================================
  Files         799      799           
  Lines      280245   280251    +6     
  Branches    54125    54118    -7     
=======================================
+ Hits       254100   254114   +14     
- Misses      16280    16286    +6     
+ Partials     9865     9851   -14     
Files with missing lines Coverage Δ
lib/crypto.js 95.23% <100.00%> (-0.08%) ⬇️
lib/internal/crypto/hash.js 99.49% <100.00%> (+0.01%) ⬆️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jasnell

jasnell commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@nodejs/tsc ... will need another sign off here

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jasnell jasnell added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 15, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 6c83591 into nodejs:main Nov 17, 2026
68 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 6c83591

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 17, 2026
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
Calling the Hash or Hmac constructors directly, with or without new,
now throws ERR_ILLEGAL_CONSTRUCTOR. Instances must be created with
crypto.createHash() and crypto.createHmac().

The classes remain exported from node:crypto so that instanceof checks
continue to work. Internally, instances are constructed through a
private symbol, and the createHash() and createHmac() factories now
live alongside the classes in internal/crypto/hash.

Both have been runtime deprecations since v22.0.0.

Refs: nodejs#51880
Refs: nodejs#52071
Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#67490
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squash PRs the Commit Queue should land as one squashed commit. crypto Issues and PRs related to the crypto subsystem. deprecations Issues and PRs related to deprecations. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants