Browse Source

create LeaseSet encryption key per tunnel pool

pull/46/head
orignal 11 years ago
parent
commit
28042926e7
  1. 6
      Garlic.cpp

6
Garlic.cpp

@ -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…
Cancel
Save