Skip to content
Permalink
Browse files

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>
  • Loading branch information...
bmacnaughton authored and jasnell committed Oct 12, 2018
1 parent b6e9f99 commit b5f5585b0a1ca2bb44af60884b0a4f60d1328f1c
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/node_crypto.cc
@@ -3940,8 +3940,7 @@ void DiffieHellman::Initialize(Environment* env, Local<Object> target) {
env->as_external(),
Signature::New(env->isolate(), t),
/* length */ 0,
// TODO(TimothyGu): should be deny
ConstructorBehavior::kAllow,
ConstructorBehavior::kThrow,
SideEffectType::kHasNoSideEffect);

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

t2->InstanceTemplate()->SetAccessorProperty(

0 comments on commit b5f5585

Please sign in to comment.
You can’t perform that action at this time.