mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
KeePassLib selftest class corrected in release
This commit is contained in:
@@ -687,7 +687,8 @@ namespace ModernKeePassLib.Cryptography
|
||||
private static void HmacEval(byte[] pbKey, byte[] pbMsg,
|
||||
byte[] pbExpc, string strID)
|
||||
{
|
||||
/*#if ModernKeePassLib
|
||||
#if ModernKeePassLib
|
||||
/*
|
||||
// WinRT
|
||||
var h = MacAlgorithmProvider.OpenAlgorithm(MacAlgorithmNames.HmacSha256).CreateHash(CryptographicBuffer.CreateFromByteArray(pbKey));
|
||||
h.Append(CryptographicBuffer.CreateFromByteArray(pbMsg));
|
||||
@@ -712,8 +713,8 @@ namespace ModernKeePassLib.Cryptography
|
||||
//h.BlockUpdate(pbMsg, 0, pbMsg.Length);
|
||||
//h.DoFinal(pbHash, 0);
|
||||
//if (!MemUtil.ArraysEqual(pbHash, pbExpc))
|
||||
// throw new SecurityException("HMAC-SHA-256-" + strID + "-R");
|
||||
#else*/
|
||||
// throw new SecurityException("HMAC-SHA-256-" + strID + "-R");*/
|
||||
#else
|
||||
// Original
|
||||
using(HMACSHA256 h = new HMACSHA256(pbKey))
|
||||
{
|
||||
@@ -733,7 +734,7 @@ namespace ModernKeePassLib.Cryptography
|
||||
if(!MemUtil.ArraysEqual(pbHash, pbExpc))
|
||||
throw new SecurityException("HMAC-SHA-256-" + strID + "-R");
|
||||
}
|
||||
//#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user