@ -362,8 +362,7 @@ for (var i in TEST_CASES) {
( function ( ) {
( function ( ) {
if ( ! test . password ) return ;
if ( ! test . password ) return ;
if ( common . hasFipsCrypto ) {
if ( common . hasFipsCrypto ) {
assert . throws ( function ( )
assert . throws ( ( ) => { crypto . createCipher ( test . algo , test . password ) ; } ,
{ crypto . createCipher ( test . algo , test . password ) ; } ,
/not supported in FIPS mode/ ) ;
/not supported in FIPS mode/ ) ;
} else {
} else {
var encrypt = crypto . createCipher ( test . algo , test . password ) ;
var encrypt = crypto . createCipher ( test . algo , test . password ) ;
@ -383,8 +382,7 @@ for (var i in TEST_CASES) {
( function ( ) {
( function ( ) {
if ( ! test . password ) return ;
if ( ! test . password ) return ;
if ( common . hasFipsCrypto ) {
if ( common . hasFipsCrypto ) {
assert . throws ( function ( )
assert . throws ( ( ) => { crypto . createDecipher ( test . algo , test . password ) ; } ,
{ crypto . createDecipher ( test . algo , test . password ) ; } ,
/not supported in FIPS mode/ ) ;
/not supported in FIPS mode/ ) ;
} else {
} else {
var decrypt = crypto . createDecipher ( test . algo , test . password ) ;
var decrypt = crypto . createDecipher ( test . algo , test . password ) ;
@ -415,9 +413,9 @@ for (var i in TEST_CASES) {
'ipxp9a6i1Mb4USb4' , '6fKjEjR3Vl30EUYC' ) ;
'ipxp9a6i1Mb4USb4' , '6fKjEjR3Vl30EUYC' ) ;
encrypt . update ( 'blah' , 'ascii' ) ;
encrypt . update ( 'blah' , 'ascii' ) ;
encrypt . final ( ) ;
encrypt . final ( ) ;
assert . throws ( function ( ) { encrypt . getAuthTag ( ) ; } , / state/ ) ;
assert . throws ( ( ) => { encrypt . getAuthTag ( ) ; } , / state/ ) ;
assert . throws ( function ( ) {
assert . throws ( ( ) => { encrypt . setAAD ( Buffer . from ( '123' , 'ascii' ) ) ; } ,
encrypt . setAAD ( Buffer . from ( '123' , 'ascii' ) ) ; } , / state/ ) ;
/ state/ ) ;
} ) ( ) ;
} ) ( ) ;
( function ( ) {
( function ( ) {
@ -432,8 +430,8 @@ for (var i in TEST_CASES) {
// trying to set tag on encryption object:
// trying to set tag on encryption object:
var encrypt = crypto . createCipheriv ( test . algo ,
var encrypt = crypto . createCipheriv ( test . algo ,
Buffer . from ( test . key , 'hex' ) , Buffer . from ( test . iv , 'hex' ) ) ;
Buffer . from ( test . key , 'hex' ) , Buffer . from ( test . iv , 'hex' ) ) ;
assert . throws ( function ( ) {
assert . throws ( ( ) => { encrypt . setAuthTag ( Buffer . from ( test . tag , 'hex' ) ) ; } ,
encrypt . setAuthTag ( Buffer . from ( test . tag , 'hex' ) ) ; } , / state/ ) ;
/ state/ ) ;
} ) ( ) ;
} ) ( ) ;
( function ( ) {
( function ( ) {