GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: refactor DH groups to delete crypto_groups.h by tniessen · Pull Request #43896 · nodejs/node

Conversation

@tniessen

@tniessen tniessen commented Jul 18, 2022

Copy link
Copy Markdown
Member

Rewrite FindDiffieHellmanGroup() using OpenSSL helper functions to obtain the required constants directly, instead of loading them from our own crypto_groups.h and converting them to BIGNUMs.

This also removes the need for the struct modp_group, so we can delete crypto_groups.h altogether.

cc @nodejs/cpp-reviewers

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@tniessen
src: refactor DH groups to delete crypto_groups.h
9403bff
Rewrite FindDiffieHellmanGroup() using OpenSSL helper functions to
obtain the required constants directly, instead of loading them from
our own crypto_groups.h and converting them to BIGNUMs.

This also removes the need for the struct modp_group, so we can delete
crypto_groups.h altogether.
@tniessen tniessen added crypto Issues and PRs related to the crypto subsystem. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. labels Jul 18, 2022
@nodejs-github-bot

nodejs-github-bot commented Jul 18, 2022

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jul 18, 2022
@panva panva added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 19, 2022
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 19, 2022
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@tniessen tniessen removed the lib / src Issues and PRs involving general changes in the lib/ or src/ directories. label Jul 19, 2022
@nodejs-github-bot

nodejs-github-bot commented Jul 19, 2022

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jul 20, 2022
CI Reliability 2022-07-20 nodejs/reliability#326
Open
CI Reliability 2022-07-21 nodejs/reliability#327
Open
@tniessen tniessen added the review wanted PRs that need review. label Jul 21, 2022
This was referenced Jul 22, 2022
CI Reliability 2022-07-22 nodejs/reliability#328
Open
CI Reliability 2022-07-23 nodejs/reliability#329
Open
@tniessen

tniessen commented Jul 23, 2022

Copy link
Copy Markdown
Member Author

@nodejs/cpp-reviewers @nodejs/crypto To aid reviews: this PR mainly changes how we obtain the large prime numbers making up standardized DH groups. Instead of defining these constants in crypto_groups.h, we can retrieve the values from OpenSSL.

An existing test guarantees that the constants remain correct:

node/test/pummel/test-crypto-dh-hash.js

Lines 40 to 59 in dffcfdd

const hashes = {
modp1: '630e9acd2cc63f7e80d8507624ba60ac0757201a',
modp2: '18f7aa964484137f57bca64b21917a385b6a0b60',
modp5: 'c0a8eec0c2c8a5ec2f9c26f9661eb339a010ec61',
modp14: 'af5455606fe74cec49782bb374e4c63c9b1d132c',
modp15: '7bdd39e5cdbb9748113933e5c2623b559c534e74',
modp16: 'daea5277a7ad0116e734a8e0d2f297ef759d1161',
modp17: '3b62aaf0142c2720f0bf26a9589b0432c00eadc1',
modp18: 'a870b491bbbec9b131ae9878d07449d32e54f160',
};
for (const name in hashes) {
const group = crypto.getDiffieHellman(name);
const private_key = group.getPrime('hex');
const hash1 = hashes[name];
const hash2 = crypto.createHash('sha1')
.update(private_key.toUpperCase()).digest('hex');
assert.strictEqual(hash1, hash2);
assert.strictEqual(group.getGenerator('hex'), '02');
}

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

panva
panva approved these changes Jul 23, 2022
View reviewed changes
@tniessen tniessen added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jul 23, 2022
@github-actions github-actions Bot mentioned this pull request Jul 24, 2022
CI Reliability 2022-07-24 nodejs/reliability#330
Open
17 tasks
tniessen added a commit to tniessen/node that referenced this pull request Jul 25, 2022
@tniessen
doc: list supported MODP groups explicitly
05d9357
Instead of referring users to perl to find information about supported
MODP groups in crypto_groups.h, explicitly list the groups with their
respective strengths and with references to the defining RFC sections.

Refs: nodejs#43896
@tniessen tniessen mentioned this pull request Jul 25, 2022
doc: list supported MODP groups explicitly #43986
Merged
@tniessen tniessen added the commit-queue PRs queued for automated landing through the Commit Queue. label Jul 25, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Jul 25, 2022
@nodejs-github-bot
nodejs-github-bot merged commit 3e6e908 into nodejs:main Jul 25, 2022
@nodejs-github-bot

nodejs-github-bot commented Jul 25, 2022

Copy link
Copy Markdown
Collaborator

Landed in 3e6e908

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

danielleadams pushed a commit that referenced this pull request Jul 26, 2022
@tniessen @danielleadams
src: refactor DH groups to delete crypto_groups.h
bf8f2e2
Rewrite FindDiffieHellmanGroup() using OpenSSL helper functions to
obtain the required constants directly, instead of loading them from
our own crypto_groups.h and converting them to BIGNUMs.

This also removes the need for the struct modp_group, so we can delete
crypto_groups.h altogether.

PR-URL: #43896
Reviewed-By: Filip Skokan <[email protected]>
@danielleadams danielleadams mentioned this pull request Jul 26, 2022
v18.7.0 proposal #43993
Merged
tniessen added a commit to tniessen/node that referenced this pull request Jul 27, 2022
@tniessen
doc: remove old reference from crypto/README.md
2ba0b60
The referenced header file does not exist anymore.

Refs: nodejs#43896
@tniessen tniessen mentioned this pull request Jul 27, 2022
doc: remove old reference from crypto/README.md #44012
Closed
ruyadorno pushed a commit that referenced this pull request Aug 23, 2022
@tniessen @ruyadorno
doc: remove old reference from crypto/README.md
d23dfa4
The referenced header file does not exist anymore.

Refs: #43896

PR-URL: #44012
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Feng Yu <[email protected]>
@targos targos added the dont-land-on-v16.x label Sep 5, 2022
targos pushed a commit that referenced this pull request Sep 5, 2022
@tniessen @targos
doc: list supported MODP groups explicitly
fa45544
Instead of referring users to perl to find information about supported
MODP groups in crypto_groups.h, explicitly list the groups with their
respective strengths and with references to the defining RFC sections.

Refs: #43896

PR-URL: #43986
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
targos pushed a commit that referenced this pull request Sep 5, 2022
@tniessen @targos
doc: remove old reference from crypto/README.md
d41dfdc
The referenced header file does not exist anymore.

Refs: #43896

PR-URL: #44012
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Feng Yu <[email protected]>
@gengjiawen gengjiawen mentioned this pull request Sep 12, 2022
build: remove redundant entry in crypto #44604
Merged
juanarbol pushed a commit that referenced this pull request Oct 11, 2022
@tniessen @juanarbol
doc: list supported MODP groups explicitly
c071592
Instead of referring users to perl to find information about supported
MODP groups in crypto_groups.h, explicitly list the groups with their
respective strengths and with references to the defining RFC sections.

Refs: #43896

PR-URL: #43986
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
juanarbol pushed a commit that referenced this pull request Oct 11, 2022
@tniessen @juanarbol
doc: remove old reference from crypto/README.md
88b0d40
The referenced header file does not exist anymore.

Refs: #43896

PR-URL: #44012
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Feng Yu <[email protected]>
codebytere added a commit to electron/electron that referenced this pull request Oct 13, 2022
@codebytere
src: refactor DH groups to delete crypto_groups.h
1845867
nodejs/node#43896
codebytere added a commit to electron/electron that referenced this pull request Oct 13, 2022
@codebytere
src: refactor DH groups to delete crypto_groups.h
b83cb0c
nodejs/node#43896
codebytere added a commit to electron/electron that referenced this pull request Oct 13, 2022
@codebytere
src: refactor DH groups to delete crypto_groups.h
a010057
nodejs/node#43896
codebytere added a commit to electron/electron that referenced this pull request Oct 13, 2022
@codebytere
src: refactor DH groups to delete crypto_groups.h
dfe7c4f
nodejs/node#43896
codebytere added a commit to electron/electron that referenced this pull request Oct 17, 2022
@codebytere
src: refactor DH groups to delete crypto_groups.h
2407320
nodejs/node#43896
codebytere added a commit to electron/electron that referenced this pull request Oct 19, 2022
@codebytere
src: refactor DH groups to delete crypto_groups.h
4909fd0
nodejs/node#43896
codebytere added a commit to electron/electron that referenced this pull request Oct 19, 2022
@codebytere
src: refactor DH groups to delete crypto_groups.h
3d3d0f7
nodejs/node#43896
codebytere added a commit to electron/electron that referenced this pull request Oct 24, 2022
@codebytere
src: refactor DH groups to delete crypto_groups.h
388ef09
nodejs/node#43896
codebytere added a commit to electron/electron that referenced this pull request Nov 8, 2022
@codebytere
src: refactor DH groups to delete crypto_groups.h
4732be9
nodejs/node#43896
codebytere added a commit to electron/electron that referenced this pull request Nov 8, 2022
@codebytere
src: refactor DH groups to delete crypto_groups.h
4ea70ea
nodejs/node#43896
codebytere added a commit to electron/electron that referenced this pull request Nov 10, 2022
@codebytere @patchup
chore: upgrade to Node.js v18 (#35999)
75d2caf
* chore: update to Node.js v18

* child_process: improve argument validation

nodejs/node#41305

* bootstrap: support configure-time user-land snapshot

nodejs/node#42466

* chore: update GN patch

* src: disambiguate terms used to refer to builtins and addons

nodejs/node#44135

* src: use a typed array internally for process._exiting

nodejs/node#43883

* chore: lib/internal/bootstrap -> lib/internal/process

* src: disambiguate terms used to refer to builtins and addons

nodejs/node#44135

* chore: remove redudant browserGlobals patch

* chore: update BoringSSL patch

* src: allow embedder-provided PageAllocator in NodePlatform

nodejs/node#38362

* chore: fixup Node.js crypto tests

- nodejs/node#44171
- nodejs/node#41600

* lib: add Promise methods to avoid-prototype-pollution lint rule

nodejs/node#43849

* deps: update V8 to 10.1

nodejs/node#42657

* src: add kNoBrowserGlobals flag for Environment

nodejs/node#40532

* chore: consolidate asar initialization patches

* deps: update V8 to 10.1

nodejs/node#42657

* deps: update V8 to 9.8

nodejs/node#41610

* src,crypto: remove AllocatedBuffers from crypto_spkac

nodejs/node#40752

* build: enable V8's shared read-only heap

nodejs/node#42809

* src: fix ssize_t error from nghttp2.h

nodejs/node#44393

* chore: fixup ESM patch

* chore: fixup patch indices

* src: merge NativeModuleEnv into NativeModuleLoader

nodejs/node#43824

* [API] Pass OOMDetails to OOMErrorCallback

https://chromium-review.googlesource.com/c/v8/v8/+/3647827

* src: iwyu in cleanup_queue.cc

* src: return Maybe from a couple of functions

nodejs/node#39603

* src: clean up embedder API

nodejs/node#35897

* src: refactor DH groups to delete crypto_groups.h

nodejs/node#43896

* deps,src: use SIMD for normal base64 encoding

nodejs/node#39775

* chore: remove deleted source file

* chore: update patches

* chore: remove deleted source file

* lib: add fetch

nodejs/node#41749

* chore: remove nonexistent node specs

* test: split report OOM tests

nodejs/node#44389

* src: trace fs async api

nodejs/node#44057

* http: trace http request / response

nodejs/node#44102

* test: split test-crypto-dh.js

nodejs/node#40451

* crypto: introduce X509Certificate API

nodejs/node#36804

* src: split property helpers from node::Environment

nodejs/node#44056

* nodejs/node#38905

bootstrap: implement run-time user-land snapshots via --build-snapshot and --snapshot-blob

* lib,src: implement WebAssembly Web API

nodejs/node#42701

* fixup! deps,src: use SIMD for normal base64 encoding

* fixup! src: refactor DH groups to delete crypto_groups.h

* chore: fixup base64 GN file

* fix: check that node::InitializeContext() returns true

* chore: delete _noBrowserGlobals usage

* chore: disable fetch in renderer procceses

* dns: default to verbatim=true in dns.lookup()

nodejs/node#39987

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
guangwong pushed a commit to noslate-project/node that referenced this pull request Jan 3, 2023
@tniessen @guangwong
doc: list supported MODP groups explicitly
2c891d5
Instead of referring users to perl to find information about supported
MODP groups in crypto_groups.h, explicitly list the groups with their
respective strengths and with references to the defining RFC sections.

Refs: nodejs/node#43896

PR-URL: nodejs/node#43986
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
guangwong pushed a commit to noslate-project/node that referenced this pull request Jan 3, 2023
@tniessen @guangwong
doc: remove old reference from crypto/README.md
def0ebf
The referenced header file does not exist anymore.

Refs: nodejs/node#43896

PR-URL: nodejs/node#44012
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Feng Yu <[email protected]>
guangwong pushed a commit to noslate-project/node that referenced this pull request Jan 3, 2023
@tniessen @guangwong
doc: list supported MODP groups explicitly
48314f5
Instead of referring users to perl to find information about supported
MODP groups in crypto_groups.h, explicitly list the groups with their
respective strengths and with references to the defining RFC sections.

Refs: nodejs/node#43896

PR-URL: nodejs/node#43986
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
guangwong pushed a commit to noslate-project/node that referenced this pull request Jan 3, 2023
@tniessen @guangwong
doc: remove old reference from crypto/README.md
931a30c
The referenced header file does not exist anymore.

Refs: nodejs/node#43896

PR-URL: nodejs/node#44012
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Feng Yu <[email protected]>
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
@codebytere @patchup @khalwa
chore: upgrade to Node.js v18 (electron#35999)
b19d67a
* chore: update to Node.js v18

* child_process: improve argument validation

nodejs/node#41305

* bootstrap: support configure-time user-land snapshot

nodejs/node#42466

* chore: update GN patch

* src: disambiguate terms used to refer to builtins and addons

nodejs/node#44135

* src: use a typed array internally for process._exiting

nodejs/node#43883

* chore: lib/internal/bootstrap -> lib/internal/process

* src: disambiguate terms used to refer to builtins and addons

nodejs/node#44135

* chore: remove redudant browserGlobals patch

* chore: update BoringSSL patch

* src: allow embedder-provided PageAllocator in NodePlatform

nodejs/node#38362

* chore: fixup Node.js crypto tests

- nodejs/node#44171
- nodejs/node#41600

* lib: add Promise methods to avoid-prototype-pollution lint rule

nodejs/node#43849

* deps: update V8 to 10.1

nodejs/node#42657

* src: add kNoBrowserGlobals flag for Environment

nodejs/node#40532

* chore: consolidate asar initialization patches

* deps: update V8 to 10.1

nodejs/node#42657

* deps: update V8 to 9.8

nodejs/node#41610

* src,crypto: remove AllocatedBuffers from crypto_spkac

nodejs/node#40752

* build: enable V8's shared read-only heap

nodejs/node#42809

* src: fix ssize_t error from nghttp2.h

nodejs/node#44393

* chore: fixup ESM patch

* chore: fixup patch indices

* src: merge NativeModuleEnv into NativeModuleLoader

nodejs/node#43824

* [API] Pass OOMDetails to OOMErrorCallback

https://chromium-review.googlesource.com/c/v8/v8/+/3647827

* src: iwyu in cleanup_queue.cc

* src: return Maybe from a couple of functions

nodejs/node#39603

* src: clean up embedder API

nodejs/node#35897

* src: refactor DH groups to delete crypto_groups.h

nodejs/node#43896

* deps,src: use SIMD for normal base64 encoding

nodejs/node#39775

* chore: remove deleted source file

* chore: update patches

* chore: remove deleted source file

* lib: add fetch

nodejs/node#41749

* chore: remove nonexistent node specs

* test: split report OOM tests

nodejs/node#44389

* src: trace fs async api

nodejs/node#44057

* http: trace http request / response

nodejs/node#44102

* test: split test-crypto-dh.js

nodejs/node#40451

* crypto: introduce X509Certificate API

nodejs/node#36804

* src: split property helpers from node::Environment

nodejs/node#44056

* nodejs/node#38905

bootstrap: implement run-time user-land snapshots via --build-snapshot and --snapshot-blob

* lib,src: implement WebAssembly Web API

nodejs/node#42701

* fixup! deps,src: use SIMD for normal base64 encoding

* fixup! src: refactor DH groups to delete crypto_groups.h

* chore: fixup base64 GN file

* fix: check that node::InitializeContext() returns true

* chore: delete _noBrowserGlobals usage

* chore: disable fetch in renderer procceses

* dns: default to verbatim=true in dns.lookup()

nodejs/node#39987

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
@Clem-Fern Clem-Fern mentioned this pull request Aug 18, 2023
SSH: unable to connect to ssh server using kex algorithm diffie-hellman-group1-sha1 Eugeny/tabby#8840
Closed
@Eugeny Eugeny mentioned this pull request Aug 21, 2023
[Feature Request]: Re-add support for modp1 and modp2 Diffie-Hellman groups following Node update electron/electron#39603
Closed
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@panva panva panva approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. review wanted PRs that need review.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@tniessen @nodejs-github-bot @panva @targos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.