diff --git a/src/Properties/AssemblyInfo.cs b/src/Properties/AssemblyInfo.cs index 7e61239..d313e35 100644 --- a/src/Properties/AssemblyInfo.cs +++ b/src/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Rookiestyle")] [assembly: AssemblyProduct("KeePass Plugin")] -[assembly: AssemblyCopyright("Copyright © 2021-2023")] +[assembly: AssemblyCopyright("Copyright © 2021-2024")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.5")] -[assembly: AssemblyFileVersion("3.5")] +[assembly: AssemblyVersion("3.6")] +[assembly: AssemblyFileVersion("3.6")] diff --git a/src/SoftLock.cs b/src/SoftLock.cs index c6be682..74bf164 100644 --- a/src/SoftLock.cs +++ b/src/SoftLock.cs @@ -197,22 +197,36 @@ private void OnTimerTick(object sender, EventArgs e) private void DisableSoftlockUsingQU() { - m_UnlockForm = new UnlockForm(); - m_UnlockForm.Text = PluginTranslate.PluginName + " - Softlock"; - if (m_UnlockForm.ShowDialog(Program.MainForm) == DialogResult.OK) + if (m_UnlockForm != null) m_UnlockForm.Dispose(); + + KeePassLib.Delegates.GFunc fConstruct = delegate() { - ProtectedString CheckQuickUnlockKey = m_UnlockForm.QuickUnlockKey; - ProtectedString QuickUnlockKey = _qu.GetQuickUnlockKey(Program.MainForm.ActiveDatabase); - var lac = LockAssistConfig.GetQuickUnlockOptions(Program.MainForm.ActiveDatabase); - if ((QuickUnlockKey == null) || CheckQuickUnlockKey.Equals(_qu.TrimQuickUnlockKey(QuickUnlockKey, lac), false)) - { - SetVisibility(true); - if (LockAssistConfig.SL_IsActive) m_SLTimer.Interval = LockAssistConfig.SL_Seconds * 1000; - } - else PluginDebug.AddError("Deactivate SoftLock", "Deactivation failed", "Invalid Quick Unlock key provided"); + m_UnlockForm = new UnlockForm(); + m_UnlockForm.Text = PluginTranslate.PluginName + " - Softlock"; + return m_UnlockForm; + }; + + KeePassLib.Delegates.GFunc fResultBuilder = delegate(UnlockForm f) + { + ProtectedString r = f.QuickUnlockKey; + UIUtil.DestroyForm(m_UnlockForm); + m_UnlockForm = null; + return r; + }; + + ProtectedString psCheckQuickUnlockKey = new ProtectedString(); + DialogResult dr = Tools.ShowDialog(Program.Config.Security.MasterKeyOnSecureDesktop, fConstruct, fResultBuilder, out psCheckQuickUnlockKey); + + if (dr != DialogResult.OK) return; + + ProtectedString psQuickUnlockKey = _qu.GetQuickUnlockKey(Program.MainForm.ActiveDatabase); + var lacOptions = LockAssistConfig.GetQuickUnlockOptions(Program.MainForm.ActiveDatabase); + if ((psQuickUnlockKey == null) || psCheckQuickUnlockKey.Equals(_qu.TrimQuickUnlockKey(psQuickUnlockKey, lacOptions), false)) + { + SetVisibility(true); + if (LockAssistConfig.SL_IsActive) m_SLTimer.Interval = LockAssistConfig.SL_Seconds * 1000; } - if (m_UnlockForm != null) m_UnlockForm.Dispose(); - m_UnlockForm = null; + else PluginDebug.AddError("Deactivate SoftLock", "Deactivation failed", "Invalid Quick Unlock key provided"); } private void DisableSoftlockUsingFullPassword() diff --git a/version.info b/version.info index 54dfb1c..fcf9643 100644 --- a/version.info +++ b/version.info @@ -1,5 +1,5 @@ : -LockAssist:3.5 +LockAssist:3.6 LockAssist!de:5 LockAssist!pt:4 LockAssist!zh:5