X Tutup
The Wayback Machine - https://web.archive.org/web/20220712230306/https://github.com/nodejs/node/pull/42507
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: add CFRG curves to Web Crypto API #42507

Merged
merged 23 commits into from Jun 4, 2022

Conversation

panva
Copy link
Member

@panva panva commented Mar 29, 2022

As per https://wicg.github.io/webcrypto-secure-curves and WICG/proposals#46

This

  • Adds Ed25519, X25519, and X448 in full as described by https://wicg.github.io/webcrypto-secure-curves as of May 2022
  • Adds Ed448 as described by https://wicg.github.io/webcrypto-secure-curves as of May 2022 with the exception of its sign/verify optional context algorithm property which it only accepts as a zero-length value, otherwise throws "not implemented" due to lack of this option in the underlying C++ implementation.
  • removes NODE-ED25518 and NODE-ED448 algorithms (replaced by Ed25519 and Ed448)
  • removes NODE-X25519 and NODE-X448 ECDH namedCurve values (replaced by X25519 and X448 algorithms)
  • simplifies the webcrypto docs by utilizing the AlgorithmIdentifier "class". This means that other than the other NODE-* extensions the only "classes" documented follow the defined WebCryptoAPI dictionaries.

@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Mar 29, 2022

Review requested:

@nodejs-github-bot nodejs-github-bot added lib / src needs-ci labels Mar 29, 2022
@panva panva added crypto notable-change webcrypto semver-minor commit-queue-squash experimental labels Mar 29, 2022
@panva
Copy link
Member Author

@panva panva commented Mar 29, 2022

Marking as never-stale as we wait for a consensus on the draft moving forward.

@panva panva added never-stale wip labels Mar 29, 2022
@panva panva marked this pull request as ready for review Mar 29, 2022
@panva
Copy link
Member Author

@panva panva commented Mar 29, 2022

Since the entire webcrypto module is experimental I feel like this could land and replace the proprietary extension before the draft moves forward. Pending further thoughts

/cc @jasnell @tniessen

@tniessen
Copy link
Member

@tniessen tniessen commented Mar 29, 2022

Since the entire webcrypto module is experimental I feel like this could land and replace the proprietary extension before the draft moves forward. Pending further thoughts

Ah, the usual Web Crypto dilemma... There is not much point in implementing Web Crypto except compatibility across runtimes, yet the set of compatible features is extremely small. I don't see much point in landing this before WICG/proposals#46 is resolved and other runtimes consider implementing it.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@panva
Copy link
Member Author

@panva panva commented Mar 31, 2022

There is not much point in implementing Web Crypto except compatibility across runtimes

That seems like a pretty strong point towards removing the other NODE-* extensions, isn't it?

@tniessen
Copy link
Member

@tniessen tniessen commented Mar 31, 2022

There is not much point in implementing Web Crypto except compatibility across runtimes

That seems like a pretty strong point towards removing the other NODE-* extensions, isn't it?

I don't see much point in having them except that the crypto module doesn't support JWK at the moment (thanks for pointing out that it does @panva!).

That doesn't mean I am in favor of removing them, I just personally don't think they are relevant.

@panva panva removed the wip label Apr 1, 2022
@panva panva force-pushed the webcrypto-secure-curves branch 2 times, most recently from 9489e11 to 2830bbb Compare Apr 3, 2022
@tniessen
Copy link
Member

@tniessen tniessen commented Apr 6, 2022

@panva @jasnell I'm trying to make sense of the node-specific extensions. Much of it surprises me. For example, should this really work?

await crypto.webcrypto.subtle.generateKey({
  name: 'NODE-ED25519', // signature algorithm
  namedCurve: 'NODE-X25519' // key exchange algorithm ???
}, true, ['sign'])

@panva
Copy link
Member Author

@panva panva commented Apr 6, 2022

@panva @jasnell I'm trying to make sense of the node-specific extensions. Much of it surprises me. For example, should this really work?

await crypto.webcrypto.subtle.generateKey({
  name: 'NODE-ED25519', // signature algorithm
  namedCurve: 'NODE-X25519' // key exchange algorithm ???
}, true, ['sign'])

It should not. We fixed a number of these for importKey but did not notice for generateKey. The implementation in this PR does not have these issues since it does not piggyback on the ECDSA/ECDH algorithms.

@jasnell
Copy link
Member

@jasnell jasnell commented Apr 6, 2022

Agreed. That's a bug that should get fixed.

@panva panva force-pushed the webcrypto-secure-curves branch from 2830bbb to e2da4ef Compare Apr 13, 2022
@nodejs-github-bot

This comment was marked as outdated.

Copy link
Member

@tniessen tniessen left a comment

Still LGTM :)

@panva
Copy link
Member Author

@panva panva commented Jun 3, 2022

Thank you, I wish CI would cooperate...

@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Jun 3, 2022

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

@panva panva added the commit-queue label Jun 4, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue label Jun 4, 2022
@nodejs-github-bot nodejs-github-bot merged commit 7e5da97 into nodejs:master Jun 4, 2022
48 checks passed
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Jun 4, 2022

Landed in 7e5da97

@panva panva deleted the webcrypto-secure-curves branch Jun 4, 2022
italojs pushed a commit to italojs/node that referenced this issue Jun 6, 2022
PR-URL: nodejs#42507
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
danielleadams pushed a commit that referenced this issue Jun 11, 2022
PR-URL: #42507
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
danielleadams added a commit that referenced this issue Jun 11, 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
* src:
  * add --openssl-shared-config option (Daniel Bevenius) #43124
  * add OpenSSL config appname (Daniel Bevenius) #43124
  * add initial shadow realm support (Chengzhong Wu) #42869
@danielleadams danielleadams mentioned this pull request Jun 11, 2022
danielleadams added a commit to danielleadams/node that referenced this issue Jun 11, 2022
Notable changes:

* crypto:
  * remove Node.js-specific webcrypto extensions (Filip Skokan) nodejs#43310
  * add CFRG curves to Web Crypto API (Filip Skokan) nodejs#42507
* report:
  * add more heap infos in process report (theanarkh) nodejs#43116
* src:
  * add --openssl-shared-config option (Daniel Bevenius) nodejs#43124
  * add OpenSSL config appname (Daniel Bevenius) nodejs#43124
  * add initial shadow realm support (Chengzhong Wu) nodejs#42869

PR-URL: nodejs#43385
danielleadams pushed a commit that referenced this issue Jun 13, 2022
PR-URL: #42507
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
danielleadams added a commit that referenced this issue Jun 13, 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
danielleadams pushed a commit that referenced this issue Jun 13, 2022
PR-URL: #42507
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
danielleadams added a commit that referenced this issue Jun 13, 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
danielleadams added a commit that referenced this issue Jun 13, 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
danielleadams added a commit that referenced this issue 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
danielleadams added a commit that referenced this issue 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
danielleadams added a commit that referenced this issue Jun 15, 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
danielleadams added a commit that referenced this issue Jun 16, 2022
Notable changes:

* crypto:
  * remove Node.js-specific webcrypto extensions (Filip Skokan) #43310
  * add CFRG curves to Web Crypto API (Filip Skokan) #42507
* dns:
  * accept `'IPv4'` and `'IPv6'` for `family` (Antoine du Hamel) #43054
* report:
  * add more heap infos in process report (theanarkh) #43116

PR-URL: #43385
danielleadams added a commit that referenced this issue Jun 16, 2022
Notable changes:

* crypto:
  * remove Node.js-specific webcrypto extensions (Filip Skokan) #43310
  * add CFRG curves to Web Crypto API (Filip Skokan) #42507
* dns:
  * accept `'IPv4'` and `'IPv6'` for `family` (Antoine du Hamel) #43054
* report:
  * add more heap infos in process report (theanarkh) #43116

PR-URL: #43385
danielleadams added a commit that referenced this issue Jun 16, 2022
Notable changes:

* crypto:
  * remove Node.js-specific webcrypto extensions (Filip Skokan) #43310
  * add CFRG curves to Web Crypto API (Filip Skokan) #42507
* dns:
  * accept `'IPv4'` and `'IPv6'` for `family` (Antoine du Hamel) #43054
* report:
  * add more heap infos in process report (theanarkh) #43116

PR-URL: #43385
LiviaMedeiros pushed a commit to LiviaMedeiros/done that referenced this issue Jun 28, 2022
PR-URL: nodejs/node#42507
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
LiviaMedeiros pushed a commit to LiviaMedeiros/done that referenced this issue Jun 28, 2022
Notable changes:

* crypto:
  * remove Node.js-specific webcrypto extensions (Filip Skokan) nodejs/node#43310
  * add CFRG curves to Web Crypto API (Filip Skokan) nodejs/node#42507
* dns:
  * accept `'IPv4'` and `'IPv6'` for `family` (Antoine du Hamel) nodejs/node#43054
* report:
  * add more heap infos in process report (theanarkh) nodejs/node#43116

PR-URL: nodejs/node#43385
targos pushed a commit that referenced this issue Jul 12, 2022
PR-URL: #42507
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready commit-queue-squash crypto experimental lib / src needs-ci never-stale notable-change review wanted semver-minor webcrypto
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants
X Tutup