implement Decrypt for all local destination

This commit is contained in:
orignal 2017-11-08 13:49:48 -05:00
parent 60aa459dfc
commit c5f784719d
8 changed files with 44 additions and 6 deletions

View file

@ -31,6 +31,15 @@ namespace client
void I2CPDestination::SetEncryptionPrivateKey (const uint8_t * key)
{
memcpy (m_EncryptionPrivateKey, key, 256);
m_Decryptor = i2p::data::PrivateKeys::CreateDecryptor (m_Identity->GetCryptoKeyType (), m_EncryptionPrivateKey);
}
void I2CPDestination::Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx) const
{
if (m_Decryptor)
m_Decryptor->Decrypt (encrypted, data, ctx);
else
LogPrint (eLogError, "I2CP: decryptor is not set");
}
void I2CPDestination::HandleDataMessage (const uint8_t * buf, size_t len)