mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-06-15 10:36:51 +02:00
handle garlic message
This commit is contained in:
parent
7f08f782e0
commit
6f1d4f4300
4 changed files with 128 additions and 1 deletions
13
Garlic.h
13
Garlic.h
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <inttypes.h>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <cryptopp/modes.h>
|
||||
#include <cryptopp/aes.h>
|
||||
|
@ -65,11 +66,23 @@ namespace garlic
|
|||
GarlicRouting ();
|
||||
~GarlicRouting ();
|
||||
|
||||
void HandleGarlicMessage (uint8_t * buf, size_t len);
|
||||
|
||||
I2NPMessage * WrapSingleMessage (const i2p::data::RoutingDestination * destination, I2NPMessage * msg);
|
||||
|
||||
private:
|
||||
|
||||
void HandleAESBlock (uint8_t * buf, size_t len);
|
||||
void HandleGarlicPayload (uint8_t * buf, size_t len);
|
||||
|
||||
private:
|
||||
|
||||
// outgoing sessions
|
||||
std::map<i2p::data::IdentHash, GarlicRoutingSession *> m_Sessions;
|
||||
// incoming session
|
||||
uint8_t m_SessionKey[32];
|
||||
std::set<std::string> m_SessionTags;
|
||||
CryptoPP::CBC_Mode<CryptoPP::AES>::Decryption m_Decryption;
|
||||
};
|
||||
|
||||
extern GarlicRouting routing;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue