From fff4a86dbb554153d4d5b364fc34a4604e1e7e4a Mon Sep 17 00:00:00 2001 From: Heinrich Ulbricht Date: Sun, 10 Dec 2017 20:59:19 +0100 Subject: [PATCH] improvement: add hint that TOTP key has been removed --- PartialKeePassDatabaseExportExt.cs | 12 +++++++++++- Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/PartialKeePassDatabaseExportExt.cs b/PartialKeePassDatabaseExportExt.cs index 71d78a4..3c519ff 100644 --- a/PartialKeePassDatabaseExportExt.cs +++ b/PartialKeePassDatabaseExportExt.cs @@ -221,7 +221,17 @@ private void ExportToNewDatabase(PwDatabase pdOriginal, IStatusLogger slLogger, if (exportConfig.ClearTotpStringEntry) { // remove TOTP secret key (when using the https://keepass.info/plugins.html#keeotp plugin) - pwEntryClone.Strings.Remove(Constants.ConfigPwStringName_Otp); + var keyExists = pwEntryClone.Strings.Exists(Constants.ConfigPwStringName_Otp); + if (keyExists) + { + pwEntryClone.Strings.Remove(Constants.ConfigPwStringName_Otp); + var title = pwEntryClone.Strings.Get(PwDefs.TitleField); + // add hint that 2FA key has been removed, but only if title is not empty (that's fishy) + if (!string.IsNullOrEmpty(title.ReadString())) + { + pwEntryClone.Strings.Set(PwDefs.TitleField, new ProtectedString(title.IsProtected, title.ReadString() + " [2FA removed]")); + } + } } pd.RootGroup.AddEntry(pwEntryClone, true); } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index db7660d..93bb473 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.1.1.0")] +[assembly: AssemblyFileVersion("1.1.1.0")]