MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / WrapMessageForRouter

Method WrapMessageForRouter

libi2pd/Garlic.cpp:745–755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

743 }
744
745 std::shared_ptr<I2NPMessage> GarlicDestination::WrapMessageForRouter (std::shared_ptr<const i2p::data::RouterInfo> router,
746 std::shared_ptr<I2NPMessage> msg)
747 {
748 if (router->GetEncryptionType () == i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD)
749 return WrapECIESX25519MessageForRouter (msg, router->GetIdentity ()->GetEncryptionPublicKey ());
750 else
751 {
752 auto session = GetRoutingSession (router, false);
753 return session->WrapSingleMessage (msg);
754 }
755 }
756
757 std::shared_ptr<GarlicRoutingSession> GarlicDestination::GetRoutingSession (
758 std::shared_ptr<const i2p::data::RoutingDestination> destination, bool attachLeaseSet,

Callers

nothing calls this directly

Calls 5

GetEncryptionTypeMethod · 0.45
GetIdentityMethod · 0.45
WrapSingleMessageMethod · 0.45

Tested by

no test coverage detected