Skip to content

crypto: diffieHellman throw error on invalid object - #37016

Closed
Lxxyx wants to merge 1 commit into
nodejs:masterfrom
Lxxyx:crypto-diffieHellman-throw-error-on-null
Closed

crypto: diffieHellman throw error on invalid object#37016
Lxxyx wants to merge 1 commit into
nodejs:masterfrom
Lxxyx:crypto-diffieHellman-throw-error-on-null

Conversation

@Lxxyx

Copy link
Copy Markdown
Member
constcrypto=require('crypto')crypto.diffieHellman(null)

Before:

node:internal/crypto/diffiehellman:297
const { privateKey, publicKey } = options;
^
TypeError: Cannot destructure property 'privateKey' of 'options' as it is null.
at Object.diffieHellman (node:internal/crypto/diffiehellman:297:11)

After:

TypeError [ERR_INVALID_ARG_TYPE]: The "options" argument must be of type object. Received null
at Object.diffieHellman (node:internal/crypto/diffiehellman:293:3)

@nodejs-github-botnodejs-github-bot added the crypto Issues and PRs related to the crypto subsystem. label Jan 21, 2021
Comment threadtest/parallel/test-crypto-dh-stateless.js Outdated
@Lxxyx
Lxxyxforce-pushed the crypto-diffieHellman-throw-error-on-null branch from feb1519 to 3743807CompareJanuary 21, 2021 12:22
@RaisinTenRaisinTen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 21, 2021
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Trott pushed a commit that referenced this pull request Jan 23, 2021
PR-URL: #37016
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@Trott

Copy link
Copy Markdown
Member

Landed in dbdc14b

@TrottTrott closed this Jan 23, 2021
@Lxxyx
Lxxyx deleted the crypto-diffieHellman-throw-error-on-null branch January 23, 2021 12:24
targos pushed a commit that referenced this pull request Feb 2, 2021
PR-URL: #37016
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@targostargos mentioned this pull request Feb 2, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.cryptoIssues and PRs related to the crypto subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@Lxxyx@nodejs-github-bot@Trott@jasnell@lpinca@targos@cjihrig@aduh95@RaisinTen