From 4374fe86c85ff1e65aa61a6953f1ca9f88831055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfram=20R=C3=B6sler?= Date: Sat, 28 Mar 2020 22:35:55 +0100 Subject: [PATCH] Introduce custom field name for the "this is a known bad pwd" flag Fixes #4168 --- src/core/PasswordHealth.cpp | 3 +++ src/core/PasswordHealth.h | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/core/PasswordHealth.cpp b/src/core/PasswordHealth.cpp index c179db77ca..b8fcf2074e 100644 --- a/src/core/PasswordHealth.cpp +++ b/src/core/PasswordHealth.cpp @@ -24,6 +24,9 @@ #include "PasswordHealth.h" #include "zxcvbn.h" +// Define the static member variable with the custom field name +const QString PasswordHealth::OPTION_KNOWN_BAD_PASSWD = QStringLiteral("KnownBadPassword"); + PasswordHealth::PasswordHealth(double entropy) : m_score(entropy) , m_entropy(entropy) diff --git a/src/core/PasswordHealth.h b/src/core/PasswordHealth.h index 70f83eee70..cf7f9f6a43 100644 --- a/src/core/PasswordHealth.h +++ b/src/core/PasswordHealth.h @@ -83,6 +83,14 @@ class PasswordHealth return m_entropy; } + /** + * Name of custom data field that holds the "this is a known + * bad password" flag. Legal values of the field are TRUE_STR + * and FALSE_STR, the default (used if the field doesn't exist) + * is false. + */ + static const QString OPTION_KNOWN_BAD_PASSWD; + private: int m_score = 0; double m_entropy = 0.0;