Skip to content

crypto: accept key data in crypto.diffieHellman() and cleanup DH jobs#62527

Open
panva wants to merge 1 commit intonodejs:mainfrom
panva:key-data-in-dh
Open

crypto: accept key data in crypto.diffieHellman() and cleanup DH jobs#62527
panva wants to merge 1 commit intonodejs:mainfrom
panva:key-data-in-dh

Conversation

@panva
Copy link
Copy Markdown
Member

@panva panva commented Mar 31, 2026

Accept key data in addition to KeyObject instances in crypto.diffieHellman(options) as options.privateKey and options.publicKey, same inputs like in the other node:crypto functions.

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Mar 31, 2026
@panva panva added semver-minor PRs that contain new features and should be released in the next minor version. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. dont-land-on-v25.x PRs that should not land on the v25.x-staging branch and should not be released in v25.x. crypto Issues and PRs related to the crypto subsystem. labels Mar 31, 2026
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 95.29412% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.71%. Comparing base (1ccae7c) to head (9cea4fd).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/crypto/crypto_dh.cc 50.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62527      +/-   ##
==========================================
- Coverage   89.72%   89.71%   -0.01%     
==========================================
  Files         695      695              
  Lines      214106   214087      -19     
  Branches    41002    40986      -16     
==========================================
- Hits       192096   192071      -25     
- Misses      14077    14104      +27     
+ Partials     7933     7912      -21     
Files with missing lines Coverage Δ
lib/internal/crypto/diffiehellman.js 97.92% <100.00%> (+0.22%) ⬆️
lib/internal/crypto/keys.js 96.39% <100.00%> (ø)
lib/internal/crypto/sig.js 96.44% <100.00%> (ø)
src/crypto/crypto_ec.cc 70.85% <ø> (+1.03%) ⬆️
src/crypto/crypto_ec.h 16.66% <ø> (+4.16%) ⬆️
src/crypto/crypto_dh.cc 67.80% <50.00%> (+0.61%) ⬆️

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

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

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. dont-land-on-v25.x PRs that should not land on the v25.x-staging branch and should not be released in v25.x. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants