Skip to content

Commit

Permalink
test: change misleading variable name
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Feng Yu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
tniessen authored and ruyadorno committed Aug 22, 2022
1 parent 7af55db commit 3c8037a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/pummel/test-crypto-dh-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,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 3c8037a

Please sign in to comment.