From 0d9cc12521caaa353088d40abd802d45d2fcace0 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 16 Jan 2014 18:21:44 -0500 Subject: [PATCH] reverted sequence of hash and tunnelID --- Garlic.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Garlic.cpp b/Garlic.cpp index d66e4eb3..6a4230eb 100644 --- a/Garlic.cpp +++ b/Garlic.cpp @@ -163,10 +163,11 @@ namespace garlic { buf[size] = eGarlicDeliveryTypeTunnel << 5; // delivery instructions flag tunnel size++; - *(uint32_t *)(buf + size) = htobe32 (tunnel->GetNextTunnelID ()); // tunnelID - size += 4; + // hash and tunnelID sequence is reversed for Garlic memcpy (buf + size, tunnel->GetNextIdentHash (), 32); // To Hash size += 32; + *(uint32_t *)(buf + size) = htobe32 (tunnel->GetNextTunnelID ()); // tunnelID + size += 4; } else { @@ -330,10 +331,11 @@ namespace garlic case eGarlicDeliveryTypeTunnel: { LogPrint ("Garlic type tunnel"); - uint32_t gwTunnel = be32toh (*(uint32_t *)buf); - buf += 4; + // gwHash and gwTunnel sequence is reverted uint8_t * gwHash = buf; buf += 32; + uint32_t gwTunnel = be32toh (*(uint32_t *)buf); + buf += 4; auto tunnel = i2p::tunnel::tunnels.GetNextOutboundTunnel (); if (tunnel) // we have send it through an outbound tunnel {