File tree Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -6,21 +6,8 @@ if (!common.hasCrypto)
6
6
const assert = require ( 'assert' ) ;
7
7
const crypto = require ( 'crypto' ) ;
8
8
9
- assert . throws (
10
- function ( ) {
11
- crypto . getDiffieHellman ( 'modp1' ) . setPrivateKey ( '' ) ;
12
- } ,
13
- new RegExp ( '^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
14
- 'setPrivateKey is not a function$' ) ,
15
- 'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' +
16
- 'failed to throw the expected error.'
17
- ) ;
18
- assert . throws (
19
- function ( ) {
20
- crypto . getDiffieHellman ( 'modp1' ) . setPublicKey ( '' ) ;
21
- } ,
22
- new RegExp ( '^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
23
- 'setPublicKey is not a function$' ) ,
24
- 'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' +
25
- 'failed to throw the expected error.'
26
- ) ;
9
+ // Unlike DiffieHellman, DiffieHellmanGroup does not have any setters.
10
+ const dhg = crypto . getDiffieHellman ( 'modp1' ) ;
11
+ assert . strictEqual ( dhg . constructor , crypto . DiffieHellmanGroup ) ;
12
+ assert . strictEqual ( dhg . setPrivateKey , undefined ) ;
13
+ assert . strictEqual ( dhg . setPublicKey , undefined ) ;
You can’t perform that action at this time.
0 commit comments