From 75ea11fc08019bb1ffac81583ed7d0da3241a5b5 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Fri, 14 Feb 2014 17:01:34 +0400 Subject: tls: introduce asynchronous `newSession` fix #7105 --- src/node_crypto.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/node_crypto.h') diff --git a/src/node_crypto.h b/src/node_crypto.h index 889d270c5c..729d4fc7f4 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -137,7 +137,8 @@ class SSLWrap { : env_(env), kind_(kind), next_sess_(NULL), - session_callbacks_(false) { + session_callbacks_(false), + new_session_wait_(false) { ssl_ = SSL_new(sc->ctx_); assert(ssl_ != NULL); } @@ -162,6 +163,7 @@ class SSLWrap { inline void enable_session_callbacks() { session_callbacks_ = true; } inline bool is_server() const { return kind_ == kServer; } inline bool is_client() const { return kind_ == kClient; } + inline bool is_waiting_new_session() const { return new_session_wait_; } protected: static void InitNPN(SecureContext* sc, Base* base); @@ -188,6 +190,7 @@ class SSLWrap { static void Renegotiate(const v8::FunctionCallbackInfo& args); static void Shutdown(const v8::FunctionCallbackInfo& args); static void GetTLSTicket(const v8::FunctionCallbackInfo& args); + static void NewSessionDone(const v8::FunctionCallbackInfo& args); #ifdef SSL_set_max_send_fragment static void SetMaxSendFragment( @@ -219,6 +222,7 @@ class SSLWrap { SSL_SESSION* next_sess_; SSL* ssl_; bool session_callbacks_; + bool new_session_wait_; ClientHelloParser hello_parser_; #ifdef OPENSSL_NPN_NEGOTIATED @@ -291,6 +295,7 @@ class Connection : public SSLWrap, public AsyncWrap { void ClearError(); void SetShutdownFlags(); + void NewSessionDoneCb(); Connection(Environment* env, v8::Local wrap, @@ -319,6 +324,7 @@ class Connection : public SSLWrap, public AsyncWrap { friend class ClientHelloParser; friend class SecureContext; + friend class SSLWrap; }; class CipherBase : public BaseObject { -- cgit v1.2.3