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: https://github.com/nodejs/node/pull/23647 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
7872d7933b
commit
4e2862ad9e
@ -4342,7 +4342,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user