mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01:00
drop verifier not used anymore
This commit is contained in:
parent
6153d799bc
commit
f7d90648e3
|
@ -265,6 +265,13 @@ namespace data
|
|||
}
|
||||
}
|
||||
|
||||
void IdentityEx::DropVerifier ()
|
||||
{
|
||||
auto verifier = m_Verifier;
|
||||
m_Verifier = nullptr; // TODO: make this atomic
|
||||
delete verifier;
|
||||
}
|
||||
|
||||
PrivateKeys& PrivateKeys::operator=(const Keys& keys)
|
||||
{
|
||||
m_Public = Identity (keys);
|
||||
|
|
|
@ -135,6 +135,7 @@ namespace data
|
|||
bool Verify (const uint8_t * buf, size_t len, const uint8_t * signature) const;
|
||||
SigningKeyType GetSigningKeyType () const;
|
||||
CryptoKeyType GetCryptoKeyType () const;
|
||||
void DropVerifier (); // to save memory
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -102,7 +102,11 @@ namespace data
|
|||
// verify signature
|
||||
int l = m_BufferLen - m_RouterIdentity.GetSignatureLen ();
|
||||
if (!m_RouterIdentity.Verify ((uint8_t *)m_Buffer, l, (uint8_t *)m_Buffer + l))
|
||||
{
|
||||
LogPrint (eLogError, "signature verification failed");
|
||||
m_IsUnreachable = true;
|
||||
}
|
||||
m_RouterIdentity.DropVerifier ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue