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

@ -711,6 +711,7 @@ namespace client
else
i2p::data::PrivateKeys::GenerateCryptoKeyPair(GetIdentity ()->GetCryptoKeyType (),
m_EncryptionPrivateKey, m_EncryptionPublicKey);
m_Decryptor = m_Keys.CreateDecryptor (m_EncryptionPrivateKey);
if (isPublic)
LogPrint (eLogInfo, "Destination: Local address ", GetIdentHash().ToBase32 (), " created");
}
@ -952,5 +953,12 @@ namespace client
if (m_DatagramDestination) m_DatagramDestination->CleanUp ();
}
void ClientDestination::Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx) const
{
if (m_Decryptor)
m_Decryptor->Decrypt (encrypted, data, ctx);
else
LogPrint (eLogError, "Destinations: decryptor is not set");
}
}
}