mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-05-23 07:35:37 +02:00
check if destination keys are correct
This commit is contained in:
parent
9aa9a62ed4
commit
69804c23f1
3 changed files with 8 additions and 5 deletions
|
@ -455,8 +455,9 @@ namespace data
|
|||
|
||||
size_t PrivateKeys::FromBuffer (const uint8_t * buf, size_t len)
|
||||
{
|
||||
m_Public = std::make_shared<IdentityEx>(buf, len);
|
||||
size_t ret = m_Public->GetFullLen ();
|
||||
m_Public = std::make_shared<IdentityEx>();
|
||||
size_t ret = m_Public->FromBuffer (buf, len);
|
||||
if (!ret || ret + 256 > len) return 0; // overflow
|
||||
memcpy (m_PrivateKey, buf + ret, 256); // private key always 256
|
||||
ret += 256;
|
||||
size_t signingPrivateKeySize = m_Public->GetSigningPrivateKeyLen ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue