From 948d15ea955aee941a646fb10a5332bb8c075674 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Thu, 15 Oct 2020 21:45:27 +0300 Subject: [PATCH] Follow-up on #1687 Don't ask for password on invalid keystores --- beacon_chain/keystore_management.nim | 5 ++++- tests/test_keystore.nim | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon_chain/keystore_management.nim b/beacon_chain/keystore_management.nim index 4a44e3250..7c21e91f9 100644 --- a/beacon_chain/keystore_management.nim +++ b/beacon_chain/keystore_management.nim @@ -596,7 +596,10 @@ proc importKeystoresFromDir*(rng: var BrHmacDrbgContext, else: error "Imported keystore holds invalid key", file, err = privKey.error break - of InvalidKeystore, InvalidPassword: + of InvalidKeystore: + warn "Invalid keystore", file + break + of InvalidPassword: if firstDecryptionAttempt: try: const msg = "Please enter the password for decrypting '$1' " & diff --git a/tests/test_keystore.nim b/tests/test_keystore.nim index aa632d000..58c86e3a6 100644 --- a/tests/test_keystore.nim +++ b/tests/test_keystore.nim @@ -279,9 +279,6 @@ suiteReport "KeyStorage testing suite": check decryptKeystore(JsonString "{}", KeystorePass.init "").isErr - check decryptKeystore(JsonString "{}", - KeystorePass.init "").isErr - template checkVariant(remove): untyped = check decryptKeystore(JsonString pbkdf2Vector.replace(remove, "1234"), KeystorePass.init password).isErr