Skip to content

Commit 20b3698

Browse files
bmacnaughtonaddaleax
authored andcommitted
src: throw if functions used as constructors in node_crypto.cc
Throw an error if verify_error_getter_templ or verify_error_getter_templ2 are used as constructors. PR-URL: #23582 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
1 parent 541367a commit 20b3698

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/node_crypto.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -3940,8 +3940,7 @@ void DiffieHellman::Initialize(Environment* env, Local<Object> target) {
39403940
env->as_external(),
39413941
Signature::New(env->isolate(), t),
39423942
/* length */ 0,
3943-
// TODO(TimothyGu): should be deny
3944-
ConstructorBehavior::kAllow,
3943+
ConstructorBehavior::kThrow,
39453944
SideEffectType::kHasNoSideEffect);
39463945

39473946
t->InstanceTemplate()->SetAccessorProperty(
@@ -3969,8 +3968,7 @@ void DiffieHellman::Initialize(Environment* env, Local<Object> target) {
39693968
env->as_external(),
39703969
Signature::New(env->isolate(), t2),
39713970
/* length */ 0,
3972-
// TODO(TimothyGu): should be deny
3973-
ConstructorBehavior::kAllow,
3971+
ConstructorBehavior::kThrow,
39743972
SideEffectType::kHasNoSideEffect);
39753973

39763974
t2->InstanceTemplate()->SetAccessorProperty(

0 commit comments

Comments
 (0)