SSH Agent: Fix handling of encrypted RSA keys

Also fix multiple UI issues caused by said keys.

Fixes #1560
This commit is contained in:
Toni Spets 2018-03-01 18:27:53 +02:00 committed by Janek Bevendorff
parent 97a890e8a0
commit b0a61f437a
4 changed files with 52 additions and 26 deletions

View file

@ -260,6 +260,10 @@ void SSHAgent::databaseModeChanged(DatabaseWidget::Mode mode)
continue;
}
if (!key.openPrivateKey(e->password())) {
continue;
}
if (key.comment().isEmpty()) {
key.setComment(e->username());
}
@ -268,7 +272,7 @@ void SSHAgent::databaseModeChanged(DatabaseWidget::Mode mode)
removeIdentityAtLock(key, uuid);
}
if (settings.addAtDatabaseOpen() && key.openPrivateKey(e->password())) {
if (settings.addAtDatabaseOpen()) {
int lifetime = 0;
if (settings.useLifetimeConstraintWhenAdding()) {