Skip to content

Commit

Permalink
tls: fix legacy SecurePair session resumption
Browse files Browse the repository at this point in the history
This seems to have been broken ever since its introduction 5 years ago
in commit 75ea11f ("tls: introduce asynchronous `newSession`") and
no one complained but that's not going to stop me from fixing it anyway
because otherwise I can't write a regression test for issue #26428.

Refs: #26428

PR-URL: #26452
Fixes: #26428
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
  • Loading branch information
bnoordhuis authored and BethGriggs committed Mar 20, 2019
1 parent c07ba96 commit 91620b8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/_tls_legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,9 @@ function onnewsession(key, session) {
return;
once = true;

if (self.ssl)
self.ssl.newSessionDone();
// Cycle data
self.cleartext.read(0);
self.encrypted.read(0);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ class ModuleWrap;
V(onheaders_string, "onheaders") \
V(onmessage_string, "onmessage") \
V(onnewsession_string, "onnewsession") \
V(onnewsessiondone_string, "onnewsessiondone") \
V(onocspresponse_string, "onocspresponse") \
V(ongoawaydata_string, "ongoawaydata") \
V(onorigin_string, "onorigin") \
Expand Down
3 changes: 0 additions & 3 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2965,9 +2965,6 @@ void Connection::SetShutdownFlags() {


void Connection::NewSessionDoneCb() {
HandleScope scope(env()->isolate());

MakeCallback(env()->onnewsessiondone_string(), 0, nullptr);
}


Expand Down

0 comments on commit 91620b8

Please sign in to comment.