mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-05-21 14:51:48 +02:00
garlic encryption of inbound tunnel build message
This commit is contained in:
parent
d47bf1bada
commit
1e9eb30aa3
5 changed files with 18 additions and 4 deletions
|
@ -1133,7 +1133,7 @@ namespace garlic
|
|||
return true;
|
||||
}
|
||||
|
||||
std::shared_ptr<I2NPMessage> WrapECIESX25519AEADRatchetMessage (std::shared_ptr<const I2NPMessage> msg, const uint8_t * key, uint64_t tag)
|
||||
std::shared_ptr<I2NPMessage> WrapECIESX25519Message (std::shared_ptr<const I2NPMessage> msg, const uint8_t * key, uint64_t tag)
|
||||
{
|
||||
auto m = NewI2NPMessage ();
|
||||
m->Align (12); // in order to get buf aligned to 16 (12 + 4)
|
||||
|
@ -1167,5 +1167,12 @@ namespace garlic
|
|||
return m;
|
||||
}
|
||||
|
||||
std::shared_ptr<I2NPMessage> WrapECIESX25519MessageForRouter (std::shared_ptr<const I2NPMessage> msg, const uint8_t * routerPublicKey)
|
||||
{
|
||||
// TODO: implement without session
|
||||
auto session = std::make_shared<ECIESX25519AEADRatchetSession>(nullptr, false);
|
||||
session->SetRemoteStaticKey (routerPublicKey);
|
||||
return session->WrapOneTimeMessage (msg, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue