mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-11 07:10:36 +00:00
decrypt frames correctly and set return address
This commit is contained in:
parent
dc3bb02f94
commit
9ee7275a02
@ -201,8 +201,9 @@ namespace llarp
|
||||
service::ProtocolMessage *msg)
|
||||
{
|
||||
EnsureReplyPath(msg->sender);
|
||||
|
||||
uint32_t themIP = ObtainIPForAddr(msg->sender.Addr());
|
||||
service::Address addr;
|
||||
msg->sender.CalculateAddress(addr.data());
|
||||
uint32_t themIP = ObtainIPForAddr(addr);
|
||||
uint32_t usIP = m_OurIP;
|
||||
auto buf = llarp::Buffer(msg->payload);
|
||||
if(m_NetworkToUserPktQueue.EmplaceIf(
|
||||
|
@ -155,9 +155,10 @@ namespace llarp
|
||||
const byte_t* sharedkey,
|
||||
ProtocolMessage& msg) const
|
||||
{
|
||||
msg.PutBuffer(D.Buffer());
|
||||
auto buf = llarp::Buffer(msg.payload);
|
||||
return crypto->xchacha20(buf, sharedkey, N);
|
||||
Encrypted tmp = D;
|
||||
auto buf = tmp.Buffer();
|
||||
crypto->xchacha20(*buf, sharedkey, N);
|
||||
return msg.BDecode(buf);
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
Reference in New Issue
Block a user