Passwords are now saved in a password manager.

The password manager uses strong encryption using a key derived from the passphrase using
scrypt key strengthening algorithm. This ensures encryption is performed using a strong key
and that brute forcing the passphrase is time consuming.

If the user loses his passphrase no recovery is possible.
This commit is contained in:
eelke 2018-11-08 21:50:49 +01:00
parent 2230a4bd61
commit e36924c087
27 changed files with 605 additions and 346 deletions

View file

@ -15,10 +15,10 @@ enum class SslMode {
verify_full=5
};
enum class PasswordMode {
Unsave,
Encrypted,
DontSave
enum class PasswordState {
NotNeeded, ///< the Connection doesn't require a password
NotStored, ///< password needed but we do not know it
SavedPasswordManager, ///< Saved in the password manager
};
class QProcessEnvironment;
@ -70,6 +70,9 @@ public:
const char * const * getKeywords() const;
const char * const * getValues() const;
PasswordState passwordState() const;
void setPasswordState(PasswordState password_state);
bool isSameDatabase(const ConnectionConfig &rhs) const;
void writeToEnvironment(QProcessEnvironment &env) const;
@ -84,7 +87,7 @@ private:
std::string m_port = "5432";
std::string m_user;
std::string m_password;
std::string m_password; ///< TODO do we want to keep this here or should we remember it seperatly?
std::string m_dbname;
std::string m_sslMode;
@ -94,9 +97,11 @@ private:
std::string m_sslCrl;
std::string m_applicationName;
PasswordState m_passwordState = PasswordState::NotStored;
bool m_dirty = false;
static void strToEnv(QProcessEnvironment &env, const QString &var, const std::string &val);
static std::vector<const char*> s_keywords;