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: remove default encoding from DiffieHellman #49169

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

tniessen
Copy link
Member

getDefaultEncoding() always returns 'buffer' in Node.js 20.

In diffiehellman.js, this value is always used as input to either toBuf(), encode(), or getArrayBufferOrView(). All of these functions treat any falsy encoding just like 'buffer', so we can safely remove the calls to getDefaultEncoding().

This partially addresses:

// TODO(tniessen): remove all call sites and this function
function getDefaultEncoding() {
return 'buffer';
}

Refs: #47182

getDefaultEncoding() always returns 'buffer' in Node.js 20.

In diffiehellman.js, this value is always used as input to either
toBuf(), encode(), or getArrayBufferOrView(). All of these functions
treat any falsy encoding just like 'buffer', so we can safely remove the
calls to getDefaultEncoding().

Refs: nodejs#47182
@tniessen tniessen added dont-land-on-v16.x dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. labels Aug 14, 2023
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels Aug 14, 2023
tniessen added a commit to tniessen/node that referenced this pull request Aug 14, 2023
@tniessen tniessen added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Aug 14, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 14, 2023
@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.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@tniessen tniessen added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 16, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 16, 2023
@nodejs-github-bot nodejs-github-bot merged commit 7215176 into nodejs:main Aug 16, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in 7215176

tniessen added a commit to tniessen/node that referenced this pull request Aug 16, 2023
debadree25 pushed a commit that referenced this pull request Aug 19, 2023
Refs: #47182
Refs: #47869
Refs: #47943
Refs: #47998
Refs: #49140
Refs: #49145
Refs: #49167
Refs: #49169
PR-URL: #49170
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Sep 10, 2023
getDefaultEncoding() always returns 'buffer' in Node.js 20.

In diffiehellman.js, this value is always used as input to either
toBuf(), encode(), or getArrayBufferOrView(). All of these functions
treat any falsy encoding just like 'buffer', so we can safely remove the
calls to getDefaultEncoding().

Refs: #47182
PR-URL: #49169
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Sep 10, 2023
Refs: #47182
Refs: #47869
Refs: #47943
Refs: #47998
Refs: #49140
Refs: #49145
Refs: #49167
Refs: #49169
PR-URL: #49170
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@UlisesGascon UlisesGascon mentioned this pull request Sep 10, 2023
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. crypto Issues and PRs related to the crypto subsystem. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants