Skip to content

Commit

Permalink
Introduce custom field name for the "this is a known bad pwd" flag
Browse files Browse the repository at this point in the history
  • Loading branch information
wolframroesler committed Mar 29, 2020
1 parent 83ed9a8 commit 4374fe8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/PasswordHealth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions src/core/PasswordHealth.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4374fe8

Please sign in to comment.