Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Geyer <debfx@fobos.de>2010-09-20 02:16:30 +0400
committerFelix Geyer <debfx@fobos.de>2010-09-20 02:16:30 +0400
commit537ffafefd8a3276b51dbde07267a2c8bf398469 (patch)
tree1876971dd7889a1fdb6dc6e01110a7f45e387423 /src
parent8835565fe3872bfc9fb64af49ed59d3adc6d91b9 (diff)
Add unit test TestKeePass2Reader.
Diffstat (limited to 'src')
-rw-r--r--src/format/KeePass2Reader.cpp1
-rw-r--r--src/keys/PasswordKey.cpp9
-rw-r--r--src/keys/PasswordKey.h2
3 files changed, 12 insertions, 0 deletions
diff --git a/src/format/KeePass2Reader.cpp b/src/format/KeePass2Reader.cpp
index 23d99fb35..d38b433e7 100644
--- a/src/format/KeePass2Reader.cpp
+++ b/src/format/KeePass2Reader.cpp
@@ -74,6 +74,7 @@ Database* KeePass2Reader::readDatabase(QIODevice* device, const CompositeKey& ke
if (realStart != m_streamStartBytes) {
raiseError("4");
+ return 0;
}
HashedBlockStream hashedStream(&cipherStream);
diff --git a/src/keys/PasswordKey.cpp b/src/keys/PasswordKey.cpp
index b48e9186a..ce216c216 100644
--- a/src/keys/PasswordKey.cpp
+++ b/src/keys/PasswordKey.cpp
@@ -19,6 +19,15 @@
#include "crypto/CryptoHash.h"
+PasswordKey::PasswordKey()
+{
+}
+
+PasswordKey::PasswordKey(const QString& password)
+{
+ setPassword(password);
+}
+
QByteArray PasswordKey::rawKey() const
{
return m_key;
diff --git a/src/keys/PasswordKey.h b/src/keys/PasswordKey.h
index 259f1c825..6d32d560e 100644
--- a/src/keys/PasswordKey.h
+++ b/src/keys/PasswordKey.h
@@ -25,6 +25,8 @@
class PasswordKey : public Key
{
public:
+ PasswordKey();
+ PasswordKey(const QString& password);
QByteArray rawKey() const;
void setPassword(const QString& password);
PasswordKey* clone() const;