Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Atkinson <brandon.n.atkinson@gmail.com>2021-02-26 04:13:21 +0300
committerJonathan White <support@dmapps.us>2021-02-27 15:35:03 +0300
commitbec7dafa91aca0d27149a83afc3f31fc8d2613d1 (patch)
tree34610ef5454fbb3496715f2df5f6c81b0a93fdba
parent9478ae30a088310c42bf025c9ac99472a9041f8d (diff)
Exclude additional lookalike characters (6G8B)
* Fix #6075
-rw-r--r--src/core/PasswordGenerator.cpp4
-rw-r--r--src/gui/PasswordGeneratorWidget.ui2
-rw-r--r--tests/TestPasswordGenerator.cpp6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/core/PasswordGenerator.cpp b/src/core/PasswordGenerator.cpp
index efe647880..bd9dcc67b 100644
--- a/src/core/PasswordGenerator.cpp
+++ b/src/core/PasswordGenerator.cpp
@@ -150,7 +150,7 @@ QVector<PasswordGroup> PasswordGenerator::passwordGroups() const
for (int i = 65; i <= (65 + 25); i++) {
- if ((m_flags & ExcludeLookAlike) && (i == 73 || i == 79)) { // "I" and "O"
+ if ((m_flags & ExcludeLookAlike) && (i == 66 || i == 71 || i == 73 || i == 79)) { //"B", "G", "I" and "O"
continue;
}
@@ -163,7 +163,7 @@ QVector<PasswordGroup> PasswordGenerator::passwordGroups() const
PasswordGroup group;
for (int i = 48; i < (48 + 10); i++) {
- if ((m_flags & ExcludeLookAlike) && (i == 48 || i == 49)) { // "0" and "1"
+ if ((m_flags & ExcludeLookAlike) && (i == 48 || i == 49 || i == 54 || i == 56)) { // "0", "1", "6", and "8"
continue;
}
diff --git a/src/gui/PasswordGeneratorWidget.ui b/src/gui/PasswordGeneratorWidget.ui
index b4ba97193..d00448096 100644
--- a/src/gui/PasswordGeneratorWidget.ui
+++ b/src/gui/PasswordGeneratorWidget.ui
@@ -666,7 +666,7 @@ QProgressBar::chunk {
<item>
<widget class="QCheckBox" name="checkBoxExcludeAlike">
<property name="toolTip">
- <string>Excluded characters: &quot;0&quot;, &quot;1&quot;, &quot;l&quot;, &quot;I&quot;, &quot;O&quot;, &quot;|&quot;, &quot;﹒&quot;</string>
+ <string>Excluded characters: &quot;0&quot;, &quot;O&quot;, &quot;1&quot;, &quot;l&quot;, &quot;I&quot;, &quot;|&quot;, &quot;G&quot;, &quot;6&quot;, &quot;B&quot;, &quot;8&quot;, &quot;﹒&quot;</string>
</property>
<property name="text">
<string>Exclude look-alike characters</string>
diff --git a/tests/TestPasswordGenerator.cpp b/tests/TestPasswordGenerator.cpp
index 89e2eb91c..2ed2974a8 100644
--- a/tests/TestPasswordGenerator.cpp
+++ b/tests/TestPasswordGenerator.cpp
@@ -126,18 +126,18 @@ void TestPasswordGenerator::testLookalikeExclusion()
generator.setFlags(PasswordGenerator::GeneratorFlag::ExcludeLookAlike);
password = generator.generatePassword();
- QRegularExpression regex("^[^lI0]+$");
+ QRegularExpression regex("^[^lBGIO]+$");
QVERIFY(regex.match(password).hasMatch());
generator.setCharClasses(PasswordGenerator::CharClass::LowerLetters | PasswordGenerator::CharClass::UpperLetters
| PasswordGenerator::CharClass::Numbers);
password = generator.generatePassword();
- regex.setPattern("^[^lI01]+$");
+ regex.setPattern("^[^lBGIO0168]+$");
QVERIFY(regex.match(password).hasMatch());
generator.setCharClasses(PasswordGenerator::CharClass::LowerLetters | PasswordGenerator::CharClass::UpperLetters
| PasswordGenerator::CharClass::Numbers | PasswordGenerator::CharClass::EASCII);
password = generator.generatePassword();
- regex.setPattern("^[^lI01﹒]+$");
+ regex.setPattern("^[^lBGIO0168﹒]+$");
QVERIFY(regex.match(password).hasMatch());
}