diff --git a/TunnelPool.cpp b/TunnelPool.cpp index fbd2d098..c4938e8e 100644 --- a/TunnelPool.cpp +++ b/TunnelPool.cpp @@ -208,10 +208,16 @@ namespace tunnel } if (!failed) { - uint32_t msgID = rnd.GenerateWord32 (); - m_Tests[msgID] = std::make_pair (*it1, *it2); - (*it1)->SendTunnelDataMsg ((*it2)->GetNextIdentHash (), (*it2)->GetNextTunnelID (), - CreateDeliveryStatusMsg (msgID)); + uint8_t key[32], tag[32]; + rnd.GenerateBlock (key, 32); // random session key + rnd.GenerateBlock (tag, 32); // random session tag + m_LocalDestination.SubmitSessionKey (key, tag); + i2p::garlic::GarlicRoutingSession garlic (key, tag); + + uint32_t msgID = rnd.GenerateWord32 (); + m_Tests[msgID] = std::make_pair (*it1, *it2); + (*it1)->SendTunnelDataMsg ((*it2)->GetNextIdentHash (), (*it2)->GetNextTunnelID (), + garlic.WrapSingleMessage (CreateDeliveryStatusMsg (msgID))); it1++; it2++; } }