test: change misleading variable name

The return value of getPrime() is not a private key in any way.

Refs: https://github.com/nodejs/node-v0.x-archive/pull/2638

PR-URL: https://github.com/nodejs/node/pull/43990
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Tobias Nießen 2022-07-26 10:51:42 +02:00 committed by GitHub
parent 7a18ee8315
commit 7abbbf2ff3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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');
}