summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2018-09-20 20:55:05 +0200
committerTobias Nießen <tniessen@tnie.de>2018-09-21 00:08:40 +0200
commitbad670c19dc29b7cdb42432f6d717ec5934aad7e (patch)
tree23281185d456e1fe407c9ac9c493f4e598bfa45f /test
parent3cb663a587147f68b5716c1641c408c6276be703 (diff)
downloadandroid-node-v8-bad670c19dc29b7cdb42432f6d717ec5934aad7e.tar.gz
android-node-v8-bad670c19dc29b7cdb42432f6d717ec5934aad7e.tar.bz2
android-node-v8-bad670c19dc29b7cdb42432f6d717ec5934aad7e.zip
test: fix flaky key pair generation test
There is a very small chance (about 0.4%) that OpenSSL will successfully decrypt a key without the correct passphrase and will then fail while parsing its ASN.1 structure. In those rare cases, the error message will be different. PR-URL: https://github.com/nodejs/node/pull/22980 Fixes: https://github.com/nodejs/node/issues/22978 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-crypto-keygen.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js
index f614b09292..08e37e2ac0 100644
--- a/test/parallel/test-crypto-keygen.js
+++ b/test/parallel/test-crypto-keygen.js
@@ -169,7 +169,7 @@ function convertDERToPEM(label, der) {
// Since the private key is encrypted, signing shouldn't work anymore.
assert.throws(() => {
testSignVerify(publicKey, privateKey);
- }, /bad decrypt/);
+ }, /bad decrypt|asn1 encoding routines/);
// Signing should work with the correct password.
testSignVerify(publicKey, {
@@ -232,7 +232,7 @@ function convertDERToPEM(label, der) {
// Since the private key is encrypted, signing shouldn't work anymore.
assert.throws(() => {
testSignVerify(publicKey, privateKey);
- }, /bad decrypt/);
+ }, /bad decrypt|asn1 encoding routines/);
testSignVerify(publicKey, {
key: privateKey,