diff options
author | Fedor Indutny <fedor@indutny.com> | 2015-08-07 18:14:54 -0700 |
---|---|---|
committer | Shigeki Ohtsu <ohtsu@iij.ad.jp> | 2015-08-08 07:16:58 +0900 |
commit | 6ad99ac1efe2a0c52f0652356dc397097b5d577c (patch) | |
tree | eb6537f53e7d619a04aae8bb9bdf0c67b61e3a23 /lib | |
parent | c399d176b26bf3e18009a37d2eab156f63c4f17e (diff) | |
download | android-node-v8-6ad99ac1efe2a0c52f0652356dc397097b5d577c.tar.gz android-node-v8-6ad99ac1efe2a0c52f0652356dc397097b5d577c.tar.bz2 android-node-v8-6ad99ac1efe2a0c52f0652356dc397097b5d577c.zip |
tls: fix check for reused session
When TLS Session Ticket is renewed by server - no Certificate record is
to the client. We are prepared for empty certificate in this case, but
this relies on the session reuse check, which was implemented
incorrectly and was returning false when the TLS Session Ticket was
renewed.
Use session reuse check provided by OpenSSL instead.
Fix: https://github.com/nodejs/io.js/issues/2304
PR-URL: https://github.com/nodejs/io.js/pull/2312
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_tls_wrap.js | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 182346904c..b5d1899480 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -584,17 +584,6 @@ TLSSocket.prototype._start = function() { this._handle.start(); }; -TLSSocket.prototype._isSessionResumed = function _isSessionResumed(session) { - if (!session) - return false; - - var next = this.getSession(); - if (!next) - return false; - - return next.equals(session); -}; - TLSSocket.prototype.setServername = function(name) { this._handle.setServername(name); }; @@ -1011,7 +1000,7 @@ exports.connect = function(/* [port, host], options, cb */) { // Verify that server's identity matches it's certificate's names // Unless server has resumed our existing session - if (!verifyError && !socket._isSessionResumed(options.session)) { + if (!verifyError && !socket.isSessionReused()) { var cert = socket.getPeerCertificate(); verifyError = options.checkServerIdentity(hostname, cert); } |