mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
committed by
Jonathan White
parent
9478ae30a0
commit
bec7dafa91
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -666,7 +666,7 @@ QProgressBar::chunk {
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxExcludeAlike">
|
||||
<property name="toolTip">
|
||||
<string>Excluded characters: "0", "1", "l", "I", "O", "|", "﹒"</string>
|
||||
<string>Excluded characters: "0", "O", "1", "l", "I", "|", "G", "6", "B", "8", "﹒"</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Exclude look-alike characters</string>
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user