mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-04 17:05:23 -05:00
Increase Argon2 warning threshold and set parallelism default value to number of available processors
This commit is contained in:
parent
c51585c279
commit
d327c16904
@ -21,7 +21,6 @@
|
|||||||
#include <argon2.h>
|
#include <argon2.h>
|
||||||
|
|
||||||
#include "format/KeePass2.h"
|
#include "format/KeePass2.h"
|
||||||
#include "crypto/CryptoHash.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* KeePass' Argon2 implementation supports all parameters that are defined in the official specification,
|
* KeePass' Argon2 implementation supports all parameters that are defined in the official specification,
|
||||||
@ -34,7 +33,7 @@ Argon2Kdf::Argon2Kdf()
|
|||||||
: Kdf::Kdf(KeePass2::KDF_ARGON2)
|
: Kdf::Kdf(KeePass2::KDF_ARGON2)
|
||||||
, m_version(0x13)
|
, m_version(0x13)
|
||||||
, m_memory(1 << 16)
|
, m_memory(1 << 16)
|
||||||
, m_parallelism(2)
|
, m_parallelism(static_cast<quint32>(QThread::idealThreadCount()))
|
||||||
{
|
{
|
||||||
m_rounds = 1;
|
m_rounds = 1;
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QThread>
|
||||||
|
|
||||||
#include "core/Global.h"
|
#include "core/Global.h"
|
||||||
#include "core/FilePath.h"
|
#include "core/FilePath.h"
|
||||||
@ -118,6 +119,9 @@ void DatabaseSettingsWidget::load(Database* db)
|
|||||||
kdfChanged(kdfIndex);
|
kdfChanged(kdfIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// properly initialize parallelism spin box (may be overwritten by actual KDF values)
|
||||||
|
m_uiEncryption->parallelismSpinBox->setValue(QThread::idealThreadCount());
|
||||||
|
|
||||||
// Setup kdf parameters
|
// Setup kdf parameters
|
||||||
auto kdf = m_db->kdf();
|
auto kdf = m_db->kdf();
|
||||||
m_uiEncryption->transformRoundsSpinBox->setValue(kdf->rounds());
|
m_uiEncryption->transformRoundsSpinBox->setValue(kdf->rounds());
|
||||||
@ -134,7 +138,7 @@ void DatabaseSettingsWidget::save()
|
|||||||
{
|
{
|
||||||
// first perform safety check for KDF rounds
|
// first perform safety check for KDF rounds
|
||||||
auto kdf = KeePass2::uuidToKdf(Uuid(m_uiEncryption->kdfComboBox->currentData().toByteArray()));
|
auto kdf = KeePass2::uuidToKdf(Uuid(m_uiEncryption->kdfComboBox->currentData().toByteArray()));
|
||||||
if (kdf->uuid() == KeePass2::KDF_ARGON2 && m_uiEncryption->transformRoundsSpinBox->value() > 1000) {
|
if (kdf->uuid() == KeePass2::KDF_ARGON2 && m_uiEncryption->transformRoundsSpinBox->value() > 10000) {
|
||||||
QMessageBox warning;
|
QMessageBox warning;
|
||||||
warning.setIcon(QMessageBox::Warning);
|
warning.setIcon(QMessageBox::Warning);
|
||||||
warning.setWindowTitle(tr("Number of rounds too high"));
|
warning.setWindowTitle(tr("Number of rounds too high"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user