Skip to content

Commit

Permalink
Several improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
droidmonkey committed May 26, 2024
1 parent eb41a68 commit 9299bf9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 4 additions & 0 deletions share/translations/keepassxc_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2665,6 +2665,10 @@ Would you like to correct it?</source>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>Failed to decrypt SSH key, ensure password is correct.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditEntryWidgetAdvanced</name>
Expand Down
6 changes: 3 additions & 3 deletions src/gui/entry/EditEntryWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,7 @@ void EditEntryWidget::updateSSHAgentKeyInfo()
m_sshAgentUi->commentTextLabel->setText(key.comment());
}

if (key.encrypted()) {
m_sshAgentUi->decryptButton->setEnabled(true);
}
m_sshAgentUi->decryptButton->setEnabled(key.encrypted());

if (!key.publicKey().isEmpty()) {
m_sshAgentUi->publicKeyEdit->document()->setPlainText(key.publicKey());
Expand Down Expand Up @@ -787,6 +785,7 @@ void EditEntryWidget::decryptPrivateKey()
OpenSSHKey key;

if (!getOpenSSHKey(key, true)) {
showMessage(tr("Failed to decrypt SSH key, ensure password is correct."), MessageWidget::Error);
return;
}

Expand All @@ -800,6 +799,7 @@ void EditEntryWidget::decryptPrivateKey()
+ key.fingerprint(QCryptographicHash::Sha256));
m_sshAgentUi->publicKeyEdit->document()->setPlainText(key.publicKey());
m_sshAgentUi->copyToClipboardButton->setEnabled(true);
m_sshAgentUi->decryptButton->setEnabled(false);
}

void EditEntryWidget::copyPublicKey()
Expand Down
6 changes: 1 addition & 5 deletions src/sshagent/KeeAgentSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,7 @@ bool KeeAgentSettings::toOpenSSHKey(const QString& username,
}

if (key.comment().isEmpty()) {
key.setComment(username);
}

if (key.comment().isEmpty()) {
key.setComment(fileName);
key.setComment(QString("%1@%2").arg(username, fileName));
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion src/sshagent/OpenSSHKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const QString OpenSSHKey::type() const
const QString OpenSSHKey::fingerprint(QCryptographicHash::Algorithm algo) const
{
if (m_rawPublicData.isEmpty()) {
return {tr("(encrypted)")};
return tr("(encrypted)");
}

QByteArray publicKey;
Expand Down

0 comments on commit 9299bf9

Please # to comment.