mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-31 18:48:48 -04:00
Add KeePass2Writer.
Support attributes MasterKeyChanged, MasterKeyChangeRec, MasterKeyChangeForce and Tags. Close streams in the dtor.
This commit is contained in:
parent
a9ac4bbf41
commit
e3da80fcc6
22 changed files with 397 additions and 39 deletions
|
@ -38,6 +38,11 @@ HashedBlockStream::HashedBlockStream(QIODevice* baseDevice, qint32 blockSize)
|
|||
init();
|
||||
}
|
||||
|
||||
HashedBlockStream::~HashedBlockStream()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
void HashedBlockStream::init()
|
||||
{
|
||||
m_buffer.clear();
|
||||
|
|
|
@ -29,6 +29,7 @@ class HashedBlockStream : public LayeredStream
|
|||
public:
|
||||
explicit HashedBlockStream(QIODevice* baseDevice);
|
||||
HashedBlockStream(QIODevice* baseDevice, qint32 blockSize);
|
||||
~HashedBlockStream();
|
||||
|
||||
bool reset();
|
||||
void close();
|
||||
|
|
|
@ -24,6 +24,11 @@ LayeredStream::LayeredStream(QIODevice* baseDevice)
|
|||
connect(baseDevice, SIGNAL(aboutToClose()), SLOT(closeStream()));
|
||||
}
|
||||
|
||||
LayeredStream::~LayeredStream()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
bool LayeredStream::isSequential() const
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -26,6 +26,7 @@ class LayeredStream : public QIODevice
|
|||
|
||||
public:
|
||||
explicit LayeredStream(QIODevice* baseDevice);
|
||||
virtual ~LayeredStream();
|
||||
|
||||
bool isSequential() const;
|
||||
virtual QString errorString() const;
|
||||
|
|
|
@ -28,6 +28,11 @@ SymmetricCipherStream::SymmetricCipherStream(QIODevice* baseDevice, SymmetricCip
|
|||
m_cipher = new SymmetricCipher(algo, mode, direction, key, iv);
|
||||
}
|
||||
|
||||
SymmetricCipherStream::~SymmetricCipherStream()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
bool SymmetricCipherStream::reset()
|
||||
{
|
||||
if (isWritable()) {
|
||||
|
|
|
@ -30,6 +30,7 @@ class SymmetricCipherStream : public LayeredStream
|
|||
public:
|
||||
SymmetricCipherStream(QIODevice* baseDevice, SymmetricCipher::Algorithm algo, SymmetricCipher::Mode mode,
|
||||
SymmetricCipher::Direction direction, const QByteArray& key, const QByteArray& iv);
|
||||
~SymmetricCipherStream();
|
||||
bool reset();
|
||||
void close();
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include "qtiocompressor.h"
|
||||
#include "zlib.h"
|
||||
#include <zlib.h>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
typedef Bytef ZlibByte;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue