mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-14 17:26:27 -04:00
FdoSecrets: use EntrySearcher's internal search API
This commit is contained in:
parent
b96c1e92a3
commit
f9097c84e9
6 changed files with 54 additions and 37 deletions
|
@ -19,8 +19,11 @@
|
|||
|
||||
#include "TestGlobal.h"
|
||||
|
||||
#include "core/EntrySearcher.h"
|
||||
#include "fdosecrets/GcryptMPI.h"
|
||||
#include "fdosecrets/objects/SessionCipher.h"
|
||||
#include "fdosecrets/objects/Collection.h"
|
||||
#include "fdosecrets/objects/Item.h"
|
||||
|
||||
#include "crypto/Crypto.h"
|
||||
|
||||
|
@ -90,3 +93,22 @@ void TestFdoSecrets::testDhIetf1024Sha256Aes128CbcPkcs7()
|
|||
|
||||
QCOMPARE(cipher->m_aesKey.toHex(), QByteArrayLiteral("6b8f5ee55138eac37118508be21e7834"));
|
||||
}
|
||||
|
||||
void TestFdoSecrets::testCrazyAttributeKey()
|
||||
{
|
||||
using FdoSecrets::Item;
|
||||
using FdoSecrets::Collection;
|
||||
|
||||
const QScopedPointer<Group> root(new Group());
|
||||
const QScopedPointer<Entry> e1(new Entry());
|
||||
e1->setGroup(root.data());
|
||||
|
||||
const QString key = "_a:bc&-+'-e%12df_d";
|
||||
const QString value = "value";
|
||||
e1->attributes()->set(key, value);
|
||||
|
||||
// search for custom entries
|
||||
const auto term = Collection::attributeToTerm(key, value);
|
||||
const auto res = EntrySearcher().search({term}, root.data());
|
||||
QCOMPARE(res.count(), 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue