mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
reverted sequence of hash and tunnelID
This commit is contained in:
parent
bc9b355d5d
commit
0d9cc12521
10
Garlic.cpp
10
Garlic.cpp
@ -163,10 +163,11 @@ namespace garlic
|
|||||||
{
|
{
|
||||||
buf[size] = eGarlicDeliveryTypeTunnel << 5; // delivery instructions flag tunnel
|
buf[size] = eGarlicDeliveryTypeTunnel << 5; // delivery instructions flag tunnel
|
||||||
size++;
|
size++;
|
||||||
*(uint32_t *)(buf + size) = htobe32 (tunnel->GetNextTunnelID ()); // tunnelID
|
// hash and tunnelID sequence is reversed for Garlic
|
||||||
size += 4;
|
|
||||||
memcpy (buf + size, tunnel->GetNextIdentHash (), 32); // To Hash
|
memcpy (buf + size, tunnel->GetNextIdentHash (), 32); // To Hash
|
||||||
size += 32;
|
size += 32;
|
||||||
|
*(uint32_t *)(buf + size) = htobe32 (tunnel->GetNextTunnelID ()); // tunnelID
|
||||||
|
size += 4;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -330,10 +331,11 @@ namespace garlic
|
|||||||
case eGarlicDeliveryTypeTunnel:
|
case eGarlicDeliveryTypeTunnel:
|
||||||
{
|
{
|
||||||
LogPrint ("Garlic type tunnel");
|
LogPrint ("Garlic type tunnel");
|
||||||
uint32_t gwTunnel = be32toh (*(uint32_t *)buf);
|
// gwHash and gwTunnel sequence is reverted
|
||||||
buf += 4;
|
|
||||||
uint8_t * gwHash = buf;
|
uint8_t * gwHash = buf;
|
||||||
buf += 32;
|
buf += 32;
|
||||||
|
uint32_t gwTunnel = be32toh (*(uint32_t *)buf);
|
||||||
|
buf += 4;
|
||||||
auto tunnel = i2p::tunnel::tunnels.GetNextOutboundTunnel ();
|
auto tunnel = i2p::tunnel::tunnels.GetNextOutboundTunnel ();
|
||||||
if (tunnel) // we have send it through an outbound tunnel
|
if (tunnel) // we have send it through an outbound tunnel
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user