File tree Expand file tree Collapse file tree 3 files changed +3
-25
lines changed Expand file tree Collapse file tree 3 files changed +3
-25
lines changed Original file line number Diff line number Diff line change @@ -116,27 +116,12 @@ MaybeLocal<Value> GetSSLOCSPResponse(
116116 return ret;
117117}
118118
119- bool SetTLSSession (
120- const SSLPointer& ssl,
121- const unsigned char * buf,
122- size_t length) {
123- SSLSessionPointer s (d2i_SSL_SESSION (nullptr , &buf, length));
124- return s == nullptr ? false : SetTLSSession (ssl, s);
125- }
126-
127119bool SetTLSSession (
128120 const SSLPointer& ssl,
129121 const SSLSessionPointer& session) {
130122 return session != nullptr && SSL_set_session (ssl.get (), session.get ()) == 1 ;
131123}
132124
133- SSLSessionPointer GetTLSSession (Local<Value> val) {
134- if (!val->IsArrayBufferView ())
135- return SSLSessionPointer ();
136- ArrayBufferViewContents<unsigned char > sbuf (val.As <ArrayBufferView>());
137- return GetTLSSession (sbuf.data (), sbuf.length ());
138- }
139-
140125SSLSessionPointer GetTLSSession (const unsigned char * buf, size_t length) {
141126 return SSLSessionPointer (d2i_SSL_SESSION (nullptr , &buf, length));
142127}
Original file line number Diff line number Diff line change @@ -42,17 +42,10 @@ v8::MaybeLocal<v8::Value> GetSSLOCSPResponse(
4242 SSL* ssl,
4343 v8::Local<v8::Value> default_value);
4444
45- bool SetTLSSession (
46- const SSLPointer& ssl,
47- const unsigned char * buf,
48- size_t length);
49-
5045bool SetTLSSession (
5146 const SSLPointer& ssl,
5247 const SSLSessionPointer& session);
5348
54- SSLSessionPointer GetTLSSession (v8::Local<v8::Value> val);
55-
5649SSLSessionPointer GetTLSSession (const unsigned char * buf, size_t length);
5750
5851long VerifyPeerCertificate ( // NOLINT(runtime/int)
Original file line number Diff line number Diff line change @@ -1667,10 +1667,10 @@ void TLSWrap::SetSession(const FunctionCallbackInfo<Value>& args) {
16671667 return THROW_ERR_MISSING_ARGS (env, " Session argument is mandatory" );
16681668
16691669 THROW_AND_RETURN_IF_NOT_BUFFER (env, args[0 ], " Session" );
1670-
1671- SSLSessionPointer sess = GetTLSSession (args[ 0 ] );
1670+ ArrayBufferViewContents< unsigned char > sbuf (args[ 0 ]);
1671+ SSLSessionPointer sess = GetTLSSession (sbuf. data (), sbuf. length () );
16721672 if (sess == nullptr )
1673- return ;
1673+ return ; // TODO(tniessen): figure out error handling
16741674
16751675 if (!SetTLSSession (w->ssl_ , sess))
16761676 return env->ThrowError (" SSL_set_session error" );
You can’t perform that action at this time.
0 commit comments