mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-13 00:09:54 -05:00
Add more Crypto::initalized() assertions.
This commit is contained in:
parent
e5bba14994
commit
11ccdd4c9c
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user