mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-25 15:55:38 -04:00
Performed project-wide code formatting
* Updated format CMake command to properly ignore new directories and files * Added output when command is run * Resolves #2623
This commit is contained in:
parent
c74664097b
commit
7e1b16250c
68 changed files with 591 additions and 542 deletions
|
@ -68,6 +68,7 @@ bool Kdbx4Reader::readDatabaseImpl(QIODevice* device,
|
|||
return false;
|
||||
}
|
||||
|
||||
// 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)"));
|
||||
|
@ -93,6 +94,7 @@ bool Kdbx4Reader::readDatabaseImpl(QIODevice* device,
|
|||
raiseError(cipherStream.errorString());
|
||||
return false;
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
QIODevice* xmlDevice = nullptr;
|
||||
QScopedPointer<QtIOCompressor> ioCompressor;
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
explicit KdbxXmlWriter(quint32 version);
|
||||
|
||||
void writeDatabase(QIODevice* device,
|
||||
const Database *db,
|
||||
const Database* db,
|
||||
KeePass2RandomStream* randomStream = nullptr,
|
||||
const QByteArray& headerHash = QByteArray());
|
||||
void writeDatabase(const QString& filename, Database* db);
|
||||
|
|
|
@ -56,7 +56,8 @@ KeePass1Reader::KeePass1Reader()
|
|||
{
|
||||
}
|
||||
|
||||
QSharedPointer<Database> KeePass1Reader::readDatabase(QIODevice* device, const QString& password, QIODevice* keyfileDevice)
|
||||
QSharedPointer<Database>
|
||||
KeePass1Reader::readDatabase(QIODevice* device, const QString& password, QIODevice* keyfileDevice)
|
||||
{
|
||||
m_error = false;
|
||||
m_errorStr.clear();
|
||||
|
@ -248,7 +249,8 @@ QSharedPointer<Database> KeePass1Reader::readDatabase(QIODevice* device, const Q
|
|||
return db;
|
||||
}
|
||||
|
||||
QSharedPointer<Database> KeePass1Reader::readDatabase(QIODevice* device, const QString& password, const QString& keyfileName)
|
||||
QSharedPointer<Database>
|
||||
KeePass1Reader::readDatabase(QIODevice* device, const QString& password, const QString& keyfileName)
|
||||
{
|
||||
QScopedPointer<QFile> keyFile;
|
||||
if (!keyfileName.isEmpty()) {
|
||||
|
@ -262,7 +264,8 @@ QSharedPointer<Database> KeePass1Reader::readDatabase(QIODevice* device, const Q
|
|||
return QSharedPointer<Database>(readDatabase(device, password, keyFile.data()));
|
||||
}
|
||||
|
||||
QSharedPointer<Database> KeePass1Reader::readDatabase(const QString& filename, const QString& password, const QString& keyfileName)
|
||||
QSharedPointer<Database>
|
||||
KeePass1Reader::readDatabase(const QString& filename, const QString& password, const QString& keyfileName)
|
||||
{
|
||||
QFile dbFile(filename);
|
||||
if (!dbFile.open(QFile::ReadOnly)) {
|
||||
|
@ -290,7 +293,8 @@ QString KeePass1Reader::errorString()
|
|||
return m_errorStr;
|
||||
}
|
||||
|
||||
SymmetricCipherStream* KeePass1Reader::testKeys(const QString& password, const QByteArray& keyfileData, qint64 contentPos)
|
||||
SymmetricCipherStream*
|
||||
KeePass1Reader::testKeys(const QString& password, const QByteArray& keyfileData, qint64 contentPos)
|
||||
{
|
||||
const QList<PasswordEncoding> encodings = {Windows1252, Latin1, UTF8};
|
||||
|
||||
|
|
|
@ -48,10 +48,10 @@ bool KeePass2Writer::writeDatabase(const QString& filename, Database* db)
|
|||
*/
|
||||
bool KeePass2Writer::implicitUpgradeNeeded(Database const* db) const
|
||||
{
|
||||
if (db->kdf()->uuid() != KeePass2::KDF_AES_KDBX3 ) {
|
||||
if (db->kdf()->uuid() != KeePass2::KDF_AES_KDBX3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!db->publicCustomData().isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue