File tree 2 files changed +27
-27
lines changed
2 files changed +27
-27
lines changed Original file line number Diff line number Diff line change @@ -388,3 +388,30 @@ common.expectsError(
388
388
message : 'The "curve" argument must be of type string. ' +
389
389
'Received type undefined'
390
390
} ) ;
391
+
392
+ assert . throws (
393
+ function ( ) {
394
+ crypto . getDiffieHellman ( 'unknown-group' ) ;
395
+ } ,
396
+ / ^ E r r o r : U n k n o w n g r o u p $ / ,
397
+ 'crypto.getDiffieHellman(\'unknown-group\') ' +
398
+ 'failed to throw the expected error.'
399
+ ) ;
400
+ assert . throws (
401
+ function ( ) {
402
+ crypto . getDiffieHellman ( 'modp1' ) . setPrivateKey ( '' ) ;
403
+ } ,
404
+ new RegExp ( '^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
405
+ 'setPrivateKey is not a function$' ) ,
406
+ 'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' +
407
+ 'failed to throw the expected error.'
408
+ ) ;
409
+ assert . throws (
410
+ function ( ) {
411
+ crypto . getDiffieHellman ( 'modp1' ) . setPublicKey ( '' ) ;
412
+ } ,
413
+ new RegExp ( '^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
414
+ 'setPublicKey is not a function$' ) ,
415
+ 'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' +
416
+ 'failed to throw the expected error.'
417
+ ) ;
Original file line number Diff line number Diff line change @@ -27,33 +27,6 @@ if (!common.hasCrypto)
27
27
const assert = require ( 'assert' ) ;
28
28
const crypto = require ( 'crypto' ) ;
29
29
30
- assert . throws (
31
- function ( ) {
32
- crypto . getDiffieHellman ( 'unknown-group' ) ;
33
- } ,
34
- / ^ E r r o r : U n k n o w n g r o u p $ / ,
35
- 'crypto.getDiffieHellman(\'unknown-group\') ' +
36
- 'failed to throw the expected error.'
37
- ) ;
38
- assert . throws (
39
- function ( ) {
40
- crypto . getDiffieHellman ( 'modp1' ) . setPrivateKey ( '' ) ;
41
- } ,
42
- new RegExp ( '^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
43
- 'setPrivateKey is not a function$' ) ,
44
- 'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' +
45
- 'failed to throw the expected error.'
46
- ) ;
47
- assert . throws (
48
- function ( ) {
49
- crypto . getDiffieHellman ( 'modp1' ) . setPublicKey ( '' ) ;
50
- } ,
51
- new RegExp ( '^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
52
- 'setPublicKey is not a function$' ) ,
53
- 'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' +
54
- 'failed to throw the expected error.'
55
- ) ;
56
-
57
30
const hashes = {
58
31
modp1 : '630e9acd2cc63f7e80d8507624ba60ac0757201a' ,
59
32
modp2 : '18f7aa964484137f57bca64b21917a385b6a0b60' ,
You can’t perform that action at this time.
0 commit comments