mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
b2c2f42f30
See issue #3271 for a motivation of this feature. This patch adds an additional text input to the advanced view of the password generator. All characters of this input field (if not empty) will be added as another group to the password generator. The characters from the excluded field have precedence over the characters from this new field, meaning any character added to both fields will *not* appear in any generated password. As the characters from this new field will be added as their own group to the password generator, checking the 'Include characters from every group' checkbox will force at least character to be chosen from the new input field. The `PasswordGenerator` class has also been changed so that the `isValid` method returns `true` if only characters from the new input field would be used. There is a new, simple test that covers the new feature. While the test only uses ASCII characters, any Unicode characters can be used with the new feature.
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
/*
|
|
* Copyright (C) 2018 KeePassXC Team <team@keepassxc.org>
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 2 or (at your option)
|
|
* version 3 of the License.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef KEEPASSXC_TESTPASSWORDGENERATOR_H
|
|
#define KEEPASSXC_TESTPASSWORDGENERATOR_H
|
|
|
|
#include <QObject>
|
|
|
|
class TestPasswordGenerator : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
private slots:
|
|
void initTestCase();
|
|
void testAdditionalChars();
|
|
void testCharClasses();
|
|
void testLookalikeExclusion();
|
|
};
|
|
|
|
#endif // KEEPASSXC_TESTPASSWORDGENERATOR_H
|