Visitar URL original
test: change misleading variable name · nodejs/node@e009a35 · GitHub
The Wayback Machine - https://web.archive.org/web/20230219023145/https://github.com/nodejs/node/commit/e009a35d6e
Skip to content
Permalink
Browse files
test: change misleading variable name
The return value of getPrime() is not a private key in any way.

Refs: nodejs/node-v0.x-archive#2638

PR-URL: #43990
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
tniessen authored and juanarbol committed Oct 11, 2022
1 parent 21a29d4 commit e009a35
Showing 1 changed file with 2 additions and 2 deletions.
@@ -45,10 +45,10 @@ const hashes = {

for (const name in hashes) {
const group = crypto.getDiffieHellman(name);
const private_key = group.getPrime('hex');
const prime = group.getPrime('hex');
const hash1 = hashes[name];
const hash2 = crypto.createHash('sha1')
.update(private_key.toUpperCase()).digest('hex');
.update(prime.toUpperCase()).digest('hex');
assert.strictEqual(hash1, hash2);
assert.strictEqual(group.getGenerator('hex'), '02');
}

0 comments on commit e009a35

Please sign in to comment.