mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Add safeguard to using Argon2 function
This commit is contained in:
@@ -163,6 +163,13 @@ QVariantMap Argon2Kdf::writeParameters()
|
||||
|
||||
bool Argon2Kdf::transform(const QByteArray& raw, QByteArray& result) const
|
||||
{
|
||||
// This is a programming error and will result in broken encryption
|
||||
Q_ASSERT(*raw != *result);
|
||||
if (*raw == *result) {
|
||||
qWarning("Argon2Kdf: Input and output buffers must not be the same.");
|
||||
return false;
|
||||
}
|
||||
|
||||
result.clear();
|
||||
result.resize(32);
|
||||
// Time Cost, Mem Cost, Threads/Lanes, Password, length, Salt, length, out, length
|
||||
|
||||
Reference in New Issue
Block a user