diff options
author | Jonathan White <support@dmapps.us> | 2019-06-25 01:03:42 +0300 |
---|---|---|
committer | Jonathan White <support@dmapps.us> | 2019-06-25 22:37:40 +0300 |
commit | 0e0cba653f2648842d90ceef957f52f9ec851f86 (patch) | |
tree | 790e7982c797e812f3e70bd8c5496e7762af1eb5 /tests/TestEntry.cpp | |
parent | bb2d7bca5a5de675d6ee1f4ec4c4f868229da47a (diff) |
CLI: add 'analyze' subcommand for offline HIBP breach checks
This new subcommand checks all passwords in the given database against a given list of SHA-1 password hashes. Such lists are available from the "Have I Been Pwned" project at https://haveibeenpwned.com/Passwords.
Note that this support offline checking only. The HIBP project also provides a web API for checking specific hash ranges; this is not currently supported.
Diffstat (limited to 'tests/TestEntry.cpp')
-rw-r--r-- | tests/TestEntry.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/TestEntry.cpp b/tests/TestEntry.cpp index c174e798d..5552549fe 100644 --- a/tests/TestEntry.cpp +++ b/tests/TestEntry.cpp @@ -21,6 +21,7 @@ #include "TestEntry.h" #include "TestGlobal.h" #include "core/Clock.h" +#include "core/Metadata.h" #include "crypto/Crypto.h" QTEST_GUILESS_MAIN(TestEntry) @@ -561,3 +562,28 @@ void TestEntry::testResolveClonedEntry() QCOMPARE(cclone4->resolveMultiplePlaceholders(cclone4->username()), original->username()); QCOMPARE(cclone4->resolveMultiplePlaceholders(cclone4->password()), original->password()); } + +void TestEntry::testIsRecycled() +{ + Entry* entry = new Entry(); + QVERIFY(!entry->isRecycled()); + + Database db; + Group* root = db.rootGroup(); + QVERIFY(root); + entry->setGroup(root); + QVERIFY(!entry->isRecycled()); + + QVERIFY(db.metadata()->recycleBinEnabled()); + db.recycleEntry(entry); + QVERIFY(entry->isRecycled()); + + Group* group1 = new Group(); + group1->setParent(root); + + Entry* entry1 = new Entry(); + entry1->setGroup(group1); + QVERIFY(!entry1->isRecycled()); + db.recycleGroup(group1); + QVERIFY(entry1->isRecycled()); +} |