mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-31 12:24:26 -04:00
Add database settings widget and ability to change transform rounds count.
This commit is contained in:
parent
8acd6f74d8
commit
1fc5f7a69f
12 changed files with 259 additions and 1 deletions
|
@ -167,6 +167,7 @@ void Database::setTransformRounds(quint64 rounds)
|
|||
|
||||
void Database::setKey(const CompositeKey& key, const QByteArray& transformSeed, bool updateChangedTime)
|
||||
{
|
||||
m_key = key;
|
||||
m_transformSeed = transformSeed;
|
||||
m_transformedMasterKey = key.transform(transformSeed, transformRounds());
|
||||
m_hasKey = true;
|
||||
|
@ -181,6 +182,16 @@ void Database::setKey(const CompositeKey& key)
|
|||
setKey(key, Random::randomArray(32));
|
||||
}
|
||||
|
||||
void Database::updateKey(quint64 rounds)
|
||||
{
|
||||
if (m_transformRounds != rounds) {
|
||||
m_transformRounds = rounds;
|
||||
m_transformedMasterKey = m_key.transform(m_transformSeed, transformRounds());
|
||||
m_metadata->setMasterKeyChanged(QDateTime::currentDateTimeUtc());
|
||||
Q_EMIT modified();
|
||||
}
|
||||
}
|
||||
|
||||
bool Database::hasKey()
|
||||
{
|
||||
return m_hasKey;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue