IDEA-126245 Master Password: IllegalState exception while creating a new data source if master password was not set

This commit is contained in:
Gregory.Shrago
2014-06-16 23:13:30 +04:00
parent d438f1966c
commit 36662d5ade
2 changed files with 4 additions and 3 deletions
@@ -19,6 +19,7 @@ import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@@ -120,8 +121,8 @@ public class EncryptionUtil {
c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(password, SECRET_KEY_ALGORITHM), CBC_SALT_KEY);
return c.doFinal(rawKey);
}
catch (Exception e) {
throw new IllegalStateException(ENCRYPT_KEY_ALGORITHM + " is not available", e);
catch (GeneralSecurityException e) {
throw new IllegalStateException(e.getMessage(), e);
}
}
@@ -211,8 +211,8 @@ public class MasterKeyPasswordSafe extends BasePasswordSafeProvider {
}
else {
MasterPasswordDialog.askPassword(project, MasterKeyPasswordSafe.this, requestor);
result.set(key.get().get());
}
result.set(key.get().get());
}
catch (PasswordSafeException e) {
ex.set(e);