Skip to content

Commit 91620b8

Browse files
bnoordhuisBethGriggs
authored andcommittedMar 20, 2019
tls: fix legacy SecurePair session resumption
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>
1 parent c07ba96 commit 91620b8

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed
 

‎lib/_tls_legacy.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,9 @@ function onnewsession(key, session) {
691691
return;
692692
once = true;
693693

694-
if (self.ssl)
695-
self.ssl.newSessionDone();
694+
// Cycle data
695+
self.cleartext.read(0);
696+
self.encrypted.read(0);
696697
}
697698
}
698699

‎src/env.h

-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ class ModuleWrap;
216216
V(onheaders_string, "onheaders") \
217217
V(onmessage_string, "onmessage") \
218218
V(onnewsession_string, "onnewsession") \
219-
V(onnewsessiondone_string, "onnewsessiondone") \
220219
V(onocspresponse_string, "onocspresponse") \
221220
V(ongoawaydata_string, "ongoawaydata") \
222221
V(onorigin_string, "onorigin") \

‎src/node_crypto.cc

-3
Original file line numberDiff line numberDiff line change
@@ -2965,9 +2965,6 @@ void Connection::SetShutdownFlags() {
29652965

29662966

29672967
void Connection::NewSessionDoneCb() {
2968-
HandleScope scope(env()->isolate());
2969-
2970-
MakeCallback(env()->onnewsessiondone_string(), 0, nullptr);
29712968
}
29722969

29732970

0 commit comments

Comments
 (0)
Please sign in to comment.