mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-03 20:47:37 +03:00
Replace "Master Key" with "Database Credentials"
Definitions: * Database Key - Cryptographic hash used to perform encrypt/decrypt of the database. * Database Credentials - User facing term to refer to the collection of Password, Key File, and/or Hardware Key used to derive the Database Key. Changes: * Remove the term "master" and "key" from the user's lexicon and clarify the code base based on the definitions above. * Clean up wording in the UI to be clearer to the end user.
This commit is contained in:
parent
60bb593228
commit
3b459813ed
45 changed files with 162 additions and 162 deletions
|
@ -153,16 +153,16 @@ set(keepassx_SOURCES
|
|||
gui/group/EditGroupWidget.cpp
|
||||
gui/group/GroupModel.cpp
|
||||
gui/group/GroupView.cpp
|
||||
gui/masterkey/KeyComponentWidget.cpp
|
||||
gui/masterkey/PasswordEditWidget.cpp
|
||||
gui/masterkey/YubiKeyEditWidget.cpp
|
||||
gui/masterkey/KeyFileEditWidget.cpp
|
||||
gui/databasekey/KeyComponentWidget.cpp
|
||||
gui/databasekey/PasswordEditWidget.cpp
|
||||
gui/databasekey/YubiKeyEditWidget.cpp
|
||||
gui/databasekey/KeyFileEditWidget.cpp
|
||||
gui/dbsettings/DatabaseSettingsWidget.cpp
|
||||
gui/dbsettings/DatabaseSettingsDialog.cpp
|
||||
gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp
|
||||
gui/dbsettings/DatabaseSettingsWidgetMetaDataSimple.cpp
|
||||
gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp
|
||||
gui/dbsettings/DatabaseSettingsWidgetMasterKey.cpp
|
||||
gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp
|
||||
gui/reports/ReportsWidget.cpp
|
||||
gui/reports/ReportsDialog.cpp
|
||||
gui/reports/ReportsWidgetHealthcheck.cpp
|
||||
|
@ -179,7 +179,7 @@ set(keepassx_SOURCES
|
|||
gui/wizard/NewDatabaseWizardPage.cpp
|
||||
gui/wizard/NewDatabaseWizardPageMetaData.cpp
|
||||
gui/wizard/NewDatabaseWizardPageEncryption.cpp
|
||||
gui/wizard/NewDatabaseWizardPageMasterKey.cpp
|
||||
gui/wizard/NewDatabaseWizardPageDatabaseKey.cpp
|
||||
keys/CompositeKey.cpp
|
||||
keys/FileKey.cpp
|
||||
keys/PasswordKey.cpp
|
||||
|
|
|
@ -351,7 +351,7 @@ bool Database::writeDatabase(QIODevice* device, QString* error)
|
|||
|
||||
PasswordKey oldTransformedKey;
|
||||
if (m_data.key->isEmpty()) {
|
||||
oldTransformedKey.setHash(m_data.transformedMasterKey->rawKey());
|
||||
oldTransformedKey.setHash(m_data.transformedDatabaseKey->rawKey());
|
||||
}
|
||||
|
||||
KeePass2Writer writer;
|
||||
|
@ -366,7 +366,7 @@ bool Database::writeDatabase(QIODevice* device, QString* error)
|
|||
return false;
|
||||
}
|
||||
|
||||
QByteArray newKey = m_data.transformedMasterKey->rawKey();
|
||||
QByteArray newKey = m_data.transformedDatabaseKey->rawKey();
|
||||
Q_ASSERT(!newKey.isEmpty());
|
||||
Q_ASSERT(newKey != oldTransformedKey.rawKey());
|
||||
if (newKey.isEmpty() || newKey == oldTransformedKey.rawKey()) {
|
||||
|
@ -662,9 +662,9 @@ Database::CompressionAlgorithm Database::compressionAlgorithm() const
|
|||
return m_data.compressionAlgorithm;
|
||||
}
|
||||
|
||||
QByteArray Database::transformedMasterKey() const
|
||||
QByteArray Database::transformedDatabaseKey() const
|
||||
{
|
||||
return m_data.transformedMasterKey->rawKey();
|
||||
return m_data.transformedDatabaseKey->rawKey();
|
||||
}
|
||||
|
||||
QByteArray Database::challengeResponseKey() const
|
||||
|
@ -723,7 +723,7 @@ bool Database::setKey(const QSharedPointer<const CompositeKey>& key,
|
|||
|
||||
if (!key) {
|
||||
m_data.key.reset();
|
||||
m_data.transformedMasterKey.reset(new PasswordKey());
|
||||
m_data.transformedDatabaseKey.reset(new PasswordKey());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -732,28 +732,28 @@ bool Database::setKey(const QSharedPointer<const CompositeKey>& key,
|
|||
Q_ASSERT(!m_data.kdf->seed().isEmpty());
|
||||
}
|
||||
|
||||
PasswordKey oldTransformedMasterKey;
|
||||
PasswordKey oldTransformedDatabaseKey;
|
||||
if (m_data.key && !m_data.key->isEmpty()) {
|
||||
oldTransformedMasterKey.setHash(m_data.transformedMasterKey->rawKey());
|
||||
oldTransformedDatabaseKey.setHash(m_data.transformedDatabaseKey->rawKey());
|
||||
}
|
||||
|
||||
QByteArray transformedMasterKey;
|
||||
QByteArray transformedDatabaseKey;
|
||||
|
||||
if (!transformKey) {
|
||||
transformedMasterKey = QByteArray(oldTransformedMasterKey.rawKey());
|
||||
} else if (!key->transform(*m_data.kdf, transformedMasterKey, &m_keyError)) {
|
||||
transformedDatabaseKey = QByteArray(oldTransformedDatabaseKey.rawKey());
|
||||
} else if (!key->transform(*m_data.kdf, transformedDatabaseKey, &m_keyError)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_data.key = key;
|
||||
if (!transformedMasterKey.isEmpty()) {
|
||||
m_data.transformedMasterKey->setHash(transformedMasterKey);
|
||||
if (!transformedDatabaseKey.isEmpty()) {
|
||||
m_data.transformedDatabaseKey->setHash(transformedDatabaseKey);
|
||||
}
|
||||
if (updateChangedTime) {
|
||||
m_metadata->setMasterKeyChanged(Clock::currentDateTimeUtc());
|
||||
m_metadata->setDatabaseKeyChanged(Clock::currentDateTimeUtc());
|
||||
}
|
||||
|
||||
if (oldTransformedMasterKey.rawKey() != m_data.transformedMasterKey->rawKey()) {
|
||||
if (oldTransformedDatabaseKey.rawKey() != m_data.transformedDatabaseKey->rawKey()) {
|
||||
markAsModified();
|
||||
}
|
||||
|
||||
|
@ -908,16 +908,16 @@ bool Database::changeKdf(const QSharedPointer<Kdf>& kdf)
|
|||
Q_ASSERT(!m_data.isReadOnly);
|
||||
|
||||
kdf->randomizeSeed();
|
||||
QByteArray transformedMasterKey;
|
||||
QByteArray transformedDatabaseKey;
|
||||
if (!m_data.key) {
|
||||
m_data.key = QSharedPointer<CompositeKey>::create();
|
||||
}
|
||||
if (!m_data.key->transform(*kdf, transformedMasterKey)) {
|
||||
if (!m_data.key->transform(*kdf, transformedDatabaseKey)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
setKdf(kdf);
|
||||
m_data.transformedMasterKey->setHash(transformedMasterKey);
|
||||
m_data.transformedDatabaseKey->setHash(transformedDatabaseKey);
|
||||
markAsModified();
|
||||
|
||||
return true;
|
||||
|
|
|
@ -130,7 +130,7 @@ public:
|
|||
QSharedPointer<Kdf> kdf() const;
|
||||
void setKdf(QSharedPointer<Kdf> kdf);
|
||||
bool changeKdf(const QSharedPointer<Kdf>& kdf);
|
||||
QByteArray transformedMasterKey() const;
|
||||
QByteArray transformedDatabaseKey() const;
|
||||
|
||||
static Database* databaseByUuid(const QUuid& uuid);
|
||||
|
||||
|
@ -164,7 +164,7 @@ private:
|
|||
CompressionAlgorithm compressionAlgorithm = CompressionGZip;
|
||||
|
||||
QScopedPointer<PasswordKey> masterSeed;
|
||||
QScopedPointer<PasswordKey> transformedMasterKey;
|
||||
QScopedPointer<PasswordKey> transformedDatabaseKey;
|
||||
QScopedPointer<PasswordKey> challengeResponseKey;
|
||||
|
||||
QSharedPointer<const CompositeKey> key;
|
||||
|
@ -174,7 +174,7 @@ private:
|
|||
|
||||
DatabaseData()
|
||||
: masterSeed(new PasswordKey())
|
||||
, transformedMasterKey(new PasswordKey())
|
||||
, transformedDatabaseKey(new PasswordKey())
|
||||
, challengeResponseKey(new PasswordKey())
|
||||
{
|
||||
kdf->randomizeSeed();
|
||||
|
@ -185,7 +185,7 @@ private:
|
|||
filePath.clear();
|
||||
|
||||
masterSeed.reset();
|
||||
transformedMasterKey.reset();
|
||||
transformedDatabaseKey.reset();
|
||||
challengeResponseKey.reset();
|
||||
|
||||
key.reset();
|
||||
|
|
|
@ -251,17 +251,17 @@ const Group* Metadata::lastTopVisibleGroup() const
|
|||
return m_lastTopVisibleGroup;
|
||||
}
|
||||
|
||||
QDateTime Metadata::masterKeyChanged() const
|
||||
QDateTime Metadata::databaseKeyChanged() const
|
||||
{
|
||||
return m_masterKeyChanged;
|
||||
}
|
||||
|
||||
int Metadata::masterKeyChangeRec() const
|
||||
int Metadata::databaseKeyChangeRec() const
|
||||
{
|
||||
return m_data.masterKeyChangeRec;
|
||||
}
|
||||
|
||||
int Metadata::masterKeyChangeForce() const
|
||||
int Metadata::databaseKeyChangeForce() const
|
||||
{
|
||||
return m_data.masterKeyChangeForce;
|
||||
}
|
||||
|
@ -474,7 +474,7 @@ void Metadata::setLastTopVisibleGroup(Group* group)
|
|||
set(m_lastTopVisibleGroup, group);
|
||||
}
|
||||
|
||||
void Metadata::setMasterKeyChanged(const QDateTime& value)
|
||||
void Metadata::setDatabaseKeyChanged(const QDateTime& value)
|
||||
{
|
||||
Q_ASSERT(value.timeSpec() == Qt::UTC);
|
||||
m_masterKeyChanged = value;
|
||||
|
|
|
@ -96,9 +96,9 @@ public:
|
|||
QDateTime entryTemplatesGroupChanged() const;
|
||||
const Group* lastSelectedGroup() const;
|
||||
const Group* lastTopVisibleGroup() const;
|
||||
QDateTime masterKeyChanged() const;
|
||||
int masterKeyChangeRec() const;
|
||||
int masterKeyChangeForce() const;
|
||||
QDateTime databaseKeyChanged() const;
|
||||
int databaseKeyChangeRec() const;
|
||||
int databaseKeyChangeForce() const;
|
||||
int historyMaxItems() const;
|
||||
int historyMaxSize() const;
|
||||
CustomData* customData();
|
||||
|
@ -133,7 +133,7 @@ public:
|
|||
void setEntryTemplatesGroupChanged(const QDateTime& value);
|
||||
void setLastSelectedGroup(Group* group);
|
||||
void setLastTopVisibleGroup(Group* group);
|
||||
void setMasterKeyChanged(const QDateTime& value);
|
||||
void setDatabaseKeyChanged(const QDateTime& value);
|
||||
void setMasterKeyChangeRec(int value);
|
||||
void setMasterKeyChangeForce(int value);
|
||||
void setHistoryMaxItems(int value);
|
||||
|
@ -142,7 +142,7 @@ public:
|
|||
/*
|
||||
* Copy all attributes from other except:
|
||||
* - Group pointers/uuids
|
||||
* - Master key changed date
|
||||
* - Database key changed date
|
||||
* - Custom icons
|
||||
* - Custom fields
|
||||
* - Settings changed date
|
||||
|
|
|
@ -471,14 +471,14 @@ namespace FdoSecrets
|
|||
return collection;
|
||||
}
|
||||
|
||||
void Service::doSwitchToChangeDatabaseSettings(DatabaseWidget* dbWidget)
|
||||
void Service::doSwitchToDatabaseSettings(DatabaseWidget* dbWidget)
|
||||
{
|
||||
if (dbWidget->isLocked()) {
|
||||
return;
|
||||
}
|
||||
// switch selected to current
|
||||
m_databases->setCurrentWidget(dbWidget);
|
||||
m_databases->changeDatabaseSettings();
|
||||
m_databases->showDatabaseSettings();
|
||||
|
||||
// open settings (switch from app settings to m_dbTabs)
|
||||
m_plugin->emitRequestSwitchToDatabases();
|
||||
|
|
|
@ -110,7 +110,7 @@ namespace FdoSecrets
|
|||
public slots:
|
||||
bool doCloseDatabase(DatabaseWidget* dbWidget);
|
||||
Collection* doNewDatabase();
|
||||
void doSwitchToChangeDatabaseSettings(DatabaseWidget* dbWidget);
|
||||
void doSwitchToDatabaseSettings(DatabaseWidget* dbWidget);
|
||||
|
||||
/**
|
||||
* Async, connect to signal doneUnlockDatabaseInDialog for finish notification
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace
|
|||
return;
|
||||
}
|
||||
auto db = m_dbWidget;
|
||||
m_plugin->serviceInstance()->doSwitchToChangeDatabaseSettings(m_dbWidget);
|
||||
m_plugin->serviceInstance()->doSwitchToDatabaseSettings(m_dbWidget);
|
||||
});
|
||||
addAction(m_dbSettingsAct);
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ bool Kdbx3Reader::readDatabaseImpl(QIODevice* device,
|
|||
|
||||
bool ok = AsyncTask::runAndWaitForFuture([&] { return db->setKey(key, false); });
|
||||
if (!ok) {
|
||||
raiseError(tr("Unable to calculate master key"));
|
||||
raiseError(tr("Unable to calculate database key"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ bool Kdbx3Reader::readDatabaseImpl(QIODevice* device,
|
|||
CryptoHash hash(CryptoHash::Sha256);
|
||||
hash.addData(m_masterSeed);
|
||||
hash.addData(db->challengeResponseKey());
|
||||
hash.addData(db->transformedMasterKey());
|
||||
hash.addData(db->transformedDatabaseKey());
|
||||
QByteArray finalKey = hash.result();
|
||||
|
||||
SymmetricCipher::Algorithm cipher = SymmetricCipher::cipherToAlgorithm(db->cipher());
|
||||
|
|
|
@ -47,16 +47,16 @@ bool Kdbx3Writer::writeDatabase(QIODevice* device, Database* db)
|
|||
}
|
||||
|
||||
if (!db->setKey(db->key(), false, true)) {
|
||||
raiseError(tr("Unable to calculate master key"));
|
||||
raiseError(tr("Unable to calculate database key"));
|
||||
return false;
|
||||
}
|
||||
|
||||
// generate transformed master key
|
||||
// generate transformed database key
|
||||
CryptoHash hash(CryptoHash::Sha256);
|
||||
hash.addData(masterSeed);
|
||||
hash.addData(db->challengeResponseKey());
|
||||
Q_ASSERT(!db->transformedMasterKey().isEmpty());
|
||||
hash.addData(db->transformedMasterKey());
|
||||
Q_ASSERT(!db->transformedDatabaseKey().isEmpty());
|
||||
hash.addData(db->transformedDatabaseKey());
|
||||
QByteArray finalKey = hash.result();
|
||||
|
||||
// write header
|
||||
|
|
|
@ -50,13 +50,13 @@ bool Kdbx4Reader::readDatabaseImpl(QIODevice* device,
|
|||
|
||||
bool ok = AsyncTask::runAndWaitForFuture([&] { return db->setKey(key, false, false); });
|
||||
if (!ok) {
|
||||
raiseError(tr("Unable to calculate master key: %1").arg(db->keyError()));
|
||||
raiseError(tr("Unable to calculate database key: %1").arg(db->keyError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
CryptoHash hash(CryptoHash::Sha256);
|
||||
hash.addData(m_masterSeed);
|
||||
hash.addData(db->transformedMasterKey());
|
||||
hash.addData(db->transformedDatabaseKey());
|
||||
QByteArray finalKey = hash.result();
|
||||
|
||||
QByteArray headerSha256 = device->read(32);
|
||||
|
@ -71,7 +71,7 @@ bool Kdbx4Reader::readDatabaseImpl(QIODevice* device,
|
|||
}
|
||||
|
||||
// clang-format off
|
||||
QByteArray hmacKey = KeePass2::hmacKey(m_masterSeed, db->transformedMasterKey());
|
||||
QByteArray hmacKey = KeePass2::hmacKey(m_masterSeed, db->transformedDatabaseKey());
|
||||
if (headerHmac != CryptoHash::hmac(headerData, HmacBlockStream::getHmacKey(UINT64_MAX, hmacKey), CryptoHash::Sha256)) {
|
||||
raiseError(tr("Invalid credentials were provided, please try again.\n"
|
||||
"If this reoccurs, then your database file may be corrupt.") + " " + tr("(HMAC mismatch)"));
|
||||
|
|
|
@ -53,15 +53,15 @@ bool Kdbx4Writer::writeDatabase(QIODevice* device, Database* db)
|
|||
QByteArray endOfHeader = "\r\n\r\n";
|
||||
|
||||
if (!db->setKey(db->key(), false, true)) {
|
||||
raiseError(tr("Unable to calculate master key: %1").arg(db->keyError()));
|
||||
raiseError(tr("Unable to calculate database key: %1").arg(db->keyError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
// generate transformed master key
|
||||
// generate transformed database key
|
||||
CryptoHash hash(CryptoHash::Sha256);
|
||||
hash.addData(masterSeed);
|
||||
Q_ASSERT(!db->transformedMasterKey().isEmpty());
|
||||
hash.addData(db->transformedMasterKey());
|
||||
Q_ASSERT(!db->transformedDatabaseKey().isEmpty());
|
||||
hash.addData(db->transformedDatabaseKey());
|
||||
QByteArray finalKey = hash.result();
|
||||
|
||||
// write header
|
||||
|
@ -109,7 +109,7 @@ bool Kdbx4Writer::writeDatabase(QIODevice* device, Database* db)
|
|||
QByteArray headerHash = CryptoHash::hash(headerData, CryptoHash::Sha256);
|
||||
|
||||
// write HMAC-authenticated cipher stream
|
||||
QByteArray hmacKey = KeePass2::hmacKey(masterSeed, db->transformedMasterKey());
|
||||
QByteArray hmacKey = KeePass2::hmacKey(masterSeed, db->transformedDatabaseKey());
|
||||
QByteArray headerHmac =
|
||||
CryptoHash::hmac(headerData, HmacBlockStream::getHmacKey(UINT64_MAX, hmacKey), CryptoHash::Sha256);
|
||||
CHECK_RETURN_FALSE(writeData(device, headerHash));
|
||||
|
|
|
@ -262,7 +262,7 @@ void KdbxXmlReader::parseMeta()
|
|||
} else if (m_xml.name() == "Color") {
|
||||
m_meta->setColor(readColor());
|
||||
} else if (m_xml.name() == "MasterKeyChanged") {
|
||||
m_meta->setMasterKeyChanged(readDateTime());
|
||||
m_meta->setDatabaseKeyChanged(readDateTime());
|
||||
} else if (m_xml.name() == "MasterKeyChangeRec") {
|
||||
m_meta->setMasterKeyChangeRec(readNumber());
|
||||
} else if (m_xml.name() == "MasterKeyChangeForce") {
|
||||
|
|
|
@ -112,9 +112,9 @@ void KdbxXmlWriter::writeMetadata()
|
|||
writeDateTime("DefaultUserNameChanged", m_meta->defaultUserNameChanged());
|
||||
writeNumber("MaintenanceHistoryDays", m_meta->maintenanceHistoryDays());
|
||||
writeString("Color", m_meta->color());
|
||||
writeDateTime("MasterKeyChanged", m_meta->masterKeyChanged());
|
||||
writeNumber("MasterKeyChangeRec", m_meta->masterKeyChangeRec());
|
||||
writeNumber("MasterKeyChangeForce", m_meta->masterKeyChangeForce());
|
||||
writeDateTime("MasterKeyChanged", m_meta->databaseKeyChanged());
|
||||
writeNumber("MasterKeyChangeRec", m_meta->databaseKeyChangeRec());
|
||||
writeNumber("MasterKeyChangeForce", m_meta->databaseKeyChangeForce());
|
||||
writeMemoryProtection();
|
||||
writeCustomIcons();
|
||||
writeBool("RecycleBinEnabled", m_meta->recycleBinEnabled());
|
||||
|
|
|
@ -242,7 +242,7 @@ KeePass1Reader::readDatabase(QIODevice* device, const QString& password, QIODevi
|
|||
}
|
||||
|
||||
if (!db->setKey(key)) {
|
||||
raiseError(tr("Unable to calculate master key"));
|
||||
raiseError(tr("Unable to calculate database key"));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
|
@ -199,8 +199,8 @@ void DatabaseOpenWidget::openDatabase()
|
|||
{
|
||||
m_ui->messageWidget->hide();
|
||||
|
||||
QSharedPointer<CompositeKey> masterKey = databaseKey();
|
||||
if (!masterKey) {
|
||||
QSharedPointer<CompositeKey> databaseKey = buildDatabaseKey();
|
||||
if (!databaseKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ void DatabaseOpenWidget::openDatabase()
|
|||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
m_ui->passwordFormFrame->setEnabled(false);
|
||||
QCoreApplication::processEvents();
|
||||
bool ok = m_db->open(m_filename, masterKey, &error, false);
|
||||
bool ok = m_db->open(m_filename, databaseKey, &error, false);
|
||||
QApplication::restoreOverrideCursor();
|
||||
m_ui->passwordFormFrame->setEnabled(true);
|
||||
|
||||
|
@ -271,12 +271,12 @@ void DatabaseOpenWidget::openDatabase()
|
|||
}
|
||||
}
|
||||
|
||||
QSharedPointer<CompositeKey> DatabaseOpenWidget::databaseKey()
|
||||
QSharedPointer<CompositeKey> DatabaseOpenWidget::buildDatabaseKey()
|
||||
{
|
||||
auto masterKey = QSharedPointer<CompositeKey>::create();
|
||||
auto databaseKey = QSharedPointer<CompositeKey>::create();
|
||||
|
||||
if (!m_ui->editPassword->text().isEmpty() || m_retryUnlockWithEmptyPassword) {
|
||||
masterKey->addKey(QSharedPointer<PasswordKey>::create(m_ui->editPassword->text()));
|
||||
databaseKey->addKey(QSharedPointer<PasswordKey>::create(m_ui->editPassword->text()));
|
||||
}
|
||||
|
||||
#ifdef WITH_XC_TOUCHID
|
||||
|
@ -284,7 +284,7 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::databaseKey()
|
|||
if (m_ui->checkTouchID->isChecked() && TouchID::getInstance().isAvailable()
|
||||
&& m_ui->editPassword->text().isEmpty()) {
|
||||
// clear empty password from composite key
|
||||
masterKey->clear();
|
||||
databaseKey->clear();
|
||||
|
||||
// try to get, decrypt and use PasswordKey
|
||||
QSharedPointer<QByteArray> passwordKey = TouchID::getInstance().getKey(m_filename);
|
||||
|
@ -293,7 +293,7 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::databaseKey()
|
|||
if (passwordKey.isNull())
|
||||
return QSharedPointer<CompositeKey>();
|
||||
|
||||
masterKey->addKey(PasswordKey::fromRawKey(*passwordKey));
|
||||
databaseKey->addKey(PasswordKey::fromRawKey(*passwordKey));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -326,7 +326,7 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::databaseKey()
|
|||
|
||||
legacyWarning.exec();
|
||||
}
|
||||
masterKey->addKey(key);
|
||||
databaseKey->addKey(key);
|
||||
lastKeyFiles.insert(m_filename, keyFilename);
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::databaseKey()
|
|||
if (selectionIndex > 0) {
|
||||
auto slot = m_ui->challengeResponseCombo->itemData(selectionIndex).value<YubiKeySlot>();
|
||||
auto crKey = QSharedPointer<YkChallengeResponseKey>(new YkChallengeResponseKey(slot));
|
||||
masterKey->addChallengeResponseKey(crKey);
|
||||
databaseKey->addChallengeResponseKey(crKey);
|
||||
|
||||
// Qt doesn't read custom types in settings so stuff into a QString
|
||||
lastChallengeResponse.insert(m_filename, QStringLiteral("%1:%2").arg(slot.first).arg(slot.second));
|
||||
|
@ -353,7 +353,7 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::databaseKey()
|
|||
}
|
||||
#endif
|
||||
|
||||
return masterKey;
|
||||
return databaseKey;
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::reject()
|
||||
|
|
|
@ -52,7 +52,7 @@ signals:
|
|||
protected:
|
||||
void showEvent(QShowEvent* event) override;
|
||||
void hideEvent(QHideEvent* event) override;
|
||||
QSharedPointer<CompositeKey> databaseKey();
|
||||
QSharedPointer<CompositeKey> buildDatabaseKey();
|
||||
|
||||
const QScopedPointer<Ui::DatabaseOpenWidget> m_ui;
|
||||
QSharedPointer<Database> m_db;
|
||||
|
|
|
@ -250,7 +250,7 @@
|
|||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><p>In addition to your master password, you can use a secret file to enhance the security of your database. Such a file can be generated in your database's security settings.</p><p>This is <strong>not</strong> your *.kdbx database file!<br>If you do not have a key file, leave the field empty.</p><p>Click for more information...</p></string>
|
||||
<string><p>In addition to a password, you can use a secret file to enhance the security of your database. This file can be generated in your database's security settings.</p><p>This is <strong>not</strong> your *.kdbx database file!<br>If you do not have a key file, leave this field empty.</p><p>Click for more information...</p></string>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Key file help</string>
|
||||
|
|
|
@ -476,17 +476,17 @@ bool DatabaseTabWidget::warnOnExport()
|
|||
return ans == MessageBox::Yes;
|
||||
}
|
||||
|
||||
void DatabaseTabWidget::changeMasterKey()
|
||||
void DatabaseTabWidget::showDatabaseSecurity()
|
||||
{
|
||||
currentDatabaseWidget()->switchToMasterKeyChange();
|
||||
currentDatabaseWidget()->switchToDatabaseSecurity();
|
||||
}
|
||||
|
||||
void DatabaseTabWidget::changeReports()
|
||||
void DatabaseTabWidget::showDatabaseReports()
|
||||
{
|
||||
currentDatabaseWidget()->switchToReports();
|
||||
currentDatabaseWidget()->switchToDatabaseReports();
|
||||
}
|
||||
|
||||
void DatabaseTabWidget::changeDatabaseSettings()
|
||||
void DatabaseTabWidget::showDatabaseSettings()
|
||||
{
|
||||
currentDatabaseWidget()->switchToDatabaseSettings();
|
||||
}
|
||||
|
|
|
@ -78,9 +78,9 @@ public slots:
|
|||
void unlockDatabaseInDialog(DatabaseWidget* dbWidget, DatabaseOpenDialog::Intent intent, const QString& filePath);
|
||||
void relockPendingDatabase();
|
||||
|
||||
void changeMasterKey();
|
||||
void changeReports();
|
||||
void changeDatabaseSettings();
|
||||
void showDatabaseSecurity();
|
||||
void showDatabaseReports();
|
||||
void showDatabaseSettings();
|
||||
void performGlobalAutoType();
|
||||
void performBrowserUnlock();
|
||||
|
||||
|
|
|
@ -1219,7 +1219,7 @@ void DatabaseWidget::entryActivationSignalReceived(Entry* entry, EntryModel::Mod
|
|||
}
|
||||
}
|
||||
|
||||
void DatabaseWidget::switchToReports()
|
||||
void DatabaseWidget::switchToDatabaseReports()
|
||||
{
|
||||
m_reportsDialog->load(m_db);
|
||||
setCurrentWidget(m_reportsDialog);
|
||||
|
@ -1307,10 +1307,10 @@ void DatabaseWidget::sortGroupsDesc()
|
|||
m_groupView->sortGroups(true);
|
||||
}
|
||||
|
||||
void DatabaseWidget::switchToMasterKeyChange()
|
||||
void DatabaseWidget::switchToDatabaseSecurity()
|
||||
{
|
||||
switchToDatabaseSettings();
|
||||
m_databaseSettingDialog->showMasterKeySettings();
|
||||
m_databaseSettingDialog->showDatabaseKeySettings();
|
||||
}
|
||||
|
||||
void DatabaseWidget::performUnlockDatabase(const QString& password, const QString& keyfile)
|
||||
|
|
|
@ -197,8 +197,8 @@ public slots:
|
|||
void switchToGroupEdit();
|
||||
void sortGroupsAsc();
|
||||
void sortGroupsDesc();
|
||||
void switchToMasterKeyChange();
|
||||
void switchToReports();
|
||||
void switchToDatabaseSecurity();
|
||||
void switchToDatabaseReports();
|
||||
void switchToDatabaseSettings();
|
||||
void switchToOpenDatabase();
|
||||
void switchToOpenDatabase(const QString& filePath);
|
||||
|
|
|
@ -340,7 +340,7 @@ MainWindow::MainWindow()
|
|||
m_ui->actionDatabaseClose->setIcon(resources()->icon("document-close"));
|
||||
m_ui->actionReports->setIcon(resources()->icon("reports"));
|
||||
m_ui->actionDatabaseSettings->setIcon(resources()->icon("document-edit"));
|
||||
m_ui->actionChangeMasterKey->setIcon(resources()->icon("database-change-key"));
|
||||
m_ui->actionDatabaseSecurity->setIcon(resources()->icon("database-change-key"));
|
||||
m_ui->actionLockDatabases->setIcon(resources()->icon("database-lock"));
|
||||
m_ui->actionQuit->setIcon(resources()->icon("application-exit"));
|
||||
m_ui->actionDatabaseMerge->setIcon(resources()->icon("database-merge"));
|
||||
|
@ -417,9 +417,9 @@ MainWindow::MainWindow()
|
|||
connect(m_ui->actionDatabaseSaveBackup, SIGNAL(triggered()), m_ui->tabWidget, SLOT(saveDatabaseBackup()));
|
||||
connect(m_ui->actionDatabaseClose, SIGNAL(triggered()), m_ui->tabWidget, SLOT(closeCurrentDatabaseTab()));
|
||||
connect(m_ui->actionDatabaseMerge, SIGNAL(triggered()), m_ui->tabWidget, SLOT(mergeDatabase()));
|
||||
connect(m_ui->actionChangeMasterKey, SIGNAL(triggered()), m_ui->tabWidget, SLOT(changeMasterKey()));
|
||||
connect(m_ui->actionReports, SIGNAL(triggered()), m_ui->tabWidget, SLOT(changeReports()));
|
||||
connect(m_ui->actionDatabaseSettings, SIGNAL(triggered()), m_ui->tabWidget, SLOT(changeDatabaseSettings()));
|
||||
connect(m_ui->actionDatabaseSecurity, SIGNAL(triggered()), m_ui->tabWidget, SLOT(showDatabaseSecurity()));
|
||||
connect(m_ui->actionReports, SIGNAL(triggered()), m_ui->tabWidget, SLOT(showDatabaseReports()));
|
||||
connect(m_ui->actionDatabaseSettings, SIGNAL(triggered()), m_ui->tabWidget, SLOT(showDatabaseSettings()));
|
||||
connect(m_ui->actionImportCsv, SIGNAL(triggered()), m_ui->tabWidget, SLOT(importCsv()));
|
||||
connect(m_ui->actionImportKeePass1, SIGNAL(triggered()), m_ui->tabWidget, SLOT(importKeePass1Database()));
|
||||
connect(m_ui->actionImportOpVault, SIGNAL(triggered()), m_ui->tabWidget, SLOT(importOpVaultDatabase()));
|
||||
|
@ -728,7 +728,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
|
|||
m_ui->actionGroupDownloadFavicons->setVisible(!recycleBinSelected);
|
||||
m_ui->actionGroupDownloadFavicons->setEnabled(groupSelected && currentGroupHasEntries
|
||||
&& !recycleBinSelected);
|
||||
m_ui->actionChangeMasterKey->setEnabled(true);
|
||||
m_ui->actionDatabaseSecurity->setEnabled(true);
|
||||
m_ui->actionReports->setEnabled(true);
|
||||
m_ui->actionDatabaseSettings->setEnabled(true);
|
||||
m_ui->actionDatabaseSave->setEnabled(m_ui->tabWidget->canSave());
|
||||
|
@ -784,7 +784,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
|
|||
action->setEnabled(false);
|
||||
}
|
||||
|
||||
m_ui->actionChangeMasterKey->setEnabled(false);
|
||||
m_ui->actionDatabaseSecurity->setEnabled(false);
|
||||
m_ui->actionReports->setEnabled(false);
|
||||
m_ui->actionDatabaseSettings->setEnabled(false);
|
||||
m_ui->actionDatabaseSave->setEnabled(false);
|
||||
|
@ -813,7 +813,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
|
|||
action->setEnabled(false);
|
||||
}
|
||||
|
||||
m_ui->actionChangeMasterKey->setEnabled(false);
|
||||
m_ui->actionDatabaseSecurity->setEnabled(false);
|
||||
m_ui->actionReports->setEnabled(false);
|
||||
m_ui->actionDatabaseSettings->setEnabled(false);
|
||||
m_ui->actionDatabaseSave->setEnabled(false);
|
||||
|
|
|
@ -256,7 +256,7 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionReports"/>
|
||||
<addaction name="actionDatabaseSettings"/>
|
||||
<addaction name="actionChangeMasterKey"/>
|
||||
<addaction name="actionDatabaseSecurity"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionDatabaseMerge"/>
|
||||
<addaction name="menuImport"/>
|
||||
|
@ -565,12 +565,12 @@
|
|||
<string>Sa&ve Database As…</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionChangeMasterKey">
|
||||
<action name="actionDatabaseSecurity">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Change Master &Key…</string>
|
||||
<string>Database &Security…</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionReports">
|
||||
|
@ -578,7 +578,7 @@
|
|||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Database Reports...</string>
|
||||
<string>Database &Reports...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Statistics, health check, etc.</string>
|
||||
|
|
|
@ -52,7 +52,7 @@ bool KeyFileEditWidget::addToCompositeKey(QSharedPointer<CompositeKey> key)
|
|||
tr("Legacy key file format"),
|
||||
tr("You are using a legacy key file format which may become\n"
|
||||
"unsupported in the future.\n\n"
|
||||
"Please go to the master key settings and generate a new key file."),
|
||||
"Generate a new key file in the database security settings."),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
|
|
@ -19,9 +19,9 @@
|
|||
#include "DatabaseSettingsDialog.h"
|
||||
#include "ui_DatabaseSettingsDialog.h"
|
||||
|
||||
#include "DatabaseSettingsWidgetDatabaseKey.h"
|
||||
#include "DatabaseSettingsWidgetEncryption.h"
|
||||
#include "DatabaseSettingsWidgetGeneral.h"
|
||||
#include "DatabaseSettingsWidgetMasterKey.h"
|
||||
#ifdef WITH_XC_BROWSER
|
||||
#include "DatabaseSettingsWidgetBrowser.h"
|
||||
#endif
|
||||
|
@ -65,7 +65,7 @@ DatabaseSettingsDialog::DatabaseSettingsDialog(QWidget* parent)
|
|||
, m_ui(new Ui::DatabaseSettingsDialog())
|
||||
, m_generalWidget(new DatabaseSettingsWidgetGeneral(this))
|
||||
, m_securityTabWidget(new QTabWidget(this))
|
||||
, m_masterKeyWidget(new DatabaseSettingsWidgetMasterKey(this))
|
||||
, m_databaseKeyWidget(new DatabaseSettingsWidgetDatabaseKey(this))
|
||||
, m_encryptionWidget(new DatabaseSettingsWidgetEncryption(this))
|
||||
#ifdef WITH_XC_BROWSER
|
||||
, m_browserWidget(new DatabaseSettingsWidgetBrowser(this))
|
||||
|
@ -81,7 +81,7 @@ DatabaseSettingsDialog::DatabaseSettingsDialog(QWidget* parent)
|
|||
m_ui->stackedWidget->addWidget(m_generalWidget);
|
||||
|
||||
m_ui->stackedWidget->addWidget(m_securityTabWidget);
|
||||
m_securityTabWidget->addTab(m_masterKeyWidget, tr("Master Key"));
|
||||
m_securityTabWidget->addTab(m_databaseKeyWidget, tr("Database Credentials"));
|
||||
m_securityTabWidget->addTab(m_encryptionWidget, tr("Encryption Settings"));
|
||||
|
||||
#if defined(WITH_XC_KEESHARE)
|
||||
|
@ -115,7 +115,7 @@ void DatabaseSettingsDialog::load(const QSharedPointer<Database>& db)
|
|||
{
|
||||
m_ui->categoryList->setCurrentCategory(0);
|
||||
m_generalWidget->load(db);
|
||||
m_masterKeyWidget->load(db);
|
||||
m_databaseKeyWidget->load(db);
|
||||
m_encryptionWidget->load(db);
|
||||
#ifdef WITH_XC_BROWSER
|
||||
m_browserWidget->load(db);
|
||||
|
@ -139,9 +139,9 @@ void DatabaseSettingsDialog::addSettingsPage(IDatabaseSettingsPage* page)
|
|||
}
|
||||
|
||||
/**
|
||||
* Show page and tab with database master key settings.
|
||||
* Show page and tab with database database key settings.
|
||||
*/
|
||||
void DatabaseSettingsDialog::showMasterKeySettings()
|
||||
void DatabaseSettingsDialog::showDatabaseKeySettings()
|
||||
{
|
||||
m_ui->categoryList->setCurrentCategory(1);
|
||||
m_securityTabWidget->setCurrentIndex(0);
|
||||
|
@ -153,7 +153,7 @@ void DatabaseSettingsDialog::save()
|
|||
return;
|
||||
}
|
||||
|
||||
if (!m_masterKeyWidget->save()) {
|
||||
if (!m_databaseKeyWidget->save()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ void DatabaseSettingsDialog::pageChanged()
|
|||
|
||||
if (Page::Security == pageIndex) {
|
||||
int tabIndex = m_securityTabWidget->currentIndex();
|
||||
enabled = (tabIndex == 0 && m_masterKeyWidget->hasAdvancedMode());
|
||||
enabled = (tabIndex == 0 && m_databaseKeyWidget->hasAdvancedMode());
|
||||
enabled |= (tabIndex == 1 && m_encryptionWidget->hasAdvancedMode());
|
||||
}
|
||||
|
||||
|
@ -198,8 +198,8 @@ void DatabaseSettingsDialog::toggleAdvancedMode(bool advanced)
|
|||
m_generalWidget->setAdvancedMode(advanced);
|
||||
}
|
||||
|
||||
if (m_masterKeyWidget->hasAdvancedMode()) {
|
||||
m_masterKeyWidget->setAdvancedMode(advanced);
|
||||
if (m_databaseKeyWidget->hasAdvancedMode()) {
|
||||
m_databaseKeyWidget->setAdvancedMode(advanced);
|
||||
}
|
||||
|
||||
if (m_encryptionWidget->hasAdvancedMode()) {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
class Database;
|
||||
class DatabaseSettingsWidgetGeneral;
|
||||
class DatabaseSettingsWidgetEncryption;
|
||||
class DatabaseSettingsWidgetMasterKey;
|
||||
class DatabaseSettingsWidgetDatabaseKey;
|
||||
#ifdef WITH_XC_BROWSER
|
||||
class DatabaseSettingsWidgetBrowser;
|
||||
#endif
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
|
||||
void load(const QSharedPointer<Database>& db);
|
||||
void addSettingsPage(IDatabaseSettingsPage* page);
|
||||
void showMasterKeySettings();
|
||||
void showDatabaseKeySettings();
|
||||
|
||||
signals:
|
||||
void editFinished(bool accepted);
|
||||
|
@ -85,7 +85,7 @@ private:
|
|||
const QScopedPointer<Ui::DatabaseSettingsDialog> m_ui;
|
||||
QPointer<DatabaseSettingsWidgetGeneral> m_generalWidget;
|
||||
QPointer<QTabWidget> m_securityTabWidget;
|
||||
QPointer<DatabaseSettingsWidgetMasterKey> m_masterKeyWidget;
|
||||
QPointer<DatabaseSettingsWidgetDatabaseKey> m_databaseKeyWidget;
|
||||
QPointer<DatabaseSettingsWidgetEncryption> m_encryptionWidget;
|
||||
#ifdef WITH_XC_BROWSER
|
||||
QPointer<DatabaseSettingsWidgetBrowser> m_browserWidget;
|
||||
|
|
|
@ -15,13 +15,13 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "DatabaseSettingsWidgetMasterKey.h"
|
||||
#include "DatabaseSettingsWidgetDatabaseKey.h"
|
||||
|
||||
#include "core/Database.h"
|
||||
#include "gui/MessageBox.h"
|
||||
#include "gui/masterkey/KeyFileEditWidget.h"
|
||||
#include "gui/masterkey/PasswordEditWidget.h"
|
||||
#include "gui/masterkey/YubiKeyEditWidget.h"
|
||||
#include "gui/databasekey/KeyFileEditWidget.h"
|
||||
#include "gui/databasekey/PasswordEditWidget.h"
|
||||
#include "gui/databasekey/YubiKeyEditWidget.h"
|
||||
#include "keys/FileKey.h"
|
||||
#include "keys/PasswordKey.h"
|
||||
#include "keys/YkChallengeResponseKey.h"
|
||||
|
@ -30,7 +30,7 @@
|
|||
#include <QSpacerItem>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
DatabaseSettingsWidgetMasterKey::DatabaseSettingsWidgetMasterKey(QWidget* parent)
|
||||
DatabaseSettingsWidgetDatabaseKey::DatabaseSettingsWidgetDatabaseKey(QWidget* parent)
|
||||
: DatabaseSettingsWidget(parent)
|
||||
, m_additionalKeyOptionsToggle(new QPushButton(tr("Add additional protection..."), this))
|
||||
, m_additionalKeyOptions(new QWidget(this))
|
||||
|
@ -65,11 +65,11 @@ DatabaseSettingsWidgetMasterKey::DatabaseSettingsWidgetMasterKey(QWidget* parent
|
|||
setLayout(vbox);
|
||||
}
|
||||
|
||||
DatabaseSettingsWidgetMasterKey::~DatabaseSettingsWidgetMasterKey()
|
||||
DatabaseSettingsWidgetDatabaseKey::~DatabaseSettingsWidgetDatabaseKey()
|
||||
{
|
||||
}
|
||||
|
||||
void DatabaseSettingsWidgetMasterKey::load(QSharedPointer<Database> db)
|
||||
void DatabaseSettingsWidgetDatabaseKey::load(QSharedPointer<Database> db)
|
||||
{
|
||||
DatabaseSettingsWidget::load(db);
|
||||
|
||||
|
@ -107,7 +107,7 @@ void DatabaseSettingsWidgetMasterKey::load(QSharedPointer<Database> db)
|
|||
#endif
|
||||
}
|
||||
|
||||
void DatabaseSettingsWidgetMasterKey::initialize()
|
||||
void DatabaseSettingsWidgetDatabaseKey::initialize()
|
||||
{
|
||||
bool blocked = blockSignals(true);
|
||||
m_passwordEditWidget->setComponentAdded(false);
|
||||
|
@ -118,11 +118,11 @@ void DatabaseSettingsWidgetMasterKey::initialize()
|
|||
blockSignals(blocked);
|
||||
}
|
||||
|
||||
void DatabaseSettingsWidgetMasterKey::uninitialize()
|
||||
void DatabaseSettingsWidgetDatabaseKey::uninitialize()
|
||||
{
|
||||
}
|
||||
|
||||
bool DatabaseSettingsWidgetMasterKey::save()
|
||||
bool DatabaseSettingsWidgetDatabaseKey::save()
|
||||
{
|
||||
m_isDirty |= (m_passwordEditWidget->visiblePage() == KeyComponentWidget::Page::Edit);
|
||||
m_isDirty |= (m_keyFileEditWidget->visiblePage() == KeyComponentWidget::Page::Edit);
|
||||
|
@ -202,17 +202,17 @@ bool DatabaseSettingsWidgetMasterKey::save()
|
|||
return true;
|
||||
}
|
||||
|
||||
void DatabaseSettingsWidgetMasterKey::discard()
|
||||
void DatabaseSettingsWidgetDatabaseKey::discard()
|
||||
{
|
||||
emit editFinished(false);
|
||||
}
|
||||
|
||||
void DatabaseSettingsWidgetMasterKey::showAdditionalKeyOptions()
|
||||
void DatabaseSettingsWidgetDatabaseKey::showAdditionalKeyOptions()
|
||||
{
|
||||
setAdditionalKeyOptionsVisible(true);
|
||||
}
|
||||
|
||||
void DatabaseSettingsWidgetMasterKey::setAdditionalKeyOptionsVisible(bool show)
|
||||
void DatabaseSettingsWidgetDatabaseKey::setAdditionalKeyOptionsVisible(bool show)
|
||||
{
|
||||
m_additionalKeyOptionsToggle->setVisible(!show);
|
||||
m_additionalKeyOptions->setVisible(show);
|
||||
|
@ -220,14 +220,14 @@ void DatabaseSettingsWidgetMasterKey::setAdditionalKeyOptionsVisible(bool show)
|
|||
emit sizeChanged();
|
||||
}
|
||||
|
||||
bool DatabaseSettingsWidgetMasterKey::addToCompositeKey(KeyComponentWidget* widget,
|
||||
QSharedPointer<CompositeKey>& newKey,
|
||||
QSharedPointer<Key>& oldKey)
|
||||
bool DatabaseSettingsWidgetDatabaseKey::addToCompositeKey(KeyComponentWidget* widget,
|
||||
QSharedPointer<CompositeKey>& newKey,
|
||||
QSharedPointer<Key>& oldKey)
|
||||
{
|
||||
if (widget->visiblePage() == KeyComponentWidget::Edit) {
|
||||
QString error = tr("Unknown error");
|
||||
if (!widget->validate(error) || !widget->addToCompositeKey(newKey)) {
|
||||
MessageBox::critical(this, tr("Failed to change master key"), error, MessageBox::Ok);
|
||||
MessageBox::critical(this, tr("Failed to change database credentials"), error, MessageBox::Ok);
|
||||
return false;
|
||||
}
|
||||
} else if (widget->visiblePage() == KeyComponentWidget::LeaveOrRemove) {
|
||||
|
@ -237,14 +237,14 @@ bool DatabaseSettingsWidgetMasterKey::addToCompositeKey(KeyComponentWidget* widg
|
|||
return true;
|
||||
}
|
||||
|
||||
bool DatabaseSettingsWidgetMasterKey::addToCompositeKey(KeyComponentWidget* widget,
|
||||
QSharedPointer<CompositeKey>& newKey,
|
||||
QSharedPointer<ChallengeResponseKey>& oldKey)
|
||||
bool DatabaseSettingsWidgetDatabaseKey::addToCompositeKey(KeyComponentWidget* widget,
|
||||
QSharedPointer<CompositeKey>& newKey,
|
||||
QSharedPointer<ChallengeResponseKey>& oldKey)
|
||||
{
|
||||
if (widget->visiblePage() == KeyComponentWidget::Edit) {
|
||||
QString error = tr("Unknown error");
|
||||
if (!widget->validate(error) || !widget->addToCompositeKey(newKey)) {
|
||||
MessageBox::critical(this, tr("Failed to change master key"), error, MessageBox::Ok);
|
||||
MessageBox::critical(this, tr("Failed to change database credentials"), error, MessageBox::Ok);
|
||||
return false;
|
||||
}
|
||||
} else if (widget->visiblePage() == KeyComponentWidget::LeaveOrRemove) {
|
||||
|
@ -254,7 +254,7 @@ bool DatabaseSettingsWidgetMasterKey::addToCompositeKey(KeyComponentWidget* widg
|
|||
return true;
|
||||
}
|
||||
|
||||
void DatabaseSettingsWidgetMasterKey::markDirty()
|
||||
void DatabaseSettingsWidgetDatabaseKey::markDirty()
|
||||
{
|
||||
m_isDirty = true;
|
||||
}
|
|
@ -15,8 +15,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KEEPASSXC_DATABASESETTINGSPAGECHANGEMASTERKEY_H
|
||||
#define KEEPASSXC_DATABASESETTINGSPAGECHANGEMASTERKEY_H
|
||||
#ifndef KEEPASSXC_DATABASESETTINGSPAGECHANGEDBKEY_H
|
||||
#define KEEPASSXC_DATABASESETTINGSPAGECHANGEDBKEY_H
|
||||
|
||||
#include "DatabaseSettingsWidget.h"
|
||||
#include "config-keepassx.h"
|
||||
|
@ -33,14 +33,14 @@ class KeyFileEditWidget;
|
|||
class YubiKeyEditWidget;
|
||||
class QPushButton;
|
||||
|
||||
class DatabaseSettingsWidgetMasterKey : public DatabaseSettingsWidget
|
||||
class DatabaseSettingsWidgetDatabaseKey : public DatabaseSettingsWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DatabaseSettingsWidgetMasterKey(QWidget* parent = nullptr);
|
||||
Q_DISABLE_COPY(DatabaseSettingsWidgetMasterKey);
|
||||
~DatabaseSettingsWidgetMasterKey() override;
|
||||
explicit DatabaseSettingsWidgetDatabaseKey(QWidget* parent = nullptr);
|
||||
Q_DISABLE_COPY(DatabaseSettingsWidgetDatabaseKey);
|
||||
~DatabaseSettingsWidgetDatabaseKey() override;
|
||||
|
||||
void load(QSharedPointer<Database> db) override;
|
||||
|
||||
|
@ -82,4 +82,4 @@ private:
|
|||
#endif
|
||||
};
|
||||
|
||||
#endif // KEEPASSXC_DATABASESETTINGSPAGECHANGEMASTERKEY_H
|
||||
#endif // KEEPASSXC_DATABASESETTINGSPAGECHANGEDBKEY_H
|
|
@ -16,8 +16,8 @@
|
|||
*/
|
||||
|
||||
#include "NewDatabaseWizard.h"
|
||||
#include "NewDatabaseWizardPageDatabaseKey.h"
|
||||
#include "NewDatabaseWizardPageEncryption.h"
|
||||
#include "NewDatabaseWizardPageMasterKey.h"
|
||||
#include "NewDatabaseWizardPageMetaData.h"
|
||||
|
||||
#include "core/Database.h"
|
||||
|
@ -41,7 +41,7 @@ NewDatabaseWizard::NewDatabaseWizard(QWidget* parent)
|
|||
// clang-format off
|
||||
m_pages << new NewDatabaseWizardPageMetaData()
|
||||
<< new NewDatabaseWizardPageEncryption()
|
||||
<< new NewDatabaseWizardPageMasterKey();
|
||||
<< new NewDatabaseWizardPageDatabaseKey();
|
||||
// clang-format on
|
||||
|
||||
for (const auto& page : asConst(m_pages)) {
|
||||
|
|
|
@ -15,26 +15,26 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "NewDatabaseWizardPageMasterKey.h"
|
||||
#include "gui/dbsettings/DatabaseSettingsWidgetMasterKey.h"
|
||||
#include "NewDatabaseWizardPageDatabaseKey.h"
|
||||
#include "gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.h"
|
||||
#include <QApplication>
|
||||
|
||||
NewDatabaseWizardPageMasterKey::NewDatabaseWizardPageMasterKey(QWidget* parent)
|
||||
NewDatabaseWizardPageDatabaseKey::NewDatabaseWizardPageDatabaseKey(QWidget* parent)
|
||||
: NewDatabaseWizardPage(parent)
|
||||
{
|
||||
setPageWidget(new DatabaseSettingsWidgetMasterKey());
|
||||
setPageWidget(new DatabaseSettingsWidgetDatabaseKey());
|
||||
|
||||
setTitle(tr("Database Master Key"));
|
||||
setSubTitle(tr("A master key known only to you protects your database."));
|
||||
setTitle(tr("Database Credentials"));
|
||||
setSubTitle(tr("A set of credentials known only to you that protects your database."));
|
||||
|
||||
connect(pageWidget(), SIGNAL(sizeChanged()), SLOT(updateWindowSize()));
|
||||
}
|
||||
|
||||
NewDatabaseWizardPageMasterKey::~NewDatabaseWizardPageMasterKey()
|
||||
NewDatabaseWizardPageDatabaseKey::~NewDatabaseWizardPageDatabaseKey()
|
||||
{
|
||||
}
|
||||
|
||||
void NewDatabaseWizardPageMasterKey::updateWindowSize()
|
||||
void NewDatabaseWizardPageDatabaseKey::updateWindowSize()
|
||||
{
|
||||
// ugly workaround for QWizard not managing to react to size changes automatically
|
||||
window()->adjustSize();
|
|
@ -15,22 +15,22 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KEEPASSXC_NEWDATABASEWIZARDPAGEMASTERKEY_H
|
||||
#define KEEPASSXC_NEWDATABASEWIZARDPAGEMASTERKEY_H
|
||||
#ifndef KEEPASSXC_NEWDATABASEWIZARDPAGEDATABASEKEY_H
|
||||
#define KEEPASSXC_NEWDATABASEWIZARDPAGEDATABASEKEY_H
|
||||
|
||||
#include "NewDatabaseWizardPage.h"
|
||||
|
||||
class NewDatabaseWizardPageMasterKey : public NewDatabaseWizardPage
|
||||
class NewDatabaseWizardPageDatabaseKey : public NewDatabaseWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit NewDatabaseWizardPageMasterKey(QWidget* parent = nullptr);
|
||||
Q_DISABLE_COPY(NewDatabaseWizardPageMasterKey);
|
||||
~NewDatabaseWizardPageMasterKey() override;
|
||||
explicit NewDatabaseWizardPageDatabaseKey(QWidget* parent = nullptr);
|
||||
Q_DISABLE_COPY(NewDatabaseWizardPageDatabaseKey);
|
||||
~NewDatabaseWizardPageDatabaseKey() override;
|
||||
|
||||
private slots:
|
||||
void updateWindowSize();
|
||||
};
|
||||
|
||||
#endif // KEEPASSXC_NEWDATABASEWIZARDPAGEMASTERKEY_H
|
||||
#endif // KEEPASSXC_NEWDATABASEWIZARDPAGEDATABASEKEY_H
|
|
@ -87,9 +87,9 @@ void TestKeePass2Format::testXmlMetadata()
|
|||
QCOMPARE(m_xmlDb->metadata()->defaultUserNameChanged(), MockClock::datetimeUtc(2010, 8, 8, 17, 27, 45));
|
||||
QCOMPARE(m_xmlDb->metadata()->maintenanceHistoryDays(), 127);
|
||||
QCOMPARE(m_xmlDb->metadata()->color(), QString("#FFEF00"));
|
||||
QCOMPARE(m_xmlDb->metadata()->masterKeyChanged(), MockClock::datetimeUtc(2012, 4, 5, 17, 9, 34));
|
||||
QCOMPARE(m_xmlDb->metadata()->masterKeyChangeRec(), 101);
|
||||
QCOMPARE(m_xmlDb->metadata()->masterKeyChangeForce(), -1);
|
||||
QCOMPARE(m_xmlDb->metadata()->databaseKeyChanged(), MockClock::datetimeUtc(2012, 4, 5, 17, 9, 34));
|
||||
QCOMPARE(m_xmlDb->metadata()->databaseKeyChangeRec(), 101);
|
||||
QCOMPARE(m_xmlDb->metadata()->databaseKeyChangeForce(), -1);
|
||||
QCOMPARE(m_xmlDb->metadata()->protectTitle(), false);
|
||||
QCOMPARE(m_xmlDb->metadata()->protectUsername(), true);
|
||||
QCOMPARE(m_xmlDb->metadata()->protectPassword(), false);
|
||||
|
|
|
@ -63,15 +63,15 @@
|
|||
#include "gui/SearchWidget.h"
|
||||
#include "gui/TotpDialog.h"
|
||||
#include "gui/TotpSetupDialog.h"
|
||||
#include "gui/databasekey/KeyComponentWidget.h"
|
||||
#include "gui/databasekey/KeyFileEditWidget.h"
|
||||
#include "gui/databasekey/PasswordEditWidget.h"
|
||||
#include "gui/dbsettings/DatabaseSettingsDialog.h"
|
||||
#include "gui/entry/EditEntryWidget.h"
|
||||
#include "gui/entry/EntryView.h"
|
||||
#include "gui/group/EditGroupWidget.h"
|
||||
#include "gui/group/GroupModel.h"
|
||||
#include "gui/group/GroupView.h"
|
||||
#include "gui/masterkey/KeyComponentWidget.h"
|
||||
#include "gui/masterkey/KeyFileEditWidget.h"
|
||||
#include "gui/masterkey/PasswordEditWidget.h"
|
||||
#include "gui/wizard/NewDatabaseWizard.h"
|
||||
#include "keys/FileKey.h"
|
||||
#include "keys/PasswordKey.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue