1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 04:04:16 +00:00

proper verification for DSA_SHA1

This commit is contained in:
orignal 2015-03-26 22:17:26 -04:00
parent f07d29bc8a
commit c92e00c21f

View File

@ -95,7 +95,11 @@ namespace datagram
bool verified = false;
if (identity.GetSigningKeyType () == i2p::data::SIGNING_KEY_TYPE_DSA_SHA1)
verified = CryptoPP::SHA256().VerifyDigest (signature, buf + headerLen, len - headerLen);
{
uint8_t hash[32];
CryptoPP::SHA256().CalculateDigest (hash, buf + headerLen, len - headerLen);
verified = identity.Verify (hash, 32, signature);
}
else
verified = identity.Verify (buf + headerLen, len - headerLen, signature);