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 rvagg committed Nov 28, 2018
1 parent 11a8a74 commit eb5f017
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 eb5f017

Please sign in to comment.