mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-08 06:22:53 -04:00
Improved error messages when opening database
* Reduced wording and confusion * Streamlined delivery format * Fix #813
This commit is contained in:
parent
791b796c23
commit
0201fcd400
5 changed files with 11 additions and 11 deletions
|
@ -78,7 +78,8 @@ bool Kdbx3Reader::readDatabaseImpl(QIODevice* device,
|
|||
QByteArray realStart = cipherStream.read(32);
|
||||
|
||||
if (realStart != m_streamStartBytes) {
|
||||
raiseError(tr("Wrong key or database file is corrupt."));
|
||||
raiseError(tr("Invalid credentials were provided, please try again.\n"
|
||||
"If this reoccurs, then your database file may be corrupt."));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,8 @@ bool Kdbx4Reader::readDatabaseImpl(QIODevice* device,
|
|||
// clang-format off
|
||||
QByteArray hmacKey = KeePass2::hmacKey(m_masterSeed, db->transformedMasterKey());
|
||||
if (headerHmac != CryptoHash::hmac(headerData, HmacBlockStream::getHmacKey(UINT64_MAX, hmacKey), CryptoHash::Sha256)) {
|
||||
raiseError(tr("Wrong key or database file is corrupt. (HMAC mismatch)"));
|
||||
raiseError(tr("Invalid credentials were provided, please try again.\n"
|
||||
"If this reoccurs, then your database file may be corrupt.") + " " + tr("(HMAC mismatch)"));
|
||||
return false;
|
||||
}
|
||||
HmacBlockStream hmacStream(device, hmacKey);
|
||||
|
|
|
@ -372,7 +372,8 @@ KeePass1Reader::testKeys(const QString& password, const QByteArray& keyfileData,
|
|||
}
|
||||
|
||||
if (!cipherStream) {
|
||||
raiseError(tr("Wrong key or database file is corrupt."));
|
||||
raiseError(tr("Invalid credentials were provided, please try again.\n"
|
||||
"If this reoccurs, then your database file may be corrupt."));
|
||||
}
|
||||
|
||||
return cipherStream.take();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue