From 627cf204ede4204b58c385c30e82561cfc93d28c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 15 Mar 2019 12:48:15 +0000 Subject: [PATCH] Warn on importing complete certificate chains (part of #1488). --- src/lib/config.h | 1 + src/wx/config_dialog.cc | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/lib/config.h b/src/lib/config.h index 3518dc63f..7f8dd0cd4 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -370,6 +370,7 @@ public: NAG_BAD_SIGNER_CHAIN, /* Not really a nag but it's the same idea */ NAG_INITIAL_SETUP, + NAG_IMPORT_DECRYPTION_CHAIN, NAG_COUNT }; diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 13a405670..a32b5d968 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -841,6 +841,16 @@ KeysPage::export_decryption_chain_and_key () void KeysPage::import_decryption_chain_and_key () { + if (NagDialog::maybe_nag ( + _panel, + Config::NAG_IMPORT_DECRYPTION_CHAIN, + /* XXX: this needs to be marked translatable */ + wxT("If you continue with this operation you will no longer be able to use any DKDMs that you have created with the current certificates and key. Also, any KDMs that have been sent to you for those certificates will become useless. Proceed with caution!"), + true + )) { + return; + } + wxFileDialog* d = new wxFileDialog ( _panel, _("Select File To Import"), wxEmptyString, wxEmptyString, wxT ("DOM files (*.dom)|*.dom") ); -- 2.30.2