mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-23 15:00:47 -04:00
Add support for version 2 XML key files.
As discussed in #4317, the next KeePass2 release will ship with support for a new generation of XML key files which enable hash integrity checks. This patch adds support for reading and generating this new format. By default, KeePass2 now uses the .keyx extension for generated key files, which was added to KeePassXC's key generation file chooser filter. We continue to generate hashed binary key files by default, but the user can explicitly save the file with the new .keyx extension to generate an XML v2 key file (currently undocumented). When opening a database, the key file type is still determined by content negotation, so the file extension has no impact here. As an additional change, the legacy key file warnings have been improved slightly to be less confusing and more helpful.
This commit is contained in:
parent
404fd941e8
commit
cd0084f21c
12 changed files with 233 additions and 118 deletions
|
@ -301,12 +301,14 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::buildDatabaseKey()
|
|||
m_ui->messageWidget->showMessage(tr("Failed to open key file: %1").arg(errorMsg), MessageWidget::Error);
|
||||
return {};
|
||||
}
|
||||
if (key->type() != FileKey::Hashed && !config()->get(Config::Messages_NoLegacyKeyFileWarning).toBool()) {
|
||||
if (key->type() != FileKey::KeePass2XMLv2 && key->type() != FileKey::Hashed
|
||||
&& !config()->get(Config::Messages_NoLegacyKeyFileWarning).toBool()) {
|
||||
QMessageBox legacyWarning;
|
||||
legacyWarning.setWindowTitle(tr("Legacy key file format"));
|
||||
legacyWarning.setText(tr("You are using a legacy key file format which may become\n"
|
||||
"unsupported in the future.\n\n"
|
||||
"Please consider generating a new key file."));
|
||||
legacyWarning.setWindowTitle(tr("Old key file format"));
|
||||
legacyWarning.setText(tr("You are using an old key file format which KeePassXC may<br>"
|
||||
"stop supporting in the future.<br><br>"
|
||||
"Please consider generating a new key file by going to:<br>"
|
||||
"<strong>Database / Database Security / Change Key File.</strong><br>"));
|
||||
legacyWarning.setIcon(QMessageBox::Icon::Warning);
|
||||
legacyWarning.addButton(QMessageBox::Ok);
|
||||
legacyWarning.setDefaultButton(QMessageBox::Ok);
|
||||
|
@ -355,7 +357,7 @@ void DatabaseOpenWidget::reject()
|
|||
|
||||
void DatabaseOpenWidget::browseKeyFile()
|
||||
{
|
||||
QString filters = QString("%1 (*);;%2 (*.key)").arg(tr("All files"), tr("Key files"));
|
||||
QString filters = QString("%1 (*);;%2 (*.keyx; *.key)").arg(tr("All files"), tr("Key files"));
|
||||
if (!config()->get(Config::RememberLastKeyFiles).toBool()) {
|
||||
fileDialog()->setNextForgetDialog();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue