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:
parent
f07d29bc8a
commit
c92e00c21f
@ -95,7 +95,11 @@ namespace datagram
|
|||||||
|
|
||||||
bool verified = false;
|
bool verified = false;
|
||||||
if (identity.GetSigningKeyType () == i2p::data::SIGNING_KEY_TYPE_DSA_SHA1)
|
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
|
else
|
||||||
verified = identity.Verify (buf + headerLen, len - headerLen, signature);
|
verified = identity.Verify (buf + headerLen, len - headerLen, signature);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user