Follow-up on #1687 Don't ask for password on invalid keystores

This commit is contained in:
Zahary Karadjov 2020-10-15 21:45:27 +03:00 committed by zah
parent db70f066ba
commit 948d15ea95
2 changed files with 4 additions and 4 deletions

View File

@ -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' " &

View File

@ -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