diff --git a/KeeTrayTOTP/Libraries/TOTPProvider.cs b/KeeTrayTOTP/Libraries/TOTPProvider.cs index de26d5e..211174c 100644 --- a/KeeTrayTOTP/Libraries/TOTPProvider.cs +++ b/KeeTrayTOTP/Libraries/TOTPProvider.cs @@ -68,7 +68,7 @@ public int Length /// /// Instantiate a new TOTP_Generator. /// - public TOTPProvider(string[] settings, ref TimeCorrectionCollection tcc) + public TOTPProvider(string[] settings, TimeCorrectionCollection tcc) { this._duration = Convert.ToInt16(settings[0]); @@ -138,26 +138,6 @@ public long Counter } } - /// - /// Converts an unsigned integer to binary data. - /// - /// Unsigned Integer. - /// Binary data. - private byte[] GetBytes(ulong n) - { - byte[] b = new byte[8]; - b[0] = (byte)(n >> 56); - b[1] = (byte)(n >> 48); - b[2] = (byte)(n >> 40); - b[3] = (byte)(n >> 32); - b[4] = (byte)(n >> 24); - b[5] = (byte)(n >> 16); - b[6] = (byte)(n >> 8); - b[7] = (byte)n; - - return b; - } - /// /// Generate a TOTP using provided binary data. /// diff --git a/KeeTrayTOTP/TrayTOTP_ColumnProvider.cs b/KeeTrayTOTP/TrayTOTP_ColumnProvider.cs index 74ce4e9..435fa3e 100644 --- a/KeeTrayTOTP/TrayTOTP_ColumnProvider.cs +++ b/KeeTrayTOTP/TrayTOTP_ColumnProvider.cs @@ -79,7 +79,7 @@ private static string GetInnerValueStatus(PwEntry entry) private string GetInnerValueCode(PwEntry entry) { string[] settings = _plugin.SettingsGet(entry); - var totpGenerator = new TOTPProvider(settings, ref _plugin.TimeCorrections); + var totpGenerator = new TOTPProvider(settings, _plugin.TimeCorrections); return totpGenerator.GenerateByByte(Base32.Decode(_plugin.SeedGet(entry).ReadString().ExtWithoutSpaces())) + (_plugin.PluginHost.CustomConfig.GetBool(KeeTrayTOTPExt.setname_bool_TOTPColumnTimer_Visible, true) ? totpGenerator.Timer.ToString().ExtWithParenthesis().ExtWithSpaceBefore() : string.Empty); } diff --git a/KeeTrayTOTP/TrayTOTP_Plugin.cs b/KeeTrayTOTP/TrayTOTP_Plugin.cs index 5bd6e03..0788644 100644 --- a/KeeTrayTOTP/TrayTOTP_Plugin.cs +++ b/KeeTrayTOTP/TrayTOTP_Plugin.cs @@ -624,7 +624,7 @@ private void SprEngine_FilterCompile(object sender, SprEventArgs e) { string[] settings = SettingsGet(e.Context.Entry); - TOTPProvider totpGenerator = new TOTPProvider(settings, ref this.TimeCorrections); + TOTPProvider totpGenerator = new TOTPProvider(settings, this.TimeCorrections); string invalidCharacters; @@ -841,7 +841,7 @@ internal void TOTPCopyToClipboard(PwEntry pe) { string[] settings = SettingsGet(pe); - TOTPProvider totpGenerator = new TOTPProvider(settings, ref this.TimeCorrections); + TOTPProvider totpGenerator = new TOTPProvider(settings, this.TimeCorrections); string invalidCharacters; if (SeedValidate(pe, out invalidCharacters))