|
|
@ -1,5 +1,5 @@ |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2013-2020, The PurpleI2P Project |
|
|
|
* Copyright (c) 2013-2021, The PurpleI2P Project |
|
|
|
* |
|
|
|
* |
|
|
|
* This file is part of Purple i2pd project and licensed under BSD3 |
|
|
|
* This file is part of Purple i2pd project and licensed under BSD3 |
|
|
|
* |
|
|
|
* |
|
|
@ -69,20 +69,20 @@ namespace tunnel |
|
|
|
{ |
|
|
|
{ |
|
|
|
LongECIESTunnelHopConfig (std::shared_ptr<const i2p::data::IdentityEx> r): |
|
|
|
LongECIESTunnelHopConfig (std::shared_ptr<const i2p::data::IdentityEx> r): |
|
|
|
ECIESTunnelHopConfig (r) {}; |
|
|
|
ECIESTunnelHopConfig (r) {}; |
|
|
|
uint8_t GetRetCode (const uint8_t * records) const |
|
|
|
uint8_t GetRetCode (const uint8_t * records) const override |
|
|
|
{ return (records + recordIndex*TUNNEL_BUILD_RECORD_SIZE)[ECIES_BUILD_RESPONSE_RECORD_RET_OFFSET]; }; |
|
|
|
{ return (records + recordIndex*TUNNEL_BUILD_RECORD_SIZE)[ECIES_BUILD_RESPONSE_RECORD_RET_OFFSET]; }; |
|
|
|
void CreateBuildRequestRecord (uint8_t * records, uint32_t replyMsgID); |
|
|
|
void CreateBuildRequestRecord (uint8_t * records, uint32_t replyMsgID) override; |
|
|
|
bool DecryptBuildResponseRecord (uint8_t * records) const; |
|
|
|
bool DecryptBuildResponseRecord (uint8_t * records) const override; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
struct ShortECIESTunnelHopConfig: public ECIESTunnelHopConfig |
|
|
|
struct ShortECIESTunnelHopConfig: public ECIESTunnelHopConfig |
|
|
|
{ |
|
|
|
{ |
|
|
|
ShortECIESTunnelHopConfig (std::shared_ptr<const i2p::data::IdentityEx> r): |
|
|
|
ShortECIESTunnelHopConfig (std::shared_ptr<const i2p::data::IdentityEx> r): |
|
|
|
ECIESTunnelHopConfig (r) {}; |
|
|
|
ECIESTunnelHopConfig (r) {}; |
|
|
|
uint8_t GetRetCode (const uint8_t * records) const |
|
|
|
uint8_t GetRetCode (const uint8_t * records) const override |
|
|
|
{ return (records + recordIndex*SHORT_TUNNEL_BUILD_RECORD_SIZE)[SHORT_RESPONSE_RECORD_RET_OFFSET]; }; |
|
|
|
{ return (records + recordIndex*SHORT_TUNNEL_BUILD_RECORD_SIZE)[SHORT_RESPONSE_RECORD_RET_OFFSET]; }; |
|
|
|
void CreateBuildRequestRecord (uint8_t * records, uint32_t replyMsgID); |
|
|
|
void CreateBuildRequestRecord (uint8_t * records, uint32_t replyMsgID) override; |
|
|
|
bool DecryptBuildResponseRecord (uint8_t * records) const; |
|
|
|
bool DecryptBuildResponseRecord (uint8_t * records) const override; |
|
|
|
void DecryptRecord (uint8_t * records, int index) const override; // Chacha20
|
|
|
|
void DecryptRecord (uint8_t * records, int index) const override; // Chacha20
|
|
|
|
uint64_t GetGarlicKey (uint8_t * key) const override; |
|
|
|
uint64_t GetGarlicKey (uint8_t * key) const override; |
|
|
|
}; |
|
|
|
}; |
|
|
|