0
0
mirror of https://github.com/keepassxreboot/keepassxc.git synced 2024-09-20 12:22:16 +02:00

SSH Agent: Helpful error message for adding keys

This adds more helpful error messages when adding keys to an agent
fails.

Closes #1667.
This commit is contained in:
Thomas Luzat 2018-03-07 23:39:38 +01:00 committed by Jonathan White
parent 46099fdd71
commit 64f5ee6399

View File

@ -186,7 +186,17 @@ bool SSHAgent::addIdentity(OpenSSHKey& key, quint32 lifetime, bool confirm)
}
if (responseData.length() < 1 || static_cast<quint8>(responseData[0]) != SSH_AGENT_SUCCESS) {
m_error = tr("Agent refused this identity.");
m_error = tr("Agent refused this identity. Possible reasons include:")
+ "\n" + tr("The key has already been added.");
if (lifetime > 0) {
m_error += "\n" + tr("Restricted lifetime is not supported by the agent (check options).");
}
if (confirm) {
m_error += "\n" + tr("A confirmation request is not supported by the agent (check options).");
}
return false;
}