mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-22 00:59:08 +01:00
encrypt inbound tunnel build message for short tunnel build only
This commit is contained in:
parent
6a467a09bd
commit
15c3d46492
1 changed files with 9 additions and 3 deletions
|
@ -92,10 +92,16 @@ namespace tunnel
|
||||||
|
|
||||||
// send message
|
// send message
|
||||||
if (outboundTunnel)
|
if (outboundTunnel)
|
||||||
|
{
|
||||||
|
if (m_Config->IsShort ())
|
||||||
{
|
{
|
||||||
auto ident = m_Config->GetFirstHop () ? m_Config->GetFirstHop ()->ident : nullptr;
|
auto ident = m_Config->GetFirstHop () ? m_Config->GetFirstHop ()->ident : nullptr;
|
||||||
if (ident && ident->GetCryptoKeyType () == i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD)
|
if (ident)
|
||||||
msg = i2p::garlic::WrapECIESX25519MessageForRouter (msg, ident->GetEncryptionPublicKey ());
|
{
|
||||||
|
auto msg1 = i2p::garlic::WrapECIESX25519MessageForRouter (msg, ident->GetEncryptionPublicKey ());
|
||||||
|
if (msg1) msg = msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
outboundTunnel->SendTunnelDataMsg (GetNextIdentHash (), 0, msg);
|
outboundTunnel->SendTunnelDataMsg (GetNextIdentHash (), 0, msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue