void SecureContext::Initialize(Environment* env, Handle<Object> target) {
Local<FunctionTemplate> t = FunctionTemplate::New(SecureContext::New);
t->InstanceTemplate()->SetInternalFieldCount(1);
- t->SetClassName(FIXED_ONE_BYTE_STRING(node_isolate, "SecureContext"));
+ t->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "SecureContext"));
NODE_SET_PROTOTYPE_METHOD(t, "init", SecureContext::Init);
NODE_SET_PROTOTYPE_METHOD(t, "setKey", SecureContext::SetKey);
NODE_SET_PROTOTYPE_METHOD(t, "getTicketKeys", SecureContext::GetTicketKeys);
NODE_SET_PROTOTYPE_METHOD(t, "setTicketKeys", SecureContext::SetTicketKeys);
- target->Set(FIXED_ONE_BYTE_STRING(node_isolate, "SecureContext"),
+ target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "SecureContext"),
t->GetFunction());
env->set_secure_context_constructor_template(t);
}
void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
void SecureContext::SetKey(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
void SecureContext::SetCert(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
void SecureContext::AddCACert(const FunctionCallbackInfo<Value>& args) {
bool newCAStore = false;
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
void SecureContext::AddCRL(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
void SecureContext::AddRootCerts(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
void SecureContext::SetCiphers(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
void SecureContext::SetECDHCurve(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
void SecureContext::SetOptions(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
void SecureContext::SetSessionIdContext(
const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
bio = BIO_new(BIO_s_mem());
if (bio == NULL) {
- message = FIXED_ONE_BYTE_STRING(node_isolate,
+ message = FIXED_ONE_BYTE_STRING(args.GetIsolate(),
"SSL_CTX_set_session_id_context error");
} else {
ERR_print_errors(bio);
BIO_get_mem_ptr(bio, &mem);
- message = OneByteString(node_isolate, mem->data, mem->length);
+ message = OneByteString(args.GetIsolate(), mem->data, mem->length);
BIO_free_all(bio);
}
void SecureContext::SetSessionTimeout(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
void SecureContext::Close(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SecureContext* sc = Unwrap<SecureContext>(args.This());
sc->FreeCTXMem();
}
// Takes .pfx or .p12 and password in string or buffer format
void SecureContext::LoadPKCS12(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
BIO* in = NULL;
PKCS12* p12 = NULL;
void SecureContext::SetTicketKeys(const FunctionCallbackInfo<Value>& args) {
#if !defined(OPENSSL_NO_TLSEXT) && defined(SSL_CTX_get_tlsext_ticket_keys)
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
if (args.Length() < 1 ||
!Buffer::HasInstance(args[0]) ||
template <class Base>
void SSLWrap<Base>::GetPeerCertificate(
const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
Environment* env = w->ssl_env();
X509_NAME_FLAGS) > 0) {
BIO_get_mem_ptr(bio, &mem);
info->Set(env->subject_string(),
- OneByteString(node_isolate, mem->data, mem->length));
+ OneByteString(args.GetIsolate(), mem->data, mem->length));
}
(void) BIO_reset(bio);
if (X509_NAME_print_ex(bio, issuer_name, 0, X509_NAME_FLAGS) > 0) {
BIO_get_mem_ptr(bio, &mem);
info->Set(env->issuer_string(),
- OneByteString(node_isolate, mem->data, mem->length));
+ OneByteString(args.GetIsolate(), mem->data, mem->length));
}
(void) BIO_reset(bio);
BIO_get_mem_ptr(bio, &mem);
info->Set(env->subjectaltname_string(),
- OneByteString(node_isolate, mem->data, mem->length));
+ OneByteString(args.GetIsolate(), mem->data, mem->length));
(void) BIO_reset(bio);
}
BN_print(bio, rsa->n);
BIO_get_mem_ptr(bio, &mem);
info->Set(env->modulus_string(),
- OneByteString(node_isolate, mem->data, mem->length));
+ OneByteString(args.GetIsolate(), mem->data, mem->length));
(void) BIO_reset(bio);
BN_print(bio, rsa->e);
BIO_get_mem_ptr(bio, &mem);
info->Set(env->exponent_string(),
- OneByteString(node_isolate, mem->data, mem->length));
+ OneByteString(args.GetIsolate(), mem->data, mem->length));
(void) BIO_reset(bio);
}
ASN1_TIME_print(bio, X509_get_notBefore(peer_cert));
BIO_get_mem_ptr(bio, &mem);
info->Set(env->valid_from_string(),
- OneByteString(node_isolate, mem->data, mem->length));
+ OneByteString(args.GetIsolate(), mem->data, mem->length));
(void) BIO_reset(bio);
ASN1_TIME_print(bio, X509_get_notAfter(peer_cert));
BIO_get_mem_ptr(bio, &mem);
info->Set(env->valid_to_string(),
- OneByteString(node_isolate, mem->data, mem->length));
+ OneByteString(args.GetIsolate(), mem->data, mem->length));
BIO_free_all(bio);
unsigned int md_size, i;
}
info->Set(env->fingerprint_string(),
- OneByteString(node_isolate, fingerprint));
+ OneByteString(args.GetIsolate(), fingerprint));
}
STACK_OF(ASN1_OBJECT)* eku = static_cast<STACK_OF(ASN1_OBJECT)*>(
int j = 0;
for (int i = 0; i < sk_ASN1_OBJECT_num(eku); i++) {
if (OBJ_obj2txt(buf, sizeof(buf), sk_ASN1_OBJECT_value(eku, i), 1) >= 0)
- ext_key_usage->Set(j++, OneByteString(node_isolate, buf));
+ ext_key_usage->Set(j++, OneByteString(args.GetIsolate(), buf));
}
sk_ASN1_OBJECT_pop_free(eku, ASN1_OBJECT_free);
if (BIGNUM* bn = ASN1_INTEGER_to_BN(serial_number, NULL)) {
if (char* buf = BN_bn2hex(bn)) {
info->Set(env->serial_number_string(),
- OneByteString(node_isolate, buf));
+ OneByteString(args.GetIsolate(), buf));
OPENSSL_free(buf);
}
BN_free(bn);
template <class Base>
void SSLWrap<Base>::GetSession(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
template <class Base>
void SSLWrap<Base>::SetSession(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
template <class Base>
void SSLWrap<Base>::LoadSession(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
Environment* env = w->ssl_env();
Local<Object> info = Object::New();
#ifndef OPENSSL_NO_TLSEXT
if (sess->tlsext_hostname == NULL) {
- info->Set(env->servername_string(), False(node_isolate));
+ info->Set(env->servername_string(), False(args.GetIsolate()));
} else {
info->Set(env->servername_string(),
- OneByteString(node_isolate, sess->tlsext_hostname));
+ OneByteString(args.GetIsolate(), sess->tlsext_hostname));
}
#endif
args.GetReturnValue().Set(info);
template <class Base>
void SSLWrap<Base>::IsSessionReused(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
bool yes = SSL_session_reused(w->ssl_);
args.GetReturnValue().Set(yes);
template <class Base>
void SSLWrap<Base>::EndParser(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
w->hello_parser_.End();
}
template <class Base>
void SSLWrap<Base>::Renegotiate(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
template <class Base>
void SSLWrap<Base>::Shutdown(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
template <class Base>
void SSLWrap<Base>::IsInitFinished(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
bool yes = SSL_is_init_finished(w->ssl_);
args.GetReturnValue().Set(yes);
template <class Base>
void SSLWrap<Base>::VerifyError(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
template <class Base>
void SSLWrap<Base>::GetCurrentCipher(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
Environment* env = w->ssl_env();
Local<Object> info = Object::New();
const char* cipher_name = SSL_CIPHER_get_name(c);
- info->Set(env->name_string(), OneByteString(node_isolate, cipher_name));
+ info->Set(env->name_string(), OneByteString(args.GetIsolate(), cipher_name));
const char* cipher_version = SSL_CIPHER_get_version(c);
- info->Set(env->version_string(), OneByteString(node_isolate, cipher_version));
+ info->Set(env->version_string(),
+ OneByteString(args.GetIsolate(), cipher_version));
args.GetReturnValue().Set(info);
}
*data = reinterpret_cast<const unsigned char*>("");
*len = 0;
} else {
- Local<Object> obj = PersistentToLocal(node_isolate, w->npn_protos_);
+ Local<Object> obj = PersistentToLocal(env->isolate(), w->npn_protos_);
*data = reinterpret_cast<const unsigned char*>(Buffer::Data(obj));
*len = Buffer::Length(obj);
}
*outlen = 8;
// set status: unsupported
- w->selected_npn_proto_.Reset(node_isolate, False(node_isolate));
+ w->selected_npn_proto_.Reset(env->isolate(), False(env->isolate()));
return SSL_TLSEXT_ERR_OK;
}
- Local<Object> obj = PersistentToLocal(node_isolate, w->npn_protos_);
+ Local<Object> obj = PersistentToLocal(env->isolate(), w->npn_protos_);
const unsigned char* npn_protos =
reinterpret_cast<const unsigned char*>(Buffer::Data(obj));
size_t len = Buffer::Length(obj);
Handle<Value> result;
switch (status) {
case OPENSSL_NPN_UNSUPPORTED:
- result = Null(node_isolate);
+ result = Null(env->isolate());
break;
case OPENSSL_NPN_NEGOTIATED:
- result = OneByteString(node_isolate, *out, *outlen);
+ result = OneByteString(env->isolate(), *out, *outlen);
break;
case OPENSSL_NPN_NO_OVERLAP:
- result = False(node_isolate);
+ result = False(env->isolate());
break;
default:
break;
}
if (!result.IsEmpty())
- w->selected_npn_proto_.Reset(node_isolate, result);
+ w->selected_npn_proto_.Reset(env->isolate(), result);
return SSL_TLSEXT_ERR_OK;
}
template <class Base>
void SSLWrap<Base>::GetNegotiatedProto(
const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
return args.GetReturnValue().Set(false);
args.GetReturnValue().Set(
- OneByteString(node_isolate, npn_proto, npn_proto_len));
+ OneByteString(args.GetIsolate(), npn_proto, npn_proto_len));
}
template <class Base>
void SSLWrap<Base>::SetNPNProtocols(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Base* w = Unwrap<Base>(args.This());
if (args.Length() < 1 || !Buffer::HasInstance(args[0]))
return ThrowTypeError("Must give a Buffer as first argument");
- w->npn_protos_.Reset(node_isolate, args[0].As<Object>());
+ w->npn_protos_.Reset(args.GetIsolate(), args[0].As<Object>());
}
#endif // OPENSSL_NPN_NEGOTIATED
void Connection::Initialize(Environment* env, Handle<Object> target) {
Local<FunctionTemplate> t = FunctionTemplate::New(Connection::New);
t->InstanceTemplate()->SetInternalFieldCount(1);
- t->SetClassName(FIXED_ONE_BYTE_STRING(node_isolate, "Connection"));
+ t->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "Connection"));
NODE_SET_PROTOTYPE_METHOD(t, "encIn", Connection::EncIn);
NODE_SET_PROTOTYPE_METHOD(t, "clearOut", Connection::ClearOut);
NODE_SET_PROTOTYPE_METHOD(t, "setSNICallback", Connection::SetSNICallback);
#endif
- target->Set(FIXED_ONE_BYTE_STRING(node_isolate, "Connection"),
+ target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "Connection"),
t->GetFunction());
}
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
int Connection::SelectSNIContextCallback_(SSL *s, int *ad, void* arg) {
- HandleScope scope(node_isolate);
-
Connection* conn = static_cast<Connection*>(SSL_get_app_data(s));
Environment* env = conn->env();
+ HandleScope scope(env->isolate());
const char* servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
if (servername) {
- conn->servername_.Reset(node_isolate,
- OneByteString(node_isolate, servername));
+ conn->servername_.Reset(env->isolate(),
+ OneByteString(env->isolate(), servername));
// Call the SNI callback and use its return value as context
if (!conn->sniObject_.IsEmpty()) {
conn->sniContext_.Dispose();
- Local<Value> arg = PersistentToLocal(node_isolate, conn->servername_);
+ Local<Value> arg = PersistentToLocal(env->isolate(), conn->servername_);
Local<Value> ret = conn->MakeCallback(env->onselect_string(), 1, &arg);
// If ret is SecureContext
Local<FunctionTemplate> secure_context_constructor_template =
env->secure_context_constructor_template();
if (secure_context_constructor_template->HasInstance(ret)) {
- conn->sniContext_.Reset(node_isolate, ret);
+ conn->sniContext_.Reset(env->isolate(), ret);
SecureContext* sc = Unwrap<SecureContext>(ret.As<Object>());
InitNPN(sc, conn);
SSL_set_SSL_CTX(s, sc->ctx_);
#endif
void Connection::New(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
if (args.Length() < 1 || !args[0]->IsObject()) {
return ThrowError("First argument must be a crypto module Credentials");
void Connection::EncIn(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Connection* conn = Unwrap<Connection>(args.This());
void Connection::ClearOut(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Connection* conn = Unwrap<Connection>(args.This());
void Connection::ClearPending(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Connection* conn = Unwrap<Connection>(args.This());
int bytes_pending = BIO_pending(conn->bio_read_);
args.GetReturnValue().Set(bytes_pending);
void Connection::EncPending(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Connection* conn = Unwrap<Connection>(args.This());
int bytes_pending = BIO_pending(conn->bio_write_);
args.GetReturnValue().Set(bytes_pending);
void Connection::EncOut(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Connection* conn = Unwrap<Connection>(args.This());
void Connection::ClearIn(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Connection* conn = Unwrap<Connection>(args.This());
void Connection::Start(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Connection* conn = Unwrap<Connection>(args.This());
void Connection::Close(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Connection* conn = Unwrap<Connection>(args.This());
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
void Connection::GetServername(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Connection* conn = Unwrap<Connection>(args.This());
void Connection::SetSNICallback(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Connection* conn = Unwrap<Connection>(args.This());
}
Local<Object> obj = Object::New();
- obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "onselect"), args[0]);
- conn->sniObject_.Reset(node_isolate, obj);
+ obj->Set(FIXED_ONE_BYTE_STRING(args.GetIsolate(), "onselect"), args[0]);
+ conn->sniObject_.Reset(args.GetIsolate(), obj);
}
#endif
NODE_SET_PROTOTYPE_METHOD(t, "getAuthTag", GetAuthTag);
NODE_SET_PROTOTYPE_METHOD(t, "setAuthTag", SetAuthTag);
- target->Set(FIXED_ONE_BYTE_STRING(node_isolate, "CipherBase"),
+ target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "CipherBase"),
t->GetFunction());
}
void CipherBase::Init(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
CipherBase* cipher = Unwrap<CipherBase>(args.This());
void CipherBase::InitIv(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
CipherBase* cipher = Unwrap<CipherBase>(args.This());
void CipherBase::SetAutoPadding(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
CipherBase* cipher = Unwrap<CipherBase>(args.This());
cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue());
}
NODE_SET_PROTOTYPE_METHOD(t, "update", HmacUpdate);
NODE_SET_PROTOTYPE_METHOD(t, "digest", HmacDigest);
- target->Set(FIXED_ONE_BYTE_STRING(node_isolate, "Hmac"), t->GetFunction());
+ target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "Hmac"), t->GetFunction());
}
void Hmac::HmacInit(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Hmac* hmac = Unwrap<Hmac>(args.This());
void Hmac::HmacUpdate(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Hmac* hmac = Unwrap<Hmac>(args.This());
void Hmac::HmacDigest(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Hmac* hmac = Unwrap<Hmac>(args.This());
NODE_SET_PROTOTYPE_METHOD(t, "update", HashUpdate);
NODE_SET_PROTOTYPE_METHOD(t, "digest", HashDigest);
- target->Set(FIXED_ONE_BYTE_STRING(node_isolate, "Hash"), t->GetFunction());
+ target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "Hash"), t->GetFunction());
}
void Hash::New(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
if (args.Length() == 0 || !args[0]->IsString()) {
return ThrowError("Must give hashtype string as argument");
void Hash::HashUpdate(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Hash* hash = Unwrap<Hash>(args.This());
void Hash::HashDigest(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Hash* hash = Unwrap<Hash>(args.This());
NODE_SET_PROTOTYPE_METHOD(t, "update", SignUpdate);
NODE_SET_PROTOTYPE_METHOD(t, "sign", SignFinal);
- target->Set(FIXED_ONE_BYTE_STRING(node_isolate, "Sign"), t->GetFunction());
+ target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "Sign"), t->GetFunction());
}
void Sign::SignInit(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Sign* sign = Unwrap<Sign>(args.This());
void Sign::SignUpdate(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Sign* sign = Unwrap<Sign>(args.This());
void Sign::SignFinal(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Sign* sign = Unwrap<Sign>(args.This());
NODE_SET_PROTOTYPE_METHOD(t, "update", VerifyUpdate);
NODE_SET_PROTOTYPE_METHOD(t, "verify", VerifyFinal);
- target->Set(FIXED_ONE_BYTE_STRING(node_isolate, "Verify"), t->GetFunction());
+ target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "Verify"),
+ t->GetFunction());
}
void Verify::VerifyInit(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Verify* verify = Unwrap<Verify>(args.This());
void Verify::VerifyUpdate(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Verify* verify = Unwrap<Verify>(args.This());
void Verify::VerifyFinal(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Verify* verify = Unwrap<Verify>(args.This());
NODE_SET_PROTOTYPE_METHOD(t, "setPublicKey", SetPublicKey);
NODE_SET_PROTOTYPE_METHOD(t, "setPrivateKey", SetPrivateKey);
- target->Set(FIXED_ONE_BYTE_STRING(node_isolate, "DiffieHellman"),
+ target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "DiffieHellman"),
t->GetFunction());
Local<FunctionTemplate> t2 = FunctionTemplate::New(DiffieHellmanGroup);
NODE_SET_PROTOTYPE_METHOD(t2, "getPublicKey", GetPublicKey);
NODE_SET_PROTOTYPE_METHOD(t2, "getPrivateKey", GetPrivateKey);
- target->Set(FIXED_ONE_BYTE_STRING(node_isolate, "DiffieHellmanGroup"),
+ target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "DiffieHellmanGroup"),
t2->GetFunction());
}
void DiffieHellman::DiffieHellmanGroup(
const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Environment* env = Environment::GetCurrent(args.GetIsolate());
DiffieHellman* diffieHellman = new DiffieHellman(env, args.This());
void DiffieHellman::New(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Environment* env = Environment::GetCurrent(args.GetIsolate());
DiffieHellman* diffieHellman =
void DiffieHellman::GenerateKeys(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
DiffieHellman* diffieHellman = Unwrap<DiffieHellman>(args.This());
void DiffieHellman::GetPrime(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
DiffieHellman* diffieHellman = Unwrap<DiffieHellman>(args.This());
void DiffieHellman::GetGenerator(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
DiffieHellman* diffieHellman = Unwrap<DiffieHellman>(args.This());
void DiffieHellman::GetPublicKey(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
DiffieHellman* diffieHellman = Unwrap<DiffieHellman>(args.This());
void DiffieHellman::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
DiffieHellman* diffieHellman = Unwrap<DiffieHellman>(args.This());
void DiffieHellman::ComputeSecret(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
DiffieHellman* diffieHellman = Unwrap<DiffieHellman>(args.This());
void DiffieHellman::SetPublicKey(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
DiffieHellman* diffieHellman = Unwrap<DiffieHellman>(args.This());
void DiffieHellman::SetPrivateKey(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
DiffieHellman* diffieHellman = Unwrap<DiffieHellman>(args.This());
RandomBytesRequest* req = new RandomBytesRequest(env, obj, size);
if (args[1]->IsFunction()) {
- obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "ondone"), args[1]);
+ obj->Set(FIXED_ONE_BYTE_STRING(args.GetIsolate(), "ondone"), args[1]);
// XXX(trevnorris): This will need to go with the rest of domains.
if (env->in_domain())
obj->Set(env->domain_string(), env->domain_array()->Get(0));
void GetSSLCiphers(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
SSL_CTX* ctx = SSL_CTX_new(TLSv1_server_method());
if (ctx == NULL) {
for (int i = 0; i < sk_SSL_CIPHER_num(ciphers); ++i) {
SSL_CIPHER* cipher = sk_SSL_CIPHER_value(ciphers, i);
- arr->Set(i, OneByteString(node_isolate, SSL_CIPHER_get_name(cipher)));
+ arr->Set(i, OneByteString(args.GetIsolate(), SSL_CIPHER_get_name(cipher)));
}
SSL_free(ssl);
void GetCiphers(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Local<Array> arr = Array::New();
EVP_CIPHER_do_all_sorted(array_push_back<EVP_CIPHER>, &arr);
args.GetReturnValue().Set(arr);
void GetHashes(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Local<Array> arr = Array::New();
EVP_MD_do_all_sorted(array_push_back<EVP_MD>, &arr);
args.GetReturnValue().Set(arr);
void Certificate::VerifySpkac(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Certificate* certificate = Unwrap<Certificate>(args.This());
bool i = false;
void Certificate::ExportPublicKey(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Certificate* certificate = Unwrap<Certificate>(args.This());
void Certificate::ExportChallenge(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(node_isolate);
+ HandleScope scope(args.GetIsolate());
Certificate* crt = Unwrap<Certificate>(args.This());