From 28042926e75188d4171350f18a0d14183853b674 Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 15 Mar 2014 22:09:08 -0400 Subject: [PATCH] create LeaseSet encryption key per tunnel pool --- Garlic.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Garlic.cpp b/Garlic.cpp index 3e336092..c003b9a7 100644 --- a/Garlic.cpp +++ b/Garlic.cpp @@ -5,6 +5,7 @@ #include "RouterContext.h" #include "I2NPProtocol.h" #include "Tunnel.h" +#include "TunnelPool.h" #include "Timestamp.h" #include "Streaming.h" #include "Garlic.h" @@ -288,9 +289,12 @@ namespace garlic else { // new session + i2p::tunnel::TunnelPool * pool = nullptr; + if (msg->from) + pool = msg->from->GetTunnelPool (); ElGamalBlock elGamal; if (i2p::crypto::ElGamalDecrypt ( - msg->from ? i2p::context.GetLeaseSetPrivateKey () : i2p::context.GetPrivateKey (), + pool ? pool->GetEncryptionPrivateKey () : i2p::context.GetPrivateKey (), buf, (uint8_t *)&elGamal, true)) { uint8_t iv[32]; // IV is first 16 bytes