Skip to content

Commit

Permalink
crypto: simplify error handling in ECDH::New
Browse files Browse the repository at this point in the history
The type of the argument is being checked within JS which makes the
type checking in C++ unnecessary.

PR-URL: #23647
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
tniessen authored and MylesBorins committed Oct 30, 2018
1 parent f5cadf6 commit 4ba8977
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Expand Up @@ -4352,7 +4352,7 @@ void ECDH::New(const FunctionCallbackInfo<Value>& args) {
MarkPopErrorOnReturn mark_pop_error_on_return;

// TODO(indutny): Support raw curves?
THROW_AND_RETURN_IF_NOT_STRING(env, args[0], "ECDH curve name");
CHECK(args[0]->IsString());
node::Utf8Value curve(env->isolate(), args[0]);

int nid = OBJ_sn2nid(*curve);
Expand Down

0 comments on commit 4ba8977

Please sign in to comment.