Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 31c1ee4

Browse files
danbevBethGriggs
authored andcommittedFeb 12, 2019
test: minor refactoring of onticketkeycallback
The motivation for this commit is to make the the onticketkeycallback function more readable. PR-URL: #24718 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent c0423cf commit 31c1ee4

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed
 

‎test/parallel/test-https-resume-after-renew.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@ const hmac = Buffer.alloc(16, 'H');
2222

2323
server._sharedCreds.context.enableTicketKeyCallback();
2424
server._sharedCreds.context.onticketkeycallback = function(name, iv, enc) {
25-
let newName, newIV;
2625
if (enc) {
27-
newName = Buffer.alloc(16, 'A');
28-
newIV = crypto.randomBytes(16);
29-
} else {
30-
// Renew
31-
return [ 2, hmac, aes ];
26+
const newName = Buffer.alloc(16, 'A');
27+
const newIV = crypto.randomBytes(16);
28+
return [ 1, hmac, aes, newName, newIV ];
3229
}
33-
34-
return [ 1, hmac, aes, newName, newIV ];
30+
// Renew
31+
return [ 2, hmac, aes ];
3532
};
3633

3734
server.listen(0, function() {

0 commit comments

Comments
 (0)
Please sign in to comment.