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

@ -186,11 +186,18 @@ 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;
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)