Skip to content

Commit b5f5585

Browse files
bmacnaughtonjasnell
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
1 parent b6e9f99 commit b5f5585

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: 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)