Skip to content

Commit

Permalink
crypto: make DH error messages consistent
Browse files Browse the repository at this point in the history
Refs: #31178
Refs: #31445

PR-URL: #31873
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
tniessen authored and addaleax committed Mar 11, 2020
1 parent e4a72d6 commit 1b9a62c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Expand Up @@ -5217,7 +5217,7 @@ void DiffieHellman::DiffieHellmanGroup(
const node::Utf8Value group_name(env->isolate(), args[0]);
const modp_group* group = FindDiffieHellmanGroup(*group_name);
if (group == nullptr)
return THROW_ERR_CRYPTO_UNKNOWN_DH_GROUP(env, "Unknown group");
return THROW_ERR_CRYPTO_UNKNOWN_DH_GROUP(env);

initialized = diffieHellman->Init(group->prime,
group->prime_size,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-dh.js
Expand Up @@ -392,7 +392,7 @@ assert.throws(
{
name: 'Error',
code: 'ERR_CRYPTO_UNKNOWN_DH_GROUP',
message: 'Unknown group'
message: 'Unknown DH group'
},
'crypto.getDiffieHellman(\'unknown-group\') ' +
'failed to throw the expected error.'
Expand Down

0 comments on commit 1b9a62c

Please sign in to comment.