FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

crypto: generateKeyPair('ec') should not support NODE-ED* and NODE-X* by panva · Pull Request #37063 · nodejs/node · GitHub

/ node Public

crypto: generateKeyPair('ec') should not support NODE-ED* and NODE-X* - #37063

Closed
panva wants to merge 4 commits into
nodejs:masterfrom
panva:fix-37055
Closed

crypto: generateKeyPair('ec') should not support NODE-ED* and NODE-X*#37063
panva wants to merge 4 commits into
nodejs:masterfrom
panva:fix-37055

Conversation

panva commented Jan 25, 2021
edited
Loading

Copy link
Copy Markdown
Member

The following "curves" were added to the 'ec' key type in #36879.

  • NODE-ED25519
  • NODE-ED448
  • NODE-X25519
  • NODE-X448

However, none of these are pure EC curves, for example, Curve25519 does not work with ECDSA, which is one of the reasons why crypto.getCurves() does not include Curve25519. This PR makes these "curves" only recognized from the Web Cryptography API experimental interface.

Fixes #37055

cc @jasnell @tniessen

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. labels Jan 25, 2021

Copy link
Copy Markdown
Collaborator

Comment thread lib/internal/crypto/ec.js Outdated

tniessen 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this is the only public API change (outside of WebCrypto) from the referenced PR, but I'm not 100% sure. It definitely fixes the problem with generateKeyPair.

Comment thread lib/internal/crypto/ec.js Outdated

panva commented Jan 25, 2021

Copy link
Copy Markdown
Member Author

I still have to manage to change KeyObjectHandle::InitEDRaw to accomodate for the revert in GetCurveFromName

Comment thread src/crypto/crypto_ecdh.cc Outdated

panva Jan 25, 2021
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

AFAICT id_ is only used to discern between X25519, X448 and then it throws everything else in the default bucket anyway, therefore returning the specific EC curve ids is not necessary and using GetOKPCurveFromName is ok.

tniessen requested a review from jasnell January 25, 2021 15:43

Copy link
Copy Markdown
Collaborator

panva added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Jan 25, 2021
panva added a commit that referenced this pull request Jan 27, 2021
Fixes #37055

PR-URL: #37063
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>

panva commented Jan 27, 2021

Copy link
Copy Markdown
Member Author

Landed in 8b65004

panva closed this Jan 27, 2021
targos pushed a commit that referenced this pull request Feb 2, 2021
Fixes #37055

PR-URL: #37063
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
targos mentioned this pull request Feb 2, 2021
panva deleted the fix-37055 branch October 13, 2022 09:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 outstanding review comments, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

generateKeyPair('ec') should not support NODE-ED* and NODE-X*

6 participants


Back | FazBrowse Home | New Git URL