mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-24 13:41:33 -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;
|
||||
}
|
||||
|
||||
bool Crypto::initalized()
|
||||
{
|
||||
return m_initalized;
|
||||
}
|
||||
|
||||
bool Crypto::selfTest()
|
||||
{
|
||||
return (gcry_control(GCRYCTL_SELFTEST) == 0);
|
||||
|
@ -22,6 +22,7 @@ class Crypto
|
||||
{
|
||||
public:
|
||||
static void init();
|
||||
static bool initalized();
|
||||
static bool selfTest();
|
||||
|
||||
private:
|
||||
|
@ -17,6 +17,13 @@
|
||||
|
||||
#include "SymmetricCipherGcrypt.h"
|
||||
|
||||
#include "crypto/Crypto.h"
|
||||
|
||||
SymmetricCipherGcrypt::SymmetricCipherGcrypt()
|
||||
{
|
||||
Q_ASSERT(Crypto::initalized());
|
||||
}
|
||||
|
||||
SymmetricCipherGcrypt::~SymmetricCipherGcrypt()
|
||||
{
|
||||
gcry_cipher_close(m_ctx);
|
||||
|
@ -25,6 +25,7 @@
|
||||
class SymmetricCipherGcrypt : public SymmetricCipherBackend
|
||||
{
|
||||
public:
|
||||
SymmetricCipherGcrypt();
|
||||
~SymmetricCipherGcrypt();
|
||||
void setAlgorithm(SymmetricCipher::Algorithm algo);
|
||||
void setMode(SymmetricCipher::Mode mode);
|
||||
|
Loading…
Reference in New Issue
Block a user