Skip to content

Conversation

@panva
Copy link
Member

@panva panva commented Jun 4, 2022

This PR removes Node.js specific extensions from Web Crypto API.

  • Removes 'NODE-DSA', 'NODE-DH', and 'NODE-SCRYPT' algorithms.
  • Removes 'node.keyObject' import/export format.

These extensions are not portable and the crypto Issues and PRs related to the crypto subsystem. module accomodates their functionality.

After this cleanup the webcrypto module has a clearer path to stable stability status.

NB: src code cleanup will follow in a separate PR.

@panva panva added crypto Issues and PRs related to the crypto subsystem. semver-minor PRs that contain new features and should be released in the next minor version. notable-change PRs with changes that should be highlighted in changelogs. experimental Issues and PRs related to experimental features. webcrypto labels Jun 4, 2022
@panva panva requested review from jasnell and tniessen June 4, 2022 06:38
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added 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 Jun 4, 2022
@devsnek
Copy link
Member

devsnek commented Jun 4, 2022

could NODE-ED25519 theoretically be an alias of Ed25519? i'm not very familiar with the differences

@panva
Copy link
Member Author

panva commented Jun 4, 2022

could NODE-ED25519 theoretically be an alias of Ed25519? i'm not very familiar with the differences

NODE-ED25519 was removed from webcrypto in #42507. The difference was not only in the name of the algorithm.

@panva panva added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 4, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 4, 2022
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@panva panva added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 4, 2022
@nodejs-github-bot
Copy link
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/44355/

@panva
Copy link
Member Author

panva commented Jun 4, 2022

Only three resumes 🚀

@panva panva added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 11, 2022
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jun 11, 2022
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/43310
✔  Done loading data for nodejs/node/pull/43310
----------------------------------- PR info ------------------------------------
Title      crypto: remove Node.js-specific Web Crypto API extensions (#43310)
Author     Filip Skokan  (@panva)
Branch     panva:webcrypto-remove-extensions -> nodejs:master
Labels     crypto, semver-minor, lib / src, notable-change, experimental, author ready, needs-ci, webcrypto
Commits    2
 - crypto: remove Node.js-specific webcrypto extensions
 - fixup! crypto: remove Node.js-specific Web Crypto API extensions
Committers 2
 - Filip Skokan 
 - GitHub 
PR-URL: https://github.com/nodejs/node/pull/43310
Reviewed-By: James M Snell 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/43310
Reviewed-By: James M Snell 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sat, 04 Jun 2022 06:38:50 GMT
   ✔  Approvals: 1
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/43310#pullrequestreview-995799532
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2022-06-04T12:49:53Z: https://ci.nodejs.org/job/node-test-pull-request/44355/
- Querying data for job/node-test-pull-request/44355/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/master up to date...
From https://github.com/nodejs/node
 * branch                  master     -> FETCH_HEAD
✔  origin/master is now up-to-date
- Downloading patch for 43310
From https://github.com/nodejs/node
 * branch                  refs/pull/43310/merge -> FETCH_HEAD
✔  Fetched commits as cb7e854c776d..2367fa298973
--------------------------------------------------------------------------------
[master 31dcf796f2] crypto: remove Node.js-specific webcrypto extensions
 Author: Filip Skokan 
 Date: Thu Jun 2 10:41:00 2022 +0200
 25 files changed, 40 insertions(+), 1901 deletions(-)
 delete mode 100644 lib/internal/crypto/dsa.js
 delete mode 100644 test/fixtures/crypto/dsa.js
 delete mode 100644 test/parallel/test-webcrypto-derivebits-node-dh.js
 delete mode 100644 test/parallel/test-webcrypto-export-import-dsa.js
 delete mode 100644 test/parallel/test-webcrypto-sign-verify-node-dsa.js
[master 7e3574df4c] fixup! crypto: remove Node.js-specific Web Crypto API extensions
 Author: Filip Skokan 
 Date: Sat Jun 4 08:52:21 2022 +0200
 1 file changed, 2 insertions(+), 2 deletions(-)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
Rebasing (2/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
crypto: remove Node.js-specific webcrypto extensions

PR-URL: #43310
Reviewed-By: James M Snell [email protected]

[detached HEAD 8ff08e780e] crypto: remove Node.js-specific webcrypto extensions
Author: Filip Skokan [email protected]
Date: Thu Jun 2 10:41:00 2022 +0200
25 files changed, 40 insertions(+), 1901 deletions(-)
delete mode 100644 lib/internal/crypto/dsa.js
delete mode 100644 test/fixtures/crypto/dsa.js
delete mode 100644 test/parallel/test-webcrypto-derivebits-node-dh.js
delete mode 100644 test/parallel/test-webcrypto-export-import-dsa.js
delete mode 100644 test/parallel/test-webcrypto-sign-verify-node-dsa.js
Rebasing (3/4)
Rebasing (4/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
fixup! crypto: remove Node.js-specific Web Crypto API extensions

PR-URL: #43310
Reviewed-By: James M Snell [email protected]

[detached HEAD 5dae70fa18] fixup! crypto: remove Node.js-specific Web Crypto API extensions
Author: Filip Skokan [email protected]
Date: Sat Jun 4 08:52:21 2022 +0200
1 file changed, 2 insertions(+), 2 deletions(-)

Successfully rebased and updated refs/heads/master.

ℹ Use --fixupAll option, squash the PR manually or land the PR from the command line.

https://github.com/nodejs/node/actions/runs/2479089075

@panva panva added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Jun 11, 2022
danielleadams added a commit that referenced this pull request Jun 14, 2022
Notable changes:

* crypto:
  * remove Node.js-specific webcrypto extensions (Filip Skokan) #43310
  * add CFRG curves to Web Crypto API (Filip Skokan) #42507
* report:
  * add more heap infos in process report (theanarkh) #43116

PR-URL: #43385
@ljharb
Copy link
Member

ljharb commented Jun 16, 2022

How is this PR not semver-major? It removes things.

@panva
Copy link
Member Author

panva commented Jun 16, 2022

How is this PR not semver-major? It removes things.

The webcrypto module is experimental Issues and PRs related to experimental features. .

@ljharb
Copy link
Member

ljharb commented Jun 16, 2022

Ah, thanks for clarifying.

@yoursunny
Copy link

How is this PR not semver-major? It removes things.

If you need to write code that supports both Node 18.4.0 and earlier version, you can try my library:
@yoursunny/webcrypto-ed25519.

It exports an Ed25519Algorithm variable that is { name: "Ed25519" } for Node 18.4.0 or { name: "NODE-ED25519", namedCurve: "NODE-ED25519" } for Node 18.3.0 and earlier.
Pass this variable to Web Crypto API instead of the algorithm object, and you can support both versions.

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. crypto Issues and PRs related to the crypto subsystem. experimental Issues and PRs related to experimental features. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. semver-minor PRs that contain new features and should be released in the next minor version. webcrypto

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants