From cc89bfef6e0893619bf5032cec6ac0e7dcb7b0e0 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 7 Oct 2025 21:31:40 -0500 Subject: [PATCH] Update destination hash calculation in handleAnnouncePacket to use SHA256. --- pkg/transport/transport.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/transport/transport.go b/pkg/transport/transport.go index a775375..87e7831 100644 --- a/pkg/transport/transport.go +++ b/pkg/transport/transport.go @@ -784,9 +784,10 @@ func (t *Transport) handleAnnouncePacket(data []byte, iface common.NetworkInterf // Check if this passes full RNS validation (signature + destination hash check) hashMaterial := make([]byte, 0) - hashMaterial = append(hashMaterial, nameHash...) - hashMaterial = append(hashMaterial, id.Hash()...) - expectedHash := identity.TruncatedHash(hashMaterial) + hashMaterial = append(hashMaterial, nameHash...) // Name hash (10 bytes) first + hashMaterial = append(hashMaterial, id.Hash()...) // Identity hash (16 bytes) second + expectedHashFull := sha256.Sum256(hashMaterial) + expectedHash := expectedHashFull[:16] log.Printf("[DEBUG-3] Destination hash from packet: %x", destinationHash) log.Printf("[DEBUG-3] Expected destination hash: %x", expectedHash)