diff --git a/share/translations/keepassxc_en.ts b/share/translations/keepassxc_en.ts index 1be7981056..2b55841e12 100644 --- a/share/translations/keepassxc_en.ts +++ b/share/translations/keepassxc_en.ts @@ -2556,10 +2556,6 @@ Disable safe saves and try again? n/a - - (encrypted) - - Select private key @@ -6232,6 +6228,10 @@ We recommend you use the AppImage available on our downloads page. Unexpected EOF when writing private key + + (encrypted) + + Invalid certificate file, expecting an OpenSSH certificate diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index 0523026f7c..7aee16b832 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -721,23 +721,19 @@ void EditEntryWidget::updateSSHAgentKeyInfo() if (!key.fingerprint().isEmpty()) { m_sshAgentUi->fingerprintTextLabel->setText(key.fingerprint(QCryptographicHash::Md5) + "\n" + key.fingerprint(QCryptographicHash::Sha256)); - } else { - m_sshAgentUi->fingerprintTextLabel->setText(tr("(encrypted)")); } - if (!key.comment().isEmpty() || !key.encrypted()) { + if (!key.comment().isEmpty()) { m_sshAgentUi->commentTextLabel->setText(key.comment()); - } else { - m_sshAgentUi->commentTextLabel->setText(tr("(encrypted)")); + } + + if (key.encrypted()) { m_sshAgentUi->decryptButton->setEnabled(true); } if (!key.publicKey().isEmpty()) { m_sshAgentUi->publicKeyEdit->document()->setPlainText(key.publicKey()); m_sshAgentUi->copyToClipboardButton->setEnabled(true); - } else { - m_sshAgentUi->publicKeyEdit->document()->setPlainText(tr("(encrypted)")); - m_sshAgentUi->copyToClipboardButton->setDisabled(true); } // enable agent buttons only if we have an agent running diff --git a/src/sshagent/OpenSSHKey.cpp b/src/sshagent/OpenSSHKey.cpp index 8db2d5852f..40d95a5171 100644 --- a/src/sshagent/OpenSSHKey.cpp +++ b/src/sshagent/OpenSSHKey.cpp @@ -93,7 +93,7 @@ const QString OpenSSHKey::certificateType() const const QString OpenSSHKey::fingerprint(QCryptographicHash::Algorithm algo) const { if (m_rawPublicData.isEmpty()) { - return {}; + return {tr("(encrypted)")}; } QByteArray publicKey; @@ -360,6 +360,8 @@ bool OpenSSHKey::parsePKCS1PEM(const QByteArray& in) // load private if no encryption if (!encrypted()) { return openKey(); + } else { + m_comment = tr("(encrypted)"); } return true;