mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-25 22:16:01 -05:00
Make sure gcrypt is initalized when SymmetricCipherGcrypt objects are created.
This commit is contained in:
parent
baace14918
commit
bc63d18f68
@ -76,6 +76,11 @@ void Crypto::init()
|
|||||||
m_initalized = true;
|
m_initalized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Crypto::initalized()
|
||||||
|
{
|
||||||
|
return m_initalized;
|
||||||
|
}
|
||||||
|
|
||||||
bool Crypto::selfTest()
|
bool Crypto::selfTest()
|
||||||
{
|
{
|
||||||
return (gcry_control(GCRYCTL_SELFTEST) == 0);
|
return (gcry_control(GCRYCTL_SELFTEST) == 0);
|
||||||
|
@ -22,6 +22,7 @@ class Crypto
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void init();
|
static void init();
|
||||||
|
static bool initalized();
|
||||||
static bool selfTest();
|
static bool selfTest();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -17,6 +17,13 @@
|
|||||||
|
|
||||||
#include "SymmetricCipherGcrypt.h"
|
#include "SymmetricCipherGcrypt.h"
|
||||||
|
|
||||||
|
#include "crypto/Crypto.h"
|
||||||
|
|
||||||
|
SymmetricCipherGcrypt::SymmetricCipherGcrypt()
|
||||||
|
{
|
||||||
|
Q_ASSERT(Crypto::initalized());
|
||||||
|
}
|
||||||
|
|
||||||
SymmetricCipherGcrypt::~SymmetricCipherGcrypt()
|
SymmetricCipherGcrypt::~SymmetricCipherGcrypt()
|
||||||
{
|
{
|
||||||
gcry_cipher_close(m_ctx);
|
gcry_cipher_close(m_ctx);
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
class SymmetricCipherGcrypt : public SymmetricCipherBackend
|
class SymmetricCipherGcrypt : public SymmetricCipherBackend
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
SymmetricCipherGcrypt();
|
||||||
~SymmetricCipherGcrypt();
|
~SymmetricCipherGcrypt();
|
||||||
void setAlgorithm(SymmetricCipher::Algorithm algo);
|
void setAlgorithm(SymmetricCipher::Algorithm algo);
|
||||||
void setMode(SymmetricCipher::Mode mode);
|
void setMode(SymmetricCipher::Mode mode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user