Skip to content

crypto: improve accuracy of SubtleCrypto.supports - #63104

Merged
nodejs-github-bot merged 4 commits into
nodejs:mainfrom
panva:subtle-supports-derive-bits
May 6, 2026
Merged

crypto: improve accuracy of SubtleCrypto.supports#63104
nodejs-github-bot merged 4 commits into
nodejs:mainfrom
panva:subtle-supports-derive-bits

Conversation

@panva

@panvapanva commented May 3, 2026

Copy link
Copy Markdown
Member

This improves the accuracy of SubtleCrypto.supports() by checking the shared secret output from an ECDH (or ECDH-like) algorithm covers the requested/resolved length.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
@panvapanva added crypto Issues and PRs related to the crypto subsystem. experimental Issues and PRs related to experimental features. webcrypto labels May 3, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-botnodejs-github-bot added the needs-ci PRs that need a full CI run. label May 3, 2026
@codecov

codecovBot commented May 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.66%. Comparing base (25f80fb) to head (f1cbedb).
⚠️ Report is 34 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #63104 +/- ##
=======================================
Coverage 89.65% 89.66% =======================================
Files 712 712 Lines 220822 220843 +21 Branches 42373 42381 +8 =======================================
+ Hits 197985 198019 +34 + Misses 14661 14641 -20 - Partials 8176 8183 +7 
Files with missing linesCoverage Δ
lib/internal/crypto/webcrypto.js96.66% <100.00%> (+0.02%)⬆️

... and 43 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.

Comment threadtest/fixtures/webcrypto/supports-level-2.mjs
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
try {
return check(operation, algorithm, length);
} catch {
return false;

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.

Not a huge fan of suppressing errors like this. If this is part of the spec that this method should not throw, a comment here would be good.

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.

Agreed

@panvapanva added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels May 4, 2026
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 4, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@panvapanva added the commit-queue Add this label to land a pull request using GitHub Actions. label May 6, 2026
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 6, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 0bd46c1 into nodejs:mainMay 6, 2026
76 of 78 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 0bd46c1

@panva
panva deleted the subtle-supports-derive-bits branch May 6, 2026 13:49
aduh95 pushed a commit that referenced this pull request May 19, 2026
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: #63104
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
aduh95 pushed a commit that referenced this pull request May 19, 2026
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: #63104
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
@panvapanva added the backport-open-v24.x Indicate that the PR has an open backport label Jul 20, 2026
aduh95 pushed a commit that referenced this pull request Jul 21, 2026
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: #63104
Backport-PR-URL: #64629
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 22, 2026
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: #63104
Backport-PR-URL: #64629
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 30, 2026
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: #63104
Backport-PR-URL: #64629
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@panvapanva added backported-to-v24.x PRs backported to the v24.x-staging branch. and removed backport-open-v24.x Indicate that the PR has an open backport labels Aug 3, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.backported-to-v24.xPRs backported to the v24.x-staging branch.cryptoIssues and PRs related to the crypto subsystem.experimentalIssues and PRs related to experimental features.needs-ciPRs that need a full CI run.webcrypto

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@panva@nodejs-github-bot@ChALkeR@jasnell@anonrig