Follow-up on #1687 Don't ask for password on invalid keystores
This commit is contained in:
parent
db70f066ba
commit
948d15ea95
|
@ -596,7 +596,10 @@ proc importKeystoresFromDir*(rng: var BrHmacDrbgContext,
|
||||||
else:
|
else:
|
||||||
error "Imported keystore holds invalid key", file, err = privKey.error
|
error "Imported keystore holds invalid key", file, err = privKey.error
|
||||||
break
|
break
|
||||||
of InvalidKeystore, InvalidPassword:
|
of InvalidKeystore:
|
||||||
|
warn "Invalid keystore", file
|
||||||
|
break
|
||||||
|
of InvalidPassword:
|
||||||
if firstDecryptionAttempt:
|
if firstDecryptionAttempt:
|
||||||
try:
|
try:
|
||||||
const msg = "Please enter the password for decrypting '$1' " &
|
const msg = "Please enter the password for decrypting '$1' " &
|
||||||
|
|
|
@ -279,9 +279,6 @@ suiteReport "KeyStorage testing suite":
|
||||||
check decryptKeystore(JsonString "{}",
|
check decryptKeystore(JsonString "{}",
|
||||||
KeystorePass.init "").isErr
|
KeystorePass.init "").isErr
|
||||||
|
|
||||||
check decryptKeystore(JsonString "{}",
|
|
||||||
KeystorePass.init "").isErr
|
|
||||||
|
|
||||||
template checkVariant(remove): untyped =
|
template checkVariant(remove): untyped =
|
||||||
check decryptKeystore(JsonString pbkdf2Vector.replace(remove, "1234"),
|
check decryptKeystore(JsonString pbkdf2Vector.replace(remove, "1234"),
|
||||||
KeystorePass.init password).isErr
|
KeystorePass.init password).isErr
|
||||||
|
|
Loading…
Reference in New Issue