|
@ -63,6 +63,7 @@ static const int X509_NAME_FLAGS = ASN1_STRFLGS_ESC_CTRL |
|
|
namespace node { |
|
|
namespace node { |
|
|
namespace crypto { |
|
|
namespace crypto { |
|
|
|
|
|
|
|
|
|
|
|
using v8::AccessorSignature; |
|
|
using v8::Array; |
|
|
using v8::Array; |
|
|
using v8::Boolean; |
|
|
using v8::Boolean; |
|
|
using v8::Context; |
|
|
using v8::Context; |
|
@ -315,7 +316,8 @@ void SecureContext::Initialize(Environment* env, Local<Object> target) { |
|
|
nullptr, |
|
|
nullptr, |
|
|
env->as_external(), |
|
|
env->as_external(), |
|
|
DEFAULT, |
|
|
DEFAULT, |
|
|
static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
|
|
static_cast<PropertyAttribute>(ReadOnly | DontDelete), |
|
|
|
|
|
AccessorSignature::New(env->isolate(), t)); |
|
|
|
|
|
|
|
|
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "SecureContext"), |
|
|
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "SecureContext"), |
|
|
t->GetFunction()); |
|
|
t->GetFunction()); |
|
@ -1146,9 +1148,7 @@ int SecureContext::TicketKeyCallback(SSL* ssl, |
|
|
|
|
|
|
|
|
void SecureContext::CtxGetter(Local<String> property, |
|
|
void SecureContext::CtxGetter(Local<String> property, |
|
|
const PropertyCallbackInfo<Value>& info) { |
|
|
const PropertyCallbackInfo<Value>& info) { |
|
|
HandleScope scope(info.GetIsolate()); |
|
|
SSL_CTX* ctx = Unwrap<SecureContext>(info.This())->ctx_; |
|
|
|
|
|
|
|
|
SSL_CTX* ctx = Unwrap<SecureContext>(info.Holder())->ctx_; |
|
|
|
|
|
Local<External> ext = External::New(info.GetIsolate(), ctx); |
|
|
Local<External> ext = External::New(info.GetIsolate(), ctx); |
|
|
info.GetReturnValue().Set(ext); |
|
|
info.GetReturnValue().Set(ext); |
|
|
} |
|
|
} |
|
@ -1216,7 +1216,8 @@ void SSLWrap<Base>::AddMethods(Environment* env, Local<FunctionTemplate> t) { |
|
|
nullptr, |
|
|
nullptr, |
|
|
env->as_external(), |
|
|
env->as_external(), |
|
|
DEFAULT, |
|
|
DEFAULT, |
|
|
static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
|
|
static_cast<PropertyAttribute>(ReadOnly | DontDelete), |
|
|
|
|
|
AccessorSignature::New(env->isolate(), t)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2203,10 +2204,8 @@ void SSLWrap<Base>::CertCbDone(const FunctionCallbackInfo<Value>& args) { |
|
|
|
|
|
|
|
|
template <class Base> |
|
|
template <class Base> |
|
|
void SSLWrap<Base>::SSLGetter(Local<String> property, |
|
|
void SSLWrap<Base>::SSLGetter(Local<String> property, |
|
|
const PropertyCallbackInfo<Value>& info) { |
|
|
const PropertyCallbackInfo<Value>& info) { |
|
|
HandleScope scope(info.GetIsolate()); |
|
|
SSL* ssl = Unwrap<Base>(info.This())->ssl_; |
|
|
|
|
|
|
|
|
SSL* ssl = Unwrap<Base>(info.Holder())->ssl_; |
|
|
|
|
|
Local<External> ext = External::New(info.GetIsolate(), ssl); |
|
|
Local<External> ext = External::New(info.GetIsolate(), ssl); |
|
|
info.GetReturnValue().Set(ext); |
|
|
info.GetReturnValue().Set(ext); |
|
|
} |
|
|
} |
|
@ -4144,12 +4143,14 @@ void DiffieHellman::Initialize(Environment* env, Local<Object> target) { |
|
|
env->SetProtoMethod(t, "setPublicKey", SetPublicKey); |
|
|
env->SetProtoMethod(t, "setPublicKey", SetPublicKey); |
|
|
env->SetProtoMethod(t, "setPrivateKey", SetPrivateKey); |
|
|
env->SetProtoMethod(t, "setPrivateKey", SetPrivateKey); |
|
|
|
|
|
|
|
|
t->InstanceTemplate()->SetAccessor(env->verify_error_string(), |
|
|
t->InstanceTemplate()->SetAccessor( |
|
|
DiffieHellman::VerifyErrorGetter, |
|
|
env->verify_error_string(), |
|
|
nullptr, |
|
|
DiffieHellman::VerifyErrorGetter, |
|
|
env->as_external(), |
|
|
nullptr, |
|
|
DEFAULT, |
|
|
env->as_external(), |
|
|
attributes); |
|
|
DEFAULT, |
|
|
|
|
|
attributes, |
|
|
|
|
|
AccessorSignature::New(env->isolate(), t)); |
|
|
|
|
|
|
|
|
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "DiffieHellman"), |
|
|
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "DiffieHellman"), |
|
|
t->GetFunction()); |
|
|
t->GetFunction()); |
|
@ -4164,12 +4165,14 @@ void DiffieHellman::Initialize(Environment* env, Local<Object> target) { |
|
|
env->SetProtoMethod(t2, "getPublicKey", GetPublicKey); |
|
|
env->SetProtoMethod(t2, "getPublicKey", GetPublicKey); |
|
|
env->SetProtoMethod(t2, "getPrivateKey", GetPrivateKey); |
|
|
env->SetProtoMethod(t2, "getPrivateKey", GetPrivateKey); |
|
|
|
|
|
|
|
|
t2->InstanceTemplate()->SetAccessor(env->verify_error_string(), |
|
|
t2->InstanceTemplate()->SetAccessor( |
|
|
DiffieHellman::VerifyErrorGetter, |
|
|
env->verify_error_string(), |
|
|
nullptr, |
|
|
DiffieHellman::VerifyErrorGetter, |
|
|
env->as_external(), |
|
|
nullptr, |
|
|
DEFAULT, |
|
|
env->as_external(), |
|
|
attributes); |
|
|
DEFAULT, |
|
|
|
|
|
attributes, |
|
|
|
|
|
AccessorSignature::New(env->isolate(), t2)); |
|
|
|
|
|
|
|
|
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "DiffieHellmanGroup"), |
|
|
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "DiffieHellmanGroup"), |
|
|
t2->GetFunction()); |
|
|
t2->GetFunction()); |
|
|