Skip to content

Commit

Permalink
Bugfix: Incorrect display of remaining time for TOTP in KPOTP column
Browse files Browse the repository at this point in the history
  • Loading branch information
Rookiestyle committed Sep 29, 2020
1 parent 8cba454 commit f6df454
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/DAO/OTPDAO_DB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ public override string GetReadableOTP(PwEntry pe)
return otp.ReadableOTP;

if (otp.kpotp.Type == KPOTPType.HOTP) return otp.ReadableOTP;
int r = (otp.ValidTo - DateTime.UtcNow).Seconds;
int r = (otp.ValidTo - DateTime.UtcNow).Seconds + 1;
return otp.ReadableOTP + (r < 6 ? " (" + r.ToString() + ")" : string.Empty);
}

Expand Down
2 changes: 1 addition & 1 deletion src/DAO/OTPDAO_Entry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override string GetReadableOTP(PwEntry pe)
return otp.ReadableOTP;
else
{
int r = (otp.ValidTo - DateTime.UtcNow).Seconds;
int r = (otp.ValidTo - DateTime.UtcNow).Seconds + 1;
return otp.ReadableOTP + (r < 6 ? " (" + r.ToString() + ")" : string.Empty);
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/DAO/TFASites.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KeePassOTP
{
Expand Down
1 change: 0 additions & 1 deletion src/KeePassOTPColumnProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace KeePassOTP
Expand Down
4 changes: 2 additions & 2 deletions src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,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("0.15")]
[assembly: AssemblyFileVersion("0.15")]
[assembly: AssemblyVersion("0.15.1")]
[assembly: AssemblyFileVersion("0.15.1")]
2 changes: 1 addition & 1 deletion version.info
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:
KeePassOTP:0.15
KeePassOTP:0.15.1
KeePassOTP!de:9
KeePassOTP!fr:2
:

0 comments on commit f6df454

Please sign in to comment.