Skip to content

Commit

Permalink
Bugfix - Correct handling of SHA256 as hash algorithm
Browse files Browse the repository at this point in the history
Closes #29
  • Loading branch information
Rookiestyle committed Nov 23, 2020
1 parent b8d58f4 commit dc21f71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/KeePassOTP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private byte[] ComputeHash(byte[] data)
HMAC hmac = null;

if (Hash == KPOTPHash.SHA256) hmac = new HMACSHA256(m_key);
if (Hash == KPOTPHash.SHA512) hmac = new HMACSHA512(m_key);
else if (Hash == KPOTPHash.SHA512) hmac = new HMACSHA512(m_key);
else hmac = new HMACSHA1(m_key, true);

byte[] r = hmac.ComputeHash(data);
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.20")]
[assembly: AssemblyFileVersion("0.20")]
[assembly: AssemblyVersion("0.20.1")]
[assembly: AssemblyFileVersion("0.20.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.20
KeePassOTP:0.20.1
KeePassOTP!de:11
KeePassOTP!fr:3
:

0 comments on commit dc21f71

Please sign in to comment.