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:
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);
}