mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Allow for KDF seeds between 8 and 32 bytes
Correcting undocumented feature from KeePass2 Fixes #2581
This commit is contained in:
parent
f446774605
commit
1d24b52fa6
@ -24,7 +24,7 @@
|
||||
|
||||
Kdf::Kdf(const QUuid& uuid)
|
||||
: m_rounds(KDF_DEFAULT_ROUNDS)
|
||||
, m_seed(QByteArray(KDF_DEFAULT_SEED_SIZE, 0))
|
||||
, m_seed(QByteArray(KDF_MAX_SEED_SIZE, 0))
|
||||
, m_uuid(uuid)
|
||||
{
|
||||
}
|
||||
@ -56,7 +56,7 @@ bool Kdf::setRounds(int rounds)
|
||||
|
||||
bool Kdf::setSeed(const QByteArray& seed)
|
||||
{
|
||||
if (seed.size() != m_seed.size()) {
|
||||
if (seed.size() < KDF_MIN_SEED_SIZE || seed.size() > KDF_MAX_SEED_SIZE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,8 @@
|
||||
#include <QUuid>
|
||||
#include <QVariant>
|
||||
|
||||
#define KDF_DEFAULT_SEED_SIZE 32
|
||||
#define KDF_MIN_SEED_SIZE 8
|
||||
#define KDF_MAX_SEED_SIZE 32
|
||||
#define KDF_DEFAULT_ROUNDS 1000000ull
|
||||
|
||||
class Kdf
|
||||
|
Loading…
Reference in New Issue
Block a user