Skip to content

Commit

Permalink
improvement: add hint that TOTP key has been removed
Browse files Browse the repository at this point in the history
  • Loading branch information
heinrich-ulbricht committed Dec 10, 2017
1 parent d56b3c3 commit fff4a86
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion PartialKeePassDatabaseExportExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

0 comments on commit fff4a86

Please sign in to comment.