Skip to content

Commit 4ba8977

Browse files
tniessenMylesBorins
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent f5cadf6 commit 4ba8977

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_crypto.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4352,7 +4352,7 @@ void ECDH::New(const FunctionCallbackInfo<Value>& args) {
43524352
MarkPopErrorOnReturn mark_pop_error_on_return;
43534353

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

43584358
int nid = OBJ_sn2nid(*curve);

0 commit comments

Comments
 (0)