@ -300,7 +300,7 @@ void SecureContext::New(const FunctionCallbackInfo<Value>& args) {
void SecureContext : : Init ( const FunctionCallbackInfo < Value > & args ) {
void SecureContext : : Init ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
Environment * env = sc - > env ( ) ;
Environment * env = sc - > env ( ) ;
OPENSSL_CONST SSL_METHOD * method = SSLv23_method ( ) ;
OPENSSL_CONST SSL_METHOD * method = SSLv23_method ( ) ;
@ -428,7 +428,7 @@ void SecureContext::SetKey(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
unsigned int len = args . Length ( ) ;
unsigned int len = args . Length ( ) ;
if ( len ! = 1 & & len ! = 2 ) {
if ( len ! = 1 & & len ! = 2 ) {
@ -535,7 +535,7 @@ void SecureContext::SetCert(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
if ( args . Length ( ) ! = 1 ) {
if ( args . Length ( ) ! = 1 ) {
return env - > ThrowTypeError ( " Bad parameter " ) ;
return env - > ThrowTypeError ( " Bad parameter " ) ;
@ -564,7 +564,7 @@ void SecureContext::AddCACert(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
if ( args . Length ( ) ! = 1 ) {
if ( args . Length ( ) ! = 1 ) {
return env - > ThrowTypeError ( " Bad parameter " ) ;
return env - > ThrowTypeError ( " Bad parameter " ) ;
@ -594,7 +594,7 @@ void SecureContext::AddCRL(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
if ( args . Length ( ) ! = 1 ) {
if ( args . Length ( ) ! = 1 ) {
return env - > ThrowTypeError ( " Bad parameter " ) ;
return env - > ThrowTypeError ( " Bad parameter " ) ;
@ -626,7 +626,7 @@ void SecureContext::AddCRL(const FunctionCallbackInfo<Value>& args) {
void SecureContext : : AddRootCerts ( const FunctionCallbackInfo < Value > & args ) {
void SecureContext : : AddRootCerts ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
assert ( sc - > ca_store_ = = NULL ) ;
assert ( sc - > ca_store_ = = NULL ) ;
@ -663,7 +663,7 @@ void SecureContext::AddRootCerts(const FunctionCallbackInfo<Value>& args) {
void SecureContext : : SetCiphers ( const FunctionCallbackInfo < Value > & args ) {
void SecureContext : : SetCiphers ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
if ( args . Length ( ) ! = 1 | | ! args [ 0 ] - > IsString ( ) ) {
if ( args . Length ( ) ! = 1 | | ! args [ 0 ] - > IsString ( ) ) {
return sc - > env ( ) - > ThrowTypeError ( " Bad parameter " ) ;
return sc - > env ( ) - > ThrowTypeError ( " Bad parameter " ) ;
@ -677,7 +677,7 @@ void SecureContext::SetCiphers(const FunctionCallbackInfo<Value>& args) {
void SecureContext : : SetECDHCurve ( const FunctionCallbackInfo < Value > & args ) {
void SecureContext : : SetECDHCurve ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
Environment * env = sc - > env ( ) ;
Environment * env = sc - > env ( ) ;
if ( args . Length ( ) ! = 1 | | ! args [ 0 ] - > IsString ( ) )
if ( args . Length ( ) ! = 1 | | ! args [ 0 ] - > IsString ( ) )
@ -705,7 +705,7 @@ void SecureContext::SetECDHCurve(const FunctionCallbackInfo<Value>& args) {
void SecureContext : : SetOptions ( const FunctionCallbackInfo < Value > & args ) {
void SecureContext : : SetOptions ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
if ( args . Length ( ) ! = 1 | | ! args [ 0 ] - > IntegerValue ( ) ) {
if ( args . Length ( ) ! = 1 | | ! args [ 0 ] - > IntegerValue ( ) ) {
return sc - > env ( ) - > ThrowTypeError ( " Bad parameter " ) ;
return sc - > env ( ) - > ThrowTypeError ( " Bad parameter " ) ;
@ -719,7 +719,7 @@ void SecureContext::SetSessionIdContext(
const FunctionCallbackInfo < Value > & args ) {
const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
if ( args . Length ( ) ! = 1 | | ! args [ 0 ] - > IsString ( ) ) {
if ( args . Length ( ) ! = 1 | | ! args [ 0 ] - > IsString ( ) ) {
return sc - > env ( ) - > ThrowTypeError ( " Bad parameter " ) ;
return sc - > env ( ) - > ThrowTypeError ( " Bad parameter " ) ;
@ -756,7 +756,7 @@ void SecureContext::SetSessionIdContext(
void SecureContext : : SetSessionTimeout ( const FunctionCallbackInfo < Value > & args ) {
void SecureContext : : SetSessionTimeout ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
if ( args . Length ( ) ! = 1 | | ! args [ 0 ] - > IsInt32 ( ) ) {
if ( args . Length ( ) ! = 1 | | ! args [ 0 ] - > IsInt32 ( ) ) {
return sc - > env ( ) - > ThrowTypeError ( " Bad parameter " ) ;
return sc - > env ( ) - > ThrowTypeError ( " Bad parameter " ) ;
@ -769,7 +769,7 @@ void SecureContext::SetSessionTimeout(const FunctionCallbackInfo<Value>& args) {
void SecureContext : : Close ( const FunctionCallbackInfo < Value > & args ) {
void SecureContext : : Close ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
sc - > FreeCTXMem ( ) ;
sc - > FreeCTXMem ( ) ;
}
}
@ -787,7 +787,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo<Value>& args) {
char * pass = NULL ;
char * pass = NULL ;
bool ret = false ;
bool ret = false ;
SecureContext * sc = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * sc = Unwrap < SecureContext > ( args . Holder ( ) ) ;
if ( args . Length ( ) < 1 ) {
if ( args . Length ( ) < 1 ) {
return env - > ThrowTypeError ( " Bad parameter " ) ;
return env - > ThrowTypeError ( " Bad parameter " ) ;
@ -845,7 +845,7 @@ void SecureContext::GetTicketKeys(const FunctionCallbackInfo<Value>& args) {
# if !defined(OPENSSL_NO_TLSEXT) && defined(SSL_CTX_get_tlsext_ticket_keys)
# if !defined(OPENSSL_NO_TLSEXT) && defined(SSL_CTX_get_tlsext_ticket_keys)
HandleScope handle_scope ( args . GetIsolate ( ) ) ;
HandleScope handle_scope ( args . GetIsolate ( ) ) ;
SecureContext * wrap = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * wrap = Unwrap < SecureContext > ( args . Holder ( ) ) ;
Local < Object > buff = Buffer : : New ( wrap - > env ( ) , 48 ) ;
Local < Object > buff = Buffer : : New ( wrap - > env ( ) , 48 ) ;
if ( SSL_CTX_get_tlsext_ticket_keys ( wrap - > ctx_ ,
if ( SSL_CTX_get_tlsext_ticket_keys ( wrap - > ctx_ ,
@ -862,7 +862,7 @@ void SecureContext::GetTicketKeys(const FunctionCallbackInfo<Value>& args) {
void SecureContext : : SetTicketKeys ( const FunctionCallbackInfo < Value > & args ) {
void SecureContext : : SetTicketKeys ( const FunctionCallbackInfo < Value > & args ) {
# if !defined(OPENSSL_NO_TLSEXT) && defined(SSL_CTX_get_tlsext_ticket_keys)
# if !defined(OPENSSL_NO_TLSEXT) && defined(SSL_CTX_get_tlsext_ticket_keys)
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
SecureContext * wrap = Unwrap < SecureContext > ( args . This ( ) ) ;
SecureContext * wrap = Unwrap < SecureContext > ( args . Holder ( ) ) ;
if ( args . Length ( ) < 1 | |
if ( args . Length ( ) < 1 | |
! Buffer : : HasInstance ( args [ 0 ] ) | |
! Buffer : : HasInstance ( args [ 0 ] ) | |
@ -1013,7 +1013,7 @@ void SSLWrap<Base>::GetPeerCertificate(
const FunctionCallbackInfo < Value > & args ) {
const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
Environment * env = w - > ssl_env ( ) ;
Environment * env = w - > ssl_env ( ) ;
ClearErrorOnReturn clear_error_on_return ;
ClearErrorOnReturn clear_error_on_return ;
@ -1162,7 +1162,7 @@ void SSLWrap<Base>::GetSession(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
SSL_SESSION * sess = SSL_get_session ( w - > ssl_ ) ;
SSL_SESSION * sess = SSL_get_session ( w - > ssl_ ) ;
if ( sess = = NULL )
if ( sess = = NULL )
@ -1184,7 +1184,7 @@ void SSLWrap<Base>::SetSession(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
if ( args . Length ( ) < 1 | |
if ( args . Length ( ) < 1 | |
( ! args [ 0 ] - > IsString ( ) & & ! Buffer : : HasInstance ( args [ 0 ] ) ) ) {
( ! args [ 0 ] - > IsString ( ) & & ! Buffer : : HasInstance ( args [ 0 ] ) ) ) {
@ -1216,7 +1216,7 @@ template <class Base>
void SSLWrap < Base > : : LoadSession ( const FunctionCallbackInfo < Value > & args ) {
void SSLWrap < Base > : : LoadSession ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
Environment * env = w - > ssl_env ( ) ;
Environment * env = w - > ssl_env ( ) ;
if ( args . Length ( ) > = 1 & & Buffer : : HasInstance ( args [ 0 ] ) ) {
if ( args . Length ( ) > = 1 & & Buffer : : HasInstance ( args [ 0 ] ) ) {
@ -1248,7 +1248,7 @@ void SSLWrap<Base>::LoadSession(const FunctionCallbackInfo<Value>& args) {
template < class Base >
template < class Base >
void SSLWrap < Base > : : IsSessionReused ( const FunctionCallbackInfo < Value > & args ) {
void SSLWrap < Base > : : IsSessionReused ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
bool yes = SSL_session_reused ( w - > ssl_ ) ;
bool yes = SSL_session_reused ( w - > ssl_ ) ;
args . GetReturnValue ( ) . Set ( yes ) ;
args . GetReturnValue ( ) . Set ( yes ) ;
}
}
@ -1257,7 +1257,7 @@ void SSLWrap<Base>::IsSessionReused(const FunctionCallbackInfo<Value>& args) {
template < class Base >
template < class Base >
void SSLWrap < Base > : : EndParser ( const FunctionCallbackInfo < Value > & args ) {
void SSLWrap < Base > : : EndParser ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
w - > hello_parser_ . End ( ) ;
w - > hello_parser_ . End ( ) ;
}
}
@ -1266,7 +1266,7 @@ template <class Base>
void SSLWrap < Base > : : Renegotiate ( const FunctionCallbackInfo < Value > & args ) {
void SSLWrap < Base > : : Renegotiate ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
ClearErrorOnReturn clear_error_on_return ;
ClearErrorOnReturn clear_error_on_return ;
( void ) & clear_error_on_return ; // Silence unused variable warning.
( void ) & clear_error_on_return ; // Silence unused variable warning.
@ -1280,7 +1280,7 @@ template <class Base>
void SSLWrap < Base > : : Shutdown ( const FunctionCallbackInfo < Value > & args ) {
void SSLWrap < Base > : : Shutdown ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
int rv = SSL_shutdown ( w - > ssl_ ) ;
int rv = SSL_shutdown ( w - > ssl_ ) ;
args . GetReturnValue ( ) . Set ( rv ) ;
args . GetReturnValue ( ) . Set ( rv ) ;
@ -1291,7 +1291,7 @@ template <class Base>
void SSLWrap < Base > : : GetTLSTicket ( const FunctionCallbackInfo < Value > & args ) {
void SSLWrap < Base > : : GetTLSTicket ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
Environment * env = w - > ssl_env ( ) ;
Environment * env = w - > ssl_env ( ) ;
SSL_SESSION * sess = SSL_get_session ( w - > ssl_ ) ;
SSL_SESSION * sess = SSL_get_session ( w - > ssl_ ) ;
@ -1310,7 +1310,7 @@ template <class Base>
void SSLWrap < Base > : : NewSessionDone ( const FunctionCallbackInfo < Value > & args ) {
void SSLWrap < Base > : : NewSessionDone ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
w - > new_session_wait_ = false ;
w - > new_session_wait_ = false ;
w - > NewSessionDoneCb ( ) ;
w - > NewSessionDoneCb ( ) ;
}
}
@ -1323,7 +1323,7 @@ void SSLWrap<Base>::SetMaxSendFragment(
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
CHECK ( args . Length ( ) > = 1 & & args [ 0 ] - > IsNumber ( ) ) ;
CHECK ( args . Length ( ) > = 1 & & args [ 0 ] - > IsNumber ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
int rv = SSL_set_max_send_fragment ( w - > ssl_ , args [ 0 ] - > Int32Value ( ) ) ;
int rv = SSL_set_max_send_fragment ( w - > ssl_ , args [ 0 ] - > Int32Value ( ) ) ;
args . GetReturnValue ( ) . Set ( rv ) ;
args . GetReturnValue ( ) . Set ( rv ) ;
@ -1334,7 +1334,7 @@ void SSLWrap<Base>::SetMaxSendFragment(
template < class Base >
template < class Base >
void SSLWrap < Base > : : IsInitFinished ( const FunctionCallbackInfo < Value > & args ) {
void SSLWrap < Base > : : IsInitFinished ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
bool yes = SSL_is_init_finished ( w - > ssl_ ) ;
bool yes = SSL_is_init_finished ( w - > ssl_ ) ;
args . GetReturnValue ( ) . Set ( yes ) ;
args . GetReturnValue ( ) . Set ( yes ) ;
}
}
@ -1344,7 +1344,7 @@ template <class Base>
void SSLWrap < Base > : : VerifyError ( const FunctionCallbackInfo < Value > & args ) {
void SSLWrap < Base > : : VerifyError ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
// XXX(bnoordhuis) The UNABLE_TO_GET_ISSUER_CERT error when there is no
// XXX(bnoordhuis) The UNABLE_TO_GET_ISSUER_CERT error when there is no
// peer certificate is questionable but it's compatible with what was
// peer certificate is questionable but it's compatible with what was
@ -1409,7 +1409,7 @@ template <class Base>
void SSLWrap < Base > : : GetCurrentCipher ( const FunctionCallbackInfo < Value > & args ) {
void SSLWrap < Base > : : GetCurrentCipher ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
Environment * env = w - > ssl_env ( ) ;
Environment * env = w - > ssl_env ( ) ;
OPENSSL_CONST SSL_CIPHER * c = SSL_get_current_cipher ( w - > ssl_ ) ;
OPENSSL_CONST SSL_CIPHER * c = SSL_get_current_cipher ( w - > ssl_ ) ;
@ -1511,7 +1511,7 @@ void SSLWrap<Base>::GetNegotiatedProto(
const FunctionCallbackInfo < Value > & args ) {
const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
if ( w - > is_client ( ) ) {
if ( w - > is_client ( ) ) {
if ( w - > selected_npn_proto_ . IsEmpty ( ) = = false ) {
if ( w - > selected_npn_proto_ . IsEmpty ( ) = = false ) {
@ -1537,7 +1537,7 @@ template <class Base>
void SSLWrap < Base > : : SetNPNProtocols ( const FunctionCallbackInfo < Value > & args ) {
void SSLWrap < Base > : : SetNPNProtocols ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Base * w = Unwrap < Base > ( args . This ( ) ) ;
Base * w = Unwrap < Base > ( args . Holder ( ) ) ;
if ( args . Length ( ) < 1 | | ! Buffer : : HasInstance ( args [ 0 ] ) )
if ( args . Length ( ) < 1 | | ! Buffer : : HasInstance ( args [ 0 ] ) )
return w - > env ( ) - > ThrowTypeError ( " Must give a Buffer as first argument " ) ;
return w - > env ( ) - > ThrowTypeError ( " Must give a Buffer as first argument " ) ;
@ -1927,7 +1927,7 @@ void Connection::SSLInfoCallback(const SSL *ssl_, int where, int ret) {
void Connection : : EncIn ( const FunctionCallbackInfo < Value > & args ) {
void Connection : : EncIn ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . This ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . Holder ( ) ) ;
Environment * env = conn - > env ( ) ;
Environment * env = conn - > env ( ) ;
if ( args . Length ( ) < 3 ) {
if ( args . Length ( ) < 3 ) {
@ -1978,7 +1978,7 @@ void Connection::EncIn(const FunctionCallbackInfo<Value>& args) {
void Connection : : ClearOut ( const FunctionCallbackInfo < Value > & args ) {
void Connection : : ClearOut ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . This ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . Holder ( ) ) ;
Environment * env = conn - > env ( ) ;
Environment * env = conn - > env ( ) ;
if ( args . Length ( ) < 3 ) {
if ( args . Length ( ) < 3 ) {
@ -2033,7 +2033,7 @@ void Connection::ClearOut(const FunctionCallbackInfo<Value>& args) {
void Connection : : ClearPending ( const FunctionCallbackInfo < Value > & args ) {
void Connection : : ClearPending ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . This ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . Holder ( ) ) ;
int bytes_pending = BIO_pending ( conn - > bio_read_ ) ;
int bytes_pending = BIO_pending ( conn - > bio_read_ ) ;
args . GetReturnValue ( ) . Set ( bytes_pending ) ;
args . GetReturnValue ( ) . Set ( bytes_pending ) ;
}
}
@ -2041,7 +2041,7 @@ void Connection::ClearPending(const FunctionCallbackInfo<Value>& args) {
void Connection : : EncPending ( const FunctionCallbackInfo < Value > & args ) {
void Connection : : EncPending ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . This ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . Holder ( ) ) ;
int bytes_pending = BIO_pending ( conn - > bio_write_ ) ;
int bytes_pending = BIO_pending ( conn - > bio_write_ ) ;
args . GetReturnValue ( ) . Set ( bytes_pending ) ;
args . GetReturnValue ( ) . Set ( bytes_pending ) ;
}
}
@ -2050,7 +2050,7 @@ void Connection::EncPending(const FunctionCallbackInfo<Value>& args) {
void Connection : : EncOut ( const FunctionCallbackInfo < Value > & args ) {
void Connection : : EncOut ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . This ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . Holder ( ) ) ;
Environment * env = conn - > env ( ) ;
Environment * env = conn - > env ( ) ;
if ( args . Length ( ) < 3 ) {
if ( args . Length ( ) < 3 ) {
@ -2082,7 +2082,7 @@ void Connection::EncOut(const FunctionCallbackInfo<Value>& args) {
void Connection : : ClearIn ( const FunctionCallbackInfo < Value > & args ) {
void Connection : : ClearIn ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . This ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . Holder ( ) ) ;
Environment * env = conn - > env ( ) ;
Environment * env = conn - > env ( ) ;
if ( args . Length ( ) < 3 ) {
if ( args . Length ( ) < 3 ) {
@ -2138,7 +2138,7 @@ void Connection::ClearIn(const FunctionCallbackInfo<Value>& args) {
void Connection : : Start ( const FunctionCallbackInfo < Value > & args ) {
void Connection : : Start ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . This ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . Holder ( ) ) ;
int rv = 0 ;
int rv = 0 ;
if ( ! SSL_is_init_finished ( conn - > ssl_ ) ) {
if ( ! SSL_is_init_finished ( conn - > ssl_ ) ) {
@ -2163,7 +2163,7 @@ void Connection::Start(const FunctionCallbackInfo<Value>& args) {
void Connection : : Close ( const FunctionCallbackInfo < Value > & args ) {
void Connection : : Close ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . This ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . Holder ( ) ) ;
if ( conn - > ssl_ ! = NULL ) {
if ( conn - > ssl_ ! = NULL ) {
SSL_free ( conn - > ssl_ ) ;
SSL_free ( conn - > ssl_ ) ;
@ -2176,7 +2176,7 @@ void Connection::Close(const FunctionCallbackInfo<Value>& args) {
void Connection : : GetServername ( const FunctionCallbackInfo < Value > & args ) {
void Connection : : GetServername ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . This ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . Holder ( ) ) ;
if ( conn - > is_server ( ) & & ! conn - > servername_ . IsEmpty ( ) ) {
if ( conn - > is_server ( ) & & ! conn - > servername_ . IsEmpty ( ) ) {
args . GetReturnValue ( ) . Set ( conn - > servername_ ) ;
args . GetReturnValue ( ) . Set ( conn - > servername_ ) ;
@ -2189,7 +2189,7 @@ void Connection::GetServername(const FunctionCallbackInfo<Value>& args) {
void Connection : : SetSNICallback ( const FunctionCallbackInfo < Value > & args ) {
void Connection : : SetSNICallback ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . This ( ) ) ;
Connection * conn = Unwrap < Connection > ( args . Holder ( ) ) ;
Environment * env = conn - > env ( ) ;
Environment * env = conn - > env ( ) ;
if ( args . Length ( ) < 1 | | ! args [ 0 ] - > IsFunction ( ) ) {
if ( args . Length ( ) < 1 | | ! args [ 0 ] - > IsFunction ( ) ) {
@ -2274,7 +2274,7 @@ void CipherBase::Init(const char* cipher_type,
void CipherBase : : Init ( const FunctionCallbackInfo < Value > & args ) {
void CipherBase : : Init ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . This ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . Holder ( ) ) ;
if ( args . Length ( ) < 2 | |
if ( args . Length ( ) < 2 | |
! ( args [ 0 ] - > IsString ( ) & & Buffer : : HasInstance ( args [ 1 ] ) ) ) {
! ( args [ 0 ] - > IsString ( ) & & Buffer : : HasInstance ( args [ 1 ] ) ) ) {
@ -2326,7 +2326,7 @@ void CipherBase::InitIv(const char* cipher_type,
void CipherBase : : InitIv ( const FunctionCallbackInfo < Value > & args ) {
void CipherBase : : InitIv ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . This ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . Holder ( ) ) ;
Environment * env = cipher - > env ( ) ;
Environment * env = cipher - > env ( ) ;
if ( args . Length ( ) < 3 | | ! args [ 0 ] - > IsString ( ) ) {
if ( args . Length ( ) < 3 | | ! args [ 0 ] - > IsString ( ) ) {
@ -2368,7 +2368,7 @@ bool CipherBase::GetAuthTag(char** out, unsigned int* out_len) const {
void CipherBase : : GetAuthTag ( const FunctionCallbackInfo < Value > & args ) {
void CipherBase : : GetAuthTag ( const FunctionCallbackInfo < Value > & args ) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope handle_scope ( args . GetIsolate ( ) ) ;
HandleScope handle_scope ( args . GetIsolate ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . This ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . Holder ( ) ) ;
char * out = NULL ;
char * out = NULL ;
unsigned int out_len = 0 ;
unsigned int out_len = 0 ;
@ -2401,7 +2401,7 @@ void CipherBase::SetAuthTag(const FunctionCallbackInfo<Value>& args) {
if ( ! buf - > IsObject ( ) | | ! Buffer : : HasInstance ( buf ) )
if ( ! buf - > IsObject ( ) | | ! Buffer : : HasInstance ( buf ) )
return env - > ThrowTypeError ( " Argument must be a Buffer " ) ;
return env - > ThrowTypeError ( " Argument must be a Buffer " ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . This ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . Holder ( ) ) ;
if ( ! cipher - > SetAuthTag ( Buffer : : Data ( buf ) , Buffer : : Length ( buf ) ) )
if ( ! cipher - > SetAuthTag ( Buffer : : Data ( buf ) , Buffer : : Length ( buf ) ) )
env - > ThrowError ( " Attempting to set auth tag in unsupported state " ) ;
env - > ThrowError ( " Attempting to set auth tag in unsupported state " ) ;
@ -2430,7 +2430,7 @@ void CipherBase::SetAAD(const FunctionCallbackInfo<Value>& args) {
ASSERT_IS_BUFFER ( args [ 0 ] ) ;
ASSERT_IS_BUFFER ( args [ 0 ] ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . This ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . Holder ( ) ) ;
if ( ! cipher - > SetAAD ( Buffer : : Data ( args [ 0 ] ) , Buffer : : Length ( args [ 0 ] ) ) )
if ( ! cipher - > SetAAD ( Buffer : : Data ( args [ 0 ] ) , Buffer : : Length ( args [ 0 ] ) ) )
env - > ThrowError ( " Attempting to set AAD in unsupported state " ) ;
env - > ThrowError ( " Attempting to set AAD in unsupported state " ) ;
@ -2468,7 +2468,7 @@ void CipherBase::Update(const FunctionCallbackInfo<Value>& args) {
HandleScope handle_scope ( args . GetIsolate ( ) ) ;
HandleScope handle_scope ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . This ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . Holder ( ) ) ;
ASSERT_IS_STRING_OR_BUFFER ( args [ 0 ] ) ;
ASSERT_IS_STRING_OR_BUFFER ( args [ 0 ] ) ;
@ -2519,7 +2519,7 @@ bool CipherBase::SetAutoPadding(bool auto_padding) {
void CipherBase : : SetAutoPadding ( const FunctionCallbackInfo < Value > & args ) {
void CipherBase : : SetAutoPadding ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . This ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . Holder ( ) ) ;
cipher - > SetAutoPadding ( args . Length ( ) < 1 | | args [ 0 ] - > BooleanValue ( ) ) ;
cipher - > SetAutoPadding ( args . Length ( ) < 1 | | args [ 0 ] - > BooleanValue ( ) ) ;
}
}
@ -2556,7 +2556,7 @@ void CipherBase::Final(const FunctionCallbackInfo<Value>& args) {
HandleScope handle_scope ( args . GetIsolate ( ) ) ;
HandleScope handle_scope ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . This ( ) ) ;
CipherBase * cipher = Unwrap < CipherBase > ( args . Holder ( ) ) ;
unsigned char * out_value = NULL ;
unsigned char * out_value = NULL ;
int out_len = - 1 ;
int out_len = - 1 ;
@ -2618,7 +2618,7 @@ void Hmac::HmacInit(const char* hash_type, const char* key, int key_len) {
void Hmac : : HmacInit ( const FunctionCallbackInfo < Value > & args ) {
void Hmac : : HmacInit ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Hmac * hmac = Unwrap < Hmac > ( args . This ( ) ) ;
Hmac * hmac = Unwrap < Hmac > ( args . Holder ( ) ) ;
Environment * env = hmac - > env ( ) ;
Environment * env = hmac - > env ( ) ;
if ( args . Length ( ) < 2 | | ! args [ 0 ] - > IsString ( ) ) {
if ( args . Length ( ) < 2 | | ! args [ 0 ] - > IsString ( ) ) {
@ -2646,7 +2646,7 @@ void Hmac::HmacUpdate(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Hmac * hmac = Unwrap < Hmac > ( args . This ( ) ) ;
Hmac * hmac = Unwrap < Hmac > ( args . Holder ( ) ) ;
ASSERT_IS_STRING_OR_BUFFER ( args [ 0 ] ) ;
ASSERT_IS_STRING_OR_BUFFER ( args [ 0 ] ) ;
@ -2693,7 +2693,7 @@ void Hmac::HmacDigest(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Hmac * hmac = Unwrap < Hmac > ( args . This ( ) ) ;
Hmac * hmac = Unwrap < Hmac > ( args . Holder ( ) ) ;
enum encoding encoding = BUFFER ;
enum encoding encoding = BUFFER ;
if ( args . Length ( ) > = 1 ) {
if ( args . Length ( ) > = 1 ) {
@ -2771,7 +2771,7 @@ void Hash::HashUpdate(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Hash * hash = Unwrap < Hash > ( args . This ( ) ) ;
Hash * hash = Unwrap < Hash > ( args . Holder ( ) ) ;
ASSERT_IS_STRING_OR_BUFFER ( args [ 0 ] ) ;
ASSERT_IS_STRING_OR_BUFFER ( args [ 0 ] ) ;
@ -2807,7 +2807,7 @@ void Hash::HashDigest(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Hash * hash = Unwrap < Hash > ( args . This ( ) ) ;
Hash * hash = Unwrap < Hash > ( args . Holder ( ) ) ;
if ( ! hash - > initialised_ ) {
if ( ! hash - > initialised_ ) {
return env - > ThrowError ( " Not initialized " ) ;
return env - > ThrowError ( " Not initialized " ) ;
@ -2911,7 +2911,7 @@ SignBase::Error Sign::SignInit(const char* sign_type) {
void Sign : : SignInit ( const FunctionCallbackInfo < Value > & args ) {
void Sign : : SignInit ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Sign * sign = Unwrap < Sign > ( args . This ( ) ) ;
Sign * sign = Unwrap < Sign > ( args . Holder ( ) ) ;
if ( args . Length ( ) = = 0 | | ! args [ 0 ] - > IsString ( ) ) {
if ( args . Length ( ) = = 0 | | ! args [ 0 ] - > IsString ( ) ) {
return sign - > env ( ) - > ThrowError ( " Must give signtype string as argument " ) ;
return sign - > env ( ) - > ThrowError ( " Must give signtype string as argument " ) ;
@ -2935,7 +2935,7 @@ void Sign::SignUpdate(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Sign * sign = Unwrap < Sign > ( args . This ( ) ) ;
Sign * sign = Unwrap < Sign > ( args . Holder ( ) ) ;
ASSERT_IS_STRING_OR_BUFFER ( args [ 0 ] ) ;
ASSERT_IS_STRING_OR_BUFFER ( args [ 0 ] ) ;
@ -3015,7 +3015,7 @@ void Sign::SignFinal(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Sign * sign = Unwrap < Sign > ( args . This ( ) ) ;
Sign * sign = Unwrap < Sign > ( args . Holder ( ) ) ;
unsigned char * md_value ;
unsigned char * md_value ;
unsigned int md_len ;
unsigned int md_len ;
@ -3096,7 +3096,7 @@ SignBase::Error Verify::VerifyInit(const char* verify_type) {
void Verify : : VerifyInit ( const FunctionCallbackInfo < Value > & args ) {
void Verify : : VerifyInit ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Verify * verify = Unwrap < Verify > ( args . This ( ) ) ;
Verify * verify = Unwrap < Verify > ( args . Holder ( ) ) ;
if ( args . Length ( ) = = 0 | | ! args [ 0 ] - > IsString ( ) ) {
if ( args . Length ( ) = = 0 | | ! args [ 0 ] - > IsString ( ) ) {
return verify - > env ( ) - > ThrowError ( " Must give verifytype string as argument " ) ;
return verify - > env ( ) - > ThrowError ( " Must give verifytype string as argument " ) ;
@ -3122,7 +3122,7 @@ void Verify::VerifyUpdate(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Verify * verify = Unwrap < Verify > ( args . This ( ) ) ;
Verify * verify = Unwrap < Verify > ( args . Holder ( ) ) ;
ASSERT_IS_STRING_OR_BUFFER ( args [ 0 ] ) ;
ASSERT_IS_STRING_OR_BUFFER ( args [ 0 ] ) ;
@ -3233,7 +3233,7 @@ void Verify::VerifyFinal(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Verify * verify = Unwrap < Verify > ( args . This ( ) ) ;
Verify * verify = Unwrap < Verify > ( args . Holder ( ) ) ;
ASSERT_IS_BUFFER ( args [ 0 ] ) ;
ASSERT_IS_BUFFER ( args [ 0 ] ) ;
char * kbuf = Buffer : : Data ( args [ 0 ] ) ;
char * kbuf = Buffer : : Data ( args [ 0 ] ) ;
@ -3430,7 +3430,7 @@ void DiffieHellman::GenerateKeys(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . This ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . Holder ( ) ) ;
if ( ! diffieHellman - > initialised_ ) {
if ( ! diffieHellman - > initialised_ ) {
return env - > ThrowError ( " Not initialized " ) ;
return env - > ThrowError ( " Not initialized " ) ;
@ -3454,7 +3454,7 @@ void DiffieHellman::GetPrime(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . This ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . Holder ( ) ) ;
if ( ! diffieHellman - > initialised_ ) {
if ( ! diffieHellman - > initialised_ ) {
return env - > ThrowError ( " Not initialized " ) ;
return env - > ThrowError ( " Not initialized " ) ;
@ -3473,7 +3473,7 @@ void DiffieHellman::GetGenerator(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . This ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . Holder ( ) ) ;
if ( ! diffieHellman - > initialised_ ) {
if ( ! diffieHellman - > initialised_ ) {
return env - > ThrowError ( " Not initialized " ) ;
return env - > ThrowError ( " Not initialized " ) ;
@ -3492,7 +3492,7 @@ void DiffieHellman::GetPublicKey(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . This ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . Holder ( ) ) ;
if ( ! diffieHellman - > initialised_ ) {
if ( ! diffieHellman - > initialised_ ) {
return env - > ThrowError ( " Not initialized " ) ;
return env - > ThrowError ( " Not initialized " ) ;
@ -3516,7 +3516,7 @@ void DiffieHellman::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . This ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . Holder ( ) ) ;
if ( ! diffieHellman - > initialised_ ) {
if ( ! diffieHellman - > initialised_ ) {
return env - > ThrowError ( " Not initialized " ) ;
return env - > ThrowError ( " Not initialized " ) ;
@ -3540,7 +3540,7 @@ void DiffieHellman::ComputeSecret(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . This ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . Holder ( ) ) ;
if ( ! diffieHellman - > initialised_ ) {
if ( ! diffieHellman - > initialised_ ) {
return env - > ThrowError ( " Not initialized " ) ;
return env - > ThrowError ( " Not initialized " ) ;
@ -3611,7 +3611,7 @@ void DiffieHellman::ComputeSecret(const FunctionCallbackInfo<Value>& args) {
void DiffieHellman : : SetPublicKey ( const FunctionCallbackInfo < Value > & args ) {
void DiffieHellman : : SetPublicKey ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . This ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . Holder ( ) ) ;
Environment * env = diffieHellman - > env ( ) ;
Environment * env = diffieHellman - > env ( ) ;
if ( ! diffieHellman - > initialised_ ) {
if ( ! diffieHellman - > initialised_ ) {
@ -3632,7 +3632,7 @@ void DiffieHellman::SetPublicKey(const FunctionCallbackInfo<Value>& args) {
void DiffieHellman : : SetPrivateKey ( const FunctionCallbackInfo < Value > & args ) {
void DiffieHellman : : SetPrivateKey ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . This ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . Holder ( ) ) ;
Environment * env = diffieHellman - > env ( ) ;
Environment * env = diffieHellman - > env ( ) ;
if ( ! diffieHellman - > initialised_ ) {
if ( ! diffieHellman - > initialised_ ) {
@ -3655,7 +3655,7 @@ void DiffieHellman::VerifyErrorGetter(Local<String> property,
const PropertyCallbackInfo < Value > & args ) {
const PropertyCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . This ( ) ) ;
DiffieHellman * diffieHellman = Unwrap < DiffieHellman > ( args . Holder ( ) ) ;
if ( ! diffieHellman - > initialised_ )
if ( ! diffieHellman - > initialised_ )
return diffieHellman - > env ( ) - > ThrowError ( " Not initialized " ) ;
return diffieHellman - > env ( ) - > ThrowError ( " Not initialized " ) ;
@ -4227,7 +4227,7 @@ bool Certificate::VerifySpkac(const char* data, unsigned int len) {
void Certificate : : VerifySpkac ( const FunctionCallbackInfo < Value > & args ) {
void Certificate : : VerifySpkac ( const FunctionCallbackInfo < Value > & args ) {
HandleScope scope ( args . GetIsolate ( ) ) ;
HandleScope scope ( args . GetIsolate ( ) ) ;
Certificate * certificate = Unwrap < Certificate > ( args . This ( ) ) ;
Certificate * certificate = Unwrap < Certificate > ( args . Holder ( ) ) ;
Environment * env = certificate - > env ( ) ;
Environment * env = certificate - > env ( ) ;
bool i = false ;
bool i = false ;
@ -4294,7 +4294,7 @@ void Certificate::ExportPublicKey(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Certificate * certificate = Unwrap < Certificate > ( args . This ( ) ) ;
Certificate * certificate = Unwrap < Certificate > ( args . Holder ( ) ) ;
if ( args . Length ( ) < 1 )
if ( args . Length ( ) < 1 )
return env - > ThrowTypeError ( " Missing argument " ) ;
return env - > ThrowTypeError ( " Missing argument " ) ;
@ -4338,7 +4338,7 @@ void Certificate::ExportChallenge(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( args . GetIsolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
Certificate * crt = Unwrap < Certificate > ( args . This ( ) ) ;
Certificate * crt = Unwrap < Certificate > ( args . Holder ( ) ) ;
if ( args . Length ( ) < 1 )
if ( args . Length ( ) < 1 )
return env - > ThrowTypeError ( " Missing argument " ) ;
return env - > ThrowTypeError ( " Missing argument " ) ;