Commit 538dd8b7 authored by Volodymyr Yurchenko's avatar Volodymyr Yurchenko
Browse files

Let loadKeyStore catch wrong-password exceptions

parent 87a7cc92
......@@ -460,15 +460,10 @@ public class JAKeyStore {
else
jpf = getPassword();
try {
clientCert.load(null, pass);
loadTrusts(clientCert);
clientCert.load(null, pass);
loadTrusts(clientCert);
addKeyPairToKeyStore(clientCert, "User.cert", user_key, user_cert, jpf);
} catch (final Exception e) {
logger.severe("Cannot load clientCert: " + e.toString());
return false;
}
addKeyPairToKeyStore(clientCert, "User.cert", user_key, user_cert, jpf);
return true;
}
......@@ -854,6 +849,7 @@ public class JAKeyStore {
} catch (final org.bouncycastle.openssl.EncryptionException | org.bouncycastle.pkcs.PKCSException | javax.crypto.BadPaddingException e) {
logger.log(Level.SEVERE, "Wrong password! Try again", e);
System.err.println("Wrong password! Try again");
continue;
} catch (final Exception e) {
logger.log(Level.SEVERE, "Error loading the key", e);
System.err.println("Error loading the key");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment