@@ -211,16 +211,11 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
211211
212212 // Since the private key is encrypted, signing shouldn't work anymore.
213213 const publicKey = { key : publicKeyDER , ...publicKeyEncoding } ;
214- const expectedError = common . hasOpenSSL3 ? {
215- name : 'Error' ,
216- message : 'error:07880109:common libcrypto routines::interrupted or ' +
217- 'cancelled'
218- } : {
214+ assert . throws ( ( ) => testSignVerify ( publicKey , privateKey ) , {
219215 name : 'TypeError' ,
220216 code : 'ERR_MISSING_PASSPHRASE' ,
221217 message : 'Passphrase required for encrypted key'
222- } ;
223- assert . throws ( ( ) => testSignVerify ( publicKey , privateKey ) , expectedError ) ;
218+ } ) ;
224219
225220 const key = { key : privateKey , passphrase : 'secret' } ;
226221 testEncryptDecrypt ( publicKey , key ) ;
@@ -565,10 +560,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
565560
566561 // Since the private key is encrypted, signing shouldn't work anymore.
567562 assert . throws ( ( ) => testSignVerify ( publicKey , privateKey ) ,
568- common . hasOpenSSL3 ? {
569- message : 'error:07880109:common libcrypto ' +
570- 'routines::interrupted or cancelled'
571- } : {
563+ {
572564 name : 'TypeError' ,
573565 code : 'ERR_MISSING_PASSPHRASE' ,
574566 message : 'Passphrase required for encrypted key'
@@ -599,10 +591,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
599591
600592 // Since the private key is encrypted, signing shouldn't work anymore.
601593 assert . throws ( ( ) => testSignVerify ( publicKey , privateKey ) ,
602- common . hasOpenSSL3 ? {
603- message : 'error:07880109:common libcrypto ' +
604- 'routines::interrupted or cancelled'
605- } : {
594+ {
606595 name : 'TypeError' ,
607596 code : 'ERR_MISSING_PASSPHRASE' ,
608597 message : 'Passphrase required for encrypted key'
@@ -636,10 +625,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
636625
637626 // Since the private key is encrypted, signing shouldn't work anymore.
638627 assert . throws ( ( ) => testSignVerify ( publicKey , privateKey ) ,
639- common . hasOpenSSL3 ? {
640- message : 'error:07880109:common libcrypto ' +
641- 'routines::interrupted or cancelled'
642- } : {
628+ {
643629 name : 'TypeError' ,
644630 code : 'ERR_MISSING_PASSPHRASE' ,
645631 message : 'Passphrase required for encrypted key'
@@ -674,10 +660,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
674660
675661 // Since the private key is encrypted, signing shouldn't work anymore.
676662 assert . throws ( ( ) => testSignVerify ( publicKey , privateKey ) ,
677- common . hasOpenSSL3 ? {
678- message : 'error:07880109:common libcrypto ' +
679- 'routines::interrupted or cancelled'
680- } : {
663+ {
681664 name : 'TypeError' ,
682665 code : 'ERR_MISSING_PASSPHRASE' ,
683666 message : 'Passphrase required for encrypted key'
@@ -1571,11 +1554,7 @@ for (const type of ['pkcs1', 'pkcs8']) {
15711554 // the key, and not specifying a passphrase should fail when decoding it.
15721555 assert . throws ( ( ) => {
15731556 return testSignVerify ( publicKey , privateKey ) ;
1574- } , common . hasOpenSSL3 ? {
1575- name : 'Error' ,
1576- code : 'ERR_OSSL_CRYPTO_INTERRUPTED_OR_CANCELLED' ,
1577- message : 'error:07880109:common libcrypto routines::interrupted or cancelled'
1578- } : {
1557+ } , {
15791558 name : 'TypeError' ,
15801559 code : 'ERR_MISSING_PASSPHRASE' ,
15811560 message : 'Passphrase required for encrypted key'
0 commit comments