Skip to content

Commit

Permalink
test: update OpenSSL3 error messages for beta-1
Browse files Browse the repository at this point in the history
This commit updates error messages that have changed while these tests
were disabled.

PR-URL: #39437
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
danbev authored and targos committed Jul 21, 2021
1 parent 5132f6f commit 7357cae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-dh-stateless.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ assert.throws(() => {
crypto.generateKeyPairSync('ec', { namedCurve: not256k1 }));
}, common.hasOpenSSL3 ? {
name: 'Error',
code: 'ERR_OSSL_MISMATCHING_SHARED_PARAMETERS'
code: 'ERR_OSSL_MISMATCHING_DOMAIN_PARAMETERS'
} : {
name: 'Error',
code: 'ERR_OSSL_EVP_DIFFERENT_PARAMETERS'
Expand Down
7 changes: 3 additions & 4 deletions test/parallel/test-crypto-key-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
assert.throws(() => {
createPrivateKey({ key: '' });
}, common.hasOpenSSL3 ? {
message: 'Failed to read private key',
message: 'error:1E08010C:DECODER routines::unsupported',
} : {
message: 'error:0909006C:PEM routines:get_name:no start line',
code: 'ERR_OSSL_PEM_NO_START_LINE',
Expand Down Expand Up @@ -519,8 +519,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
// Reading an encrypted key without a passphrase should fail.
assert.throws(() => createPrivateKey(privateDsa), common.hasOpenSSL3 ? {
name: 'Error',
message: 'error:07880109:common libcrypto routines::interrupted or ' +
'cancelled',
message: 'error:1E08010C:DECODER routines::unsupported',
} : {
name: 'TypeError',
code: 'ERR_MISSING_PASSPHRASE',
Expand All @@ -546,7 +545,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
passphrase: Buffer.alloc(1024, 'a')
}), {
message: common.hasOpenSSL3 ?
'error:07880109:common libcrypto routines::interrupted or cancelled' :
'error:1E08010C:DECODER routines::unsupported' :
/bad decrypt/
});

Expand Down
6 changes: 2 additions & 4 deletions test/parallel/test-crypto-keygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
// Since the private key is encrypted, signing shouldn't work anymore.
assert.throws(() => testSignVerify(publicKey, privateKey),
common.hasOpenSSL3 ? {
message: 'error:07880109:common libcrypto ' +
'routines::interrupted or cancelled'
message: 'error:1E08010C:DECODER routines::unsupported'
} : {
name: 'TypeError',
code: 'ERR_MISSING_PASSPHRASE',
Expand Down Expand Up @@ -587,8 +586,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
// Since the private key is encrypted, signing shouldn't work anymore.
assert.throws(() => testSignVerify(publicKey, privateKey),
common.hasOpenSSL3 ? {
message: 'error:07880109:common libcrypto ' +
'routines::interrupted or cancelled'
message: 'error:1E08010C:DECODER routines::unsupported'
} : {
name: 'TypeError',
code: 'ERR_MISSING_PASSPHRASE',
Expand Down

0 comments on commit 7357cae

Please sign in to comment.