mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
multiple AES keys per local destination
This commit is contained in:
parent
93c1a0760d
commit
9150240a0d
2 changed files with 20 additions and 34 deletions
9
Garlic.h
9
Garlic.h
|
@ -7,6 +7,7 @@
|
|||
#include <string>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <memory>
|
||||
#include <cryptopp/osrng.h>
|
||||
#include "aes.h"
|
||||
#include "I2NPProtocol.h"
|
||||
|
@ -44,20 +45,20 @@ namespace garlic
|
|||
public:
|
||||
|
||||
GarlicDestination () {};
|
||||
~GarlicDestination ();
|
||||
~GarlicDestination () {};
|
||||
|
||||
void AddSessionKey (const uint8_t * key, const uint8_t * tag); // one tag
|
||||
void HandleGarlicMessage (I2NPMessage * msg);
|
||||
|
||||
private:
|
||||
|
||||
void HandleAESBlock (uint8_t * buf, size_t len, i2p::tunnel::InboundTunnel * from);
|
||||
void HandleAESBlock (uint8_t * buf, size_t len, std::shared_ptr<i2p::crypto::CBCDecryption> decryption,
|
||||
i2p::tunnel::InboundTunnel * from);
|
||||
void HandleGarlicPayload (uint8_t * buf, size_t len, i2p::tunnel::InboundTunnel * from);
|
||||
|
||||
private:
|
||||
|
||||
i2p::crypto::CBCDecryption m_Decryption;
|
||||
std::map<SessionTag, const uint8_t *> m_Tags; // tag->key, if null use key from decryption
|
||||
std::map<SessionTag, std::shared_ptr<i2p::crypto::CBCDecryption>> m_Tags;
|
||||
};
|
||||
|
||||
class GarlicRoutingSession
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue