From a5c3bf6d9d6b697f40e125b08e65962aec6f5d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20V=C3=A4nttinen?= Date: Sun, 31 Mar 2024 23:12:15 +0300 Subject: [PATCH] Passkeys: Add warning on export (#10411) --- share/translations/keepassxc_en.ts | 8 ++++++++ src/gui/reports/ReportsWidgetPasskeys.cpp | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/share/translations/keepassxc_en.ts b/share/translations/keepassxc_en.ts index 4f84ea6e8..5f4b1d2be 100644 --- a/share/translations/keepassxc_en.ts +++ b/share/translations/keepassxc_en.ts @@ -8828,6 +8828,14 @@ This options is deprecated, use --set-key-file instead. (Expired) + + Export Confirmation + + + + The passkey file will be vulnerable to theft and unauthorized use, if left unsecured. Are you sure you want to continue? + + ReportsWidgetStatistics diff --git a/src/gui/reports/ReportsWidgetPasskeys.cpp b/src/gui/reports/ReportsWidgetPasskeys.cpp index a50576be6..f14b092a9 100644 --- a/src/gui/reports/ReportsWidgetPasskeys.cpp +++ b/src/gui/reports/ReportsWidgetPasskeys.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 KeePassXC Team + * Copyright (C) 2024 KeePassXC Team * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ #include "core/Metadata.h" #include "gui/GuiTools.h" #include "gui/Icons.h" +#include "gui/MessageBox.h" #include "gui/passkeys/PasskeyExporter.h" #include "gui/passkeys/PasskeyImporter.h" #include "gui/styles/StateColorPalette.h" @@ -289,6 +290,16 @@ void ReportsWidgetPasskeys::importPasskey() void ReportsWidgetPasskeys::exportPasskey() { + auto answer = MessageBox::question(this, + tr("Export Confirmation"), + tr("The passkey file will be vulnerable to theft and unauthorized use, if left " + "unsecured. Are you sure you want to continue?"), + MessageBox::Yes | MessageBox::No, + MessageBox::No); + if (answer != MessageBox::Yes) { + return; + } + PasskeyExporter passkeyExporter; passkeyExporter.showExportDialog(getSelectedEntries()); }