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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
tniessen authored and MylesBorins committed Nov 29, 2018
1 parent 018a868 commit d4b5f9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Original file line number Diff line number Diff line change
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 d4b5f9f

Please sign in to comment.