GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: update tls test to use better terminology · nodejs/node@580b647

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/common
    • tls.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/common/tls.js‎

Copy file name to clipboardExpand all lines: test/common/tls.js
+13-13Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class TestTLSSocket extends net.Socket {
1515
this.handshake_list = [];
1616
// AES128-GCM-SHA256
1717
this.ciphers = Buffer.from('000002009c0', 'hex');
18-
this.pre_master_secret =
18+
this.pre_primary_secret =
1919
Buffer.concat([this.version, crypto.randomBytes(46)]);
20-
this.master_secret = null;
20+
this.primary_secret = null;
2121
this.write_seq = 0;
2222
this.client_random = crypto.randomBytes(32);
2323

@@ -26,12 +26,12 @@ class TestTLSSocket extends net.Socket {
2626
});
2727

2828
this.on('server_random', (server_random) => {
29-
this.master_secret = PRF12('sha256', this.pre_master_secret,
30-
'master secret',
31-
Buffer.concat([this.client_random,
32-
server_random]),
33-
48);
34-
const key_block = PRF12('sha256', this.master_secret,
29+
this.primary_secret = PRF12('sha256', this.pre_primary_secret,
30+
'primary secret',
31+
Buffer.concat([this.client_random,
32+
server_random]),
33+
48);
34+
const key_block = PRF12('sha256', this.primary_secret,
3535
'key expansion',
3636
Buffer.concat([server_random,
3737
this.client_random]),
@@ -51,14 +51,14 @@ class TestTLSSocket extends net.Socket {
5151
}
5252

5353
createClientKeyExchange() {
54-
const encrypted_pre_master_secret = crypto.publicEncrypt({
54+
const encrypted_pre_primary_secret = crypto.publicEncrypt({
5555
key: this.server_cert,
5656
padding: crypto.constants.RSA_PKCS1_PADDING
57-
}, this.pre_master_secret);
57+
}, this.pre_primary_secret);
5858
const length = Buffer.alloc(2);
59-
length.writeUIntBE(encrypted_pre_master_secret.length, 0, 2);
59+
length.writeUIntBE(encrypted_pre_primary_secret.length, 0, 2);
6060
const msg = addHandshakeHeader(0x10, Buffer.concat([
61-
length, encrypted_pre_master_secret]));
61+
length, encrypted_pre_primary_secret]));
6262
this.emit('handshake', msg);
6363
return addRecordHeader(0x16, msg);
6464
}
@@ -67,7 +67,7 @@ class TestTLSSocket extends net.Socket {
6767
const shasum = crypto.createHash('sha256');
6868
shasum.update(Buffer.concat(this.handshake_list));
6969
const message_hash = shasum.digest();
70-
const r = PRF12('sha256', this.master_secret,
70+
const r = PRF12('sha256', this.primary_secret,
7171
'client finished', message_hash, 12);
7272
const msg = addHandshakeHeader(0x14, r);
7373
this.emit('handshake', msg);

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.