Skip to content

Commit e73b107

Browse files
mhdawsonruyadorno
authored andcommitted
doc: update tls test to use better terminology
Given the effort to change the master branch to main, this may make sense as part of removing other references to the offending wording as well. Signed-off-by: Michael Dawson <[email protected]> PR-URL: #36851 Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent b7d8e61 commit e73b107

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

test/common/tls.js

+13-13
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)