Skip to content

Commit b2b4808

Browse files
tniessenjasnell
authored andcommitted
crypto: simplify error handling in ECDH::New
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>
1 parent e4fdedd commit b2b4808

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_crypto.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -4342,7 +4342,7 @@ void ECDH::New(const FunctionCallbackInfo<Value>& args) {
43424342
MarkPopErrorOnReturn mark_pop_error_on_return;
43434343

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

43484348
int nid = OBJ_sn2nid(*curve);

0 commit comments

Comments
 (0)