Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f6b2ea8

Browse filesBrowse files
sam-githubtargos
authored andcommitted
tls: do not confuse session and session ID
session ID was named session in C++ and key in JS, Name them after what they are, as the 'newSession' event docs do. PR-URL: #25153 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
1 parent d5ba121 commit f6b2ea8
Copy full SHA for f6b2ea8

File tree

Expand file treeCollapse file tree

2 files changed

+12
-12
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-12
lines changed
Open diff view settings
Collapse file

‎lib/_tls_wrap.js‎

Copy file name to clipboardExpand all lines: lib/_tls_wrap.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ function requestOCSPDone(socket) {
212212
}
213213

214214

215-
function onnewsession(key, session) {
215+
function onnewsession(sessionId, session) {
216216
const owner = this[owner_symbol];
217217

218218
if (!owner.server)
@@ -236,7 +236,7 @@ function onnewsession(key, session) {
236236
};
237237

238238
owner._newSessionPending = true;
239-
if (!owner.server.emit('newSession', key, session, done))
239+
if (!owner.server.emit('newSession', sessionId, session, done))
240240
done();
241241
}
242242

Collapse file

‎src/node_crypto.cc‎

Copy file name to clipboardExpand all lines: src/node_crypto.cc
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,20 +1483,20 @@ int SSLWrap<Base>::NewSessionCallback(SSL* s, SSL_SESSION* sess) {
14831483
return 0;
14841484

14851485
// Serialize session
1486-
Local<Object> buff = Buffer::New(env, size).ToLocalChecked();
1487-
unsigned char* serialized = reinterpret_cast<unsigned char*>(
1488-
Buffer::Data(buff));
1489-
memset(serialized, 0, size);
1490-
i2d_SSL_SESSION(sess, &serialized);
1486+
Local<Object> session = Buffer::New(env, size).ToLocalChecked();
1487+
unsigned char* session_data = reinterpret_cast<unsigned char*>(
1488+
Buffer::Data(session));
1489+
memset(session_data, 0, size);
1490+
i2d_SSL_SESSION(sess, &session_data);
14911491

14921492
unsigned int session_id_length;
1493-
const unsigned char* session_id = SSL_SESSION_get_id(sess,
1494-
&session_id_length);
1495-
Local<Object> session = Buffer::Copy(
1493+
const unsigned char* session_id_data = SSL_SESSION_get_id(sess,
1494+
&session_id_length);
1495+
Local<Object> session_id = Buffer::Copy(
14961496
env,
1497-
reinterpret_cast<const char*>(session_id),
1497+
reinterpret_cast<const char*>(session_id_data),
14981498
session_id_length).ToLocalChecked();
1499-
Local<Value> argv[] = { session, buff };
1499+
Local<Value> argv[] = { session_id, session };
15001500
w->new_session_wait_ = true;
15011501
w->MakeCallback(env->onnewsession_string(), arraysize(argv), argv);
15021502

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.