mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
create LeaseSet encryption key per tunnel pool
This commit is contained in:
parent
d7084e379f
commit
28042926e7
@ -5,6 +5,7 @@
|
|||||||
#include "RouterContext.h"
|
#include "RouterContext.h"
|
||||||
#include "I2NPProtocol.h"
|
#include "I2NPProtocol.h"
|
||||||
#include "Tunnel.h"
|
#include "Tunnel.h"
|
||||||
|
#include "TunnelPool.h"
|
||||||
#include "Timestamp.h"
|
#include "Timestamp.h"
|
||||||
#include "Streaming.h"
|
#include "Streaming.h"
|
||||||
#include "Garlic.h"
|
#include "Garlic.h"
|
||||||
@ -288,9 +289,12 @@ namespace garlic
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// new session
|
// new session
|
||||||
|
i2p::tunnel::TunnelPool * pool = nullptr;
|
||||||
|
if (msg->from)
|
||||||
|
pool = msg->from->GetTunnelPool ();
|
||||||
ElGamalBlock elGamal;
|
ElGamalBlock elGamal;
|
||||||
if (i2p::crypto::ElGamalDecrypt (
|
if (i2p::crypto::ElGamalDecrypt (
|
||||||
msg->from ? i2p::context.GetLeaseSetPrivateKey () : i2p::context.GetPrivateKey (),
|
pool ? pool->GetEncryptionPrivateKey () : i2p::context.GetPrivateKey (),
|
||||||
buf, (uint8_t *)&elGamal, true))
|
buf, (uint8_t *)&elGamal, true))
|
||||||
{
|
{
|
||||||
uint8_t iv[32]; // IV is first 16 bytes
|
uint8_t iv[32]; // IV is first 16 bytes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user