Catch exception from the password manager and pretend for now that the password was never saved.

This commit is contained in:
eelke 2022-07-08 19:55:19 +02:00
parent b5ca7099c1
commit f6c15f895f

View file

@ -185,6 +185,8 @@ bool ConnectionController::retrieveConnectionPassword(ConnectionConfig &cc)
} }
bool ConnectionController::retrieveFromPasswordManager(const std::string &password_id, const std::string_view &enc_password, std::string &password) bool ConnectionController::retrieveFromPasswordManager(const std::string &password_id, const std::string_view &enc_password, std::string &password)
{
try
{ {
if (!UnlockPasswordManagerIfNeeded()) if (!UnlockPasswordManagerIfNeeded())
return false; return false;
@ -192,6 +194,11 @@ bool ConnectionController::retrieveFromPasswordManager(const std::string &passwo
password = m_passwordManager->decrypt(password_id, enc_password); password = m_passwordManager->decrypt(password_id, enc_password);
return true; return true;
} }
catch (const PasswordManagerException &ex)
{
return false;
}
}
bool ConnectionController::encryptPassword(ConnectionConfig &cc) bool ConnectionController::encryptPassword(ConnectionConfig &cc)
{ {