Fix password strength evaluation for referenced passwords (#13479)

* Also fix password strength in entry view

---------

Co-authored-by: Jonathan White <[email protected]>
This commit is contained in:
ryain11andJonathan White authored and GitHub committed 2026-07-21 12:58:23 -04:00
1 parent 6a534f38c6
commit e888fec070
4 files changed
+20 -3

No files matched your search

+2 -2
View File
@@ -231,7 +231,7 @@ QString Entry::defaultAutoTypeSequence() const
const QSharedPointer<PasswordHealth> Entry::passwordHealth()
{
if (!m_data.passwordHealth) {
m_data.passwordHealth.reset(new PasswordHealth(resolvePlaceholder(password())));
m_data.passwordHealth.reset(new PasswordHealth(resolveMultiplePlaceholders(password())));
}
return m_data.passwordHealth;
}
@@ -239,7 +239,7 @@ const QSharedPointer<PasswordHealth> Entry::passwordHealth()
const QSharedPointer<PasswordHealth> Entry::passwordHealth() const
{
if (!m_data.passwordHealth) {
return QSharedPointer<PasswordHealth>::create(resolvePlaceholder(password()));
return QSharedPointer<PasswordHealth>::create(resolveMultiplePlaceholders(password()));
}
return m_data.passwordHealth;
}
+6 -1
View File
@@ -95,7 +95,12 @@ PasswordWidget::PasswordWidget(QWidget* parent)
m_ui->qualityProgressBar->setVisible(false);
connect(m_ui->passwordEdit, &QLineEdit::textChanged, this, [this](const QString& pwd) {
updatePasswordStrength(pwd);
QString resolvedPwd = pwd;
// Making a request to dereference the password
emit requestPlaceholderResolution(pwd, resolvedPwd);
updatePasswordStrength(resolvedPwd);
emit textChanged(pwd);
});
}
+1
View File
@@ -48,6 +48,7 @@ public:
signals:
void textChanged(QString text);
void requestPlaceholderResolution(const QString& rawText, QString& resolvedText);
public slots:
void setText(const QString& text);
+11
View File
@@ -40,6 +40,7 @@
#include "core/Metadata.h"
#include "core/PasswordGenerator.h"
#include "core/TimeDelta.h"
#include "gui/PasswordWidget.h"
#ifdef KPXC_FEATURE_SSHAGENT
#include "sshagent/OpenSSHKey.h"
#include "sshagent/OpenSSHKeyGenDialog.h"
@@ -138,6 +139,16 @@ EditEntryWidget::EditEntryWidget(QWidget* parent)
m_editWidgetProperties->setCustomData(m_customData.data());
m_mainUi->passwordEdit->setQualityVisible(true);
connect(m_mainUi->passwordEdit,
&PasswordWidget::requestPlaceholderResolution,
this,
[this](const QString& rawText, QString& resolvedText) {
if (m_entry) {
// Dereferencing the password of the entry
resolvedText = m_entry->resolveMultiplePlaceholders(rawText);
}
});
}
EditEntryWidget::~EditEntryWidget() = default;