mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-02 06:36:07 -04:00
Extract readKeyFromLine.
This commit is contained in:
parent
1ca5b72073
commit
798041fe11
6 changed files with 54 additions and 42 deletions
|
@ -83,6 +83,22 @@ void TestKeys::testComposite()
|
|||
delete compositeKey4;
|
||||
}
|
||||
|
||||
void TestKeys::testCompositeKeyReadFromLine()
|
||||
{
|
||||
|
||||
QString keyFilename = QString("%1/FileKeyXml.key").arg(QString(KEEPASSX_TEST_DATA_DIR));
|
||||
|
||||
CompositeKey compositeFileKey = CompositeKey::readFromLine(keyFilename);
|
||||
FileKey fileKey;
|
||||
fileKey.load(keyFilename);
|
||||
QCOMPARE(compositeFileKey.rawKey().size(), fileKey.rawKey().size());
|
||||
|
||||
CompositeKey compositePasswordKey = CompositeKey::readFromLine(QString("password"));
|
||||
PasswordKey passwordKey(QString("password"));
|
||||
QCOMPARE(compositePasswordKey.rawKey().size(), passwordKey.rawKey().size());
|
||||
|
||||
}
|
||||
|
||||
void TestKeys::testFileKey()
|
||||
{
|
||||
QFETCH(QString, type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue