mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
92fb7dd818
I can't tell why the test was written that way in the first place, but it seems sufficient to check that setPrivateKey and setPublicKey are both undefined. Refs: https://github.com/nodejs/node-v0.x-archive/pull/2638 Refs: https://github.com/nodejs/node/pull/11253 PR-URL: https://github.com/nodejs/node/pull/49404 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
14 lines
457 B
JavaScript
14 lines
457 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const crypto = require('crypto');
|
|
|
|
// Unlike DiffieHellman, DiffieHellmanGroup does not have any setters.
|
|
const dhg = crypto.getDiffieHellman('modp1');
|
|
assert.strictEqual(dhg.constructor, crypto.DiffieHellmanGroup);
|
|
assert.strictEqual(dhg.setPrivateKey, undefined);
|
|
assert.strictEqual(dhg.setPublicKey, undefined);
|