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: diffieHellman throw error on invalid object #37016

Closed

Conversation

Lxxyx
Copy link
Member

@Lxxyx Lxxyx commented Jan 21, 2021

const crypto = 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-bot nodejs-github-bot added the crypto Issues and PRs related to the crypto subsystem. label Jan 21, 2021
test/parallel/test-crypto-dh-stateless.js Outdated Show resolved Hide resolved
@Lxxyx Lxxyx force-pushed the crypto-diffieHellman-throw-error-on-null branch from feb1519 to 3743807 Compare January 21, 2021 12:22
@RaisinTen RaisinTen 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
Collaborator

@nodejs-github-bot
Copy link
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
Member

Trott commented Jan 23, 2021

Landed in dbdc14b

@Trott Trott 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>
@targos targos mentioned this pull request Feb 2, 2021
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants