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: make DH error messages consistent #31873

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Expand Up @@ -5690,7 +5690,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