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>2011-11-20 14:46:09 +0400
committerFelix Geyer <debfx@fobos.de>2011-11-20 14:46:09 +0400
commit11ccdd4c9cde7cc6d25ff69138560ddbe3407e71 (patch)
tree417695c30f75128932465186f3f536d90b04e821 /src
parente5bba149941add3a5a3238ed338a3f64be20c4f7 (diff)
Add more Crypto::initalized() assertions.
Diffstat (limited to 'src')
-rw-r--r--src/crypto/CryptoHash.cpp4
-rw-r--r--src/crypto/Random.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/crypto/CryptoHash.cpp b/src/crypto/CryptoHash.cpp
index 5c56a3a74..31c0c934e 100644
--- a/src/crypto/CryptoHash.cpp
+++ b/src/crypto/CryptoHash.cpp
@@ -19,6 +19,8 @@
#include <gcrypt.h>
+#include "crypto/Crypto.h"
+
class CryptoHashPrivate
{
public:
@@ -31,6 +33,8 @@ CryptoHash::CryptoHash(CryptoHash::Algorithm algo)
{
Q_D(CryptoHash);
+ Q_ASSERT(Crypto::initalized());
+
int algoGcrypt;
switch (algo) {
diff --git a/src/crypto/Random.cpp b/src/crypto/Random.cpp
index d84106ec0..a8cd0c5a8 100644
--- a/src/crypto/Random.cpp
+++ b/src/crypto/Random.cpp
@@ -19,6 +19,8 @@
#include <gcrypt.h>
+#include "crypto/Crypto.h"
+
void Random::randomize(QByteArray& ba)
{
randomize(ba.data(), ba.size());
@@ -48,6 +50,8 @@ quint32 Random::randomUIntRange(quint32 min, quint32 max)
void Random::randomize(void* data, int len)
{
+ Q_ASSERT(Crypto::initalized());
+
gcry_randomize(data, len, GCRY_STRONG_RANDOM);
}