use VerifyDigest for verification

This commit is contained in:
orignal 2014-12-21 21:32:21 -05:00
parent 0972782553
commit 5221e09b67
3 changed files with 4 additions and 11 deletions

View file

@ -418,9 +418,7 @@ namespace garlic
buf++; // flag
// payload
uint8_t hash[32];
CryptoPP::SHA256().CalculateDigest(hash, buf, payloadSize);
if (memcmp (hash, payloadHash, 32)) // payload hash doesn't match
if (!CryptoPP::SHA256().VerifyDigest (payloadHash, buf, payloadSize)) // payload hash doesn't match
{
LogPrint ("Wrong payload hash");
return;