mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-03-11 08:54:48 +00:00
SSH Agent: Track keys immediately after successful add
Move m_addedKeys insertion after key add success but before optional cert add. Ensures keys are always tracked (and auto-removed) even if cert fails.
This commit is contained in:
parent
94ef87050a
commit
963bbd0c17
1 changed files with 4 additions and 3 deletions
|
|
@ -330,6 +330,10 @@ bool SSHAgent::addIdentity(OpenSSHKey& key, const KeeAgentSettings& settings, co
|
|||
return false;
|
||||
}
|
||||
|
||||
OpenSSHKey keyCopy = key;
|
||||
keyCopy.clearPrivate();
|
||||
m_addedKeys[keyCopy] = qMakePair(databaseUuid, settings.removeAtDatabaseClose());
|
||||
|
||||
if (settings.useCertificate()) {
|
||||
QByteArray requestCertificateData;
|
||||
BinaryStream requestCertificate(&requestCertificateData);
|
||||
|
|
@ -384,9 +388,6 @@ bool SSHAgent::addIdentity(OpenSSHKey& key, const KeeAgentSettings& settings, co
|
|||
}
|
||||
}
|
||||
|
||||
OpenSSHKey keyCopy = key;
|
||||
keyCopy.clearPrivate();
|
||||
m_addedKeys[keyCopy] = qMakePair(databaseUuid, settings.removeAtDatabaseClose());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue