Fix: Regenerate transform seed and transform master key on save.

This commit is contained in:
rockihack 2017-10-13 12:31:57 +02:00 committed by Jonathan White
parent 3bc8a79b9b
commit c6f83b9ca6
4 changed files with 31 additions and 1 deletions

View file

@ -257,6 +257,25 @@ bool Database::hasKey() const
return m_data.hasKey;
}
bool Database::transformKeyWithSeed(const QByteArray& transformSeed)
{
Q_ASSERT(hasKey());
bool ok;
QString errorString;
QByteArray transformedMasterKey =
m_data.key.transform(transformSeed, transformRounds(), &ok, &errorString);
if (!ok) {
return false;
}
m_data.transformSeed = transformSeed;
m_data.transformedMasterKey = transformedMasterKey;
return true;
}
bool Database::verifyKey(const CompositeKey& key) const
{
Q_ASSERT(hasKey());