From 8e2a8a913d6cc1602e5db5ce80c452b09fa20590 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Mon, 10 Nov 2025 01:49:50 -0500 Subject: [PATCH] fix: update NETWORK_PROTOCOL_INVESTIGATION to reflect HMAC verification deadlock and connection persistence issues --- docs/NETWORK_PROTOCOL_INVESTIGATION.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/NETWORK_PROTOCOL_INVESTIGATION.md b/docs/NETWORK_PROTOCOL_INVESTIGATION.md index 1783c45..2b7eeb5 100644 --- a/docs/NETWORK_PROTOCOL_INVESTIGATION.md +++ b/docs/NETWORK_PROTOCOL_INVESTIGATION.md @@ -2,22 +2,27 @@ ## Current Status (Nov 10, 2025) -**✅ CONNECTION PERSISTENCE ISSUE RESOLVED!** +**⚠️ HMAC VERIFICATION DEADLOCK - SERVER CONFIGURATION ISSUE** ### Working ✅ - **DomainConnectRequest packet format** - Matches official Overte client implementation - **Connection established** - Server responds with DomainList packet -- **Local ID assignment** - Server assigns a valid Local ID -- **Local ID parsing** - Fixed byte order bug (was using ntohs() on little-endian data) +- **Local ID assignment** - Server assigns a valid Local ID correctly +- **Local ID parsing** - Fixed to read little-endian uint16 at correct offset (bytes 34-35) - **Symmetric socket creation** - Server creates correct socket to our actual address - **Packet version negotiation** - Using correct version 27 (DomainConnectRequest_SocketTypes) - **Protocol signature** - MD5 hash `eb1600e798dc5e03c755a968dc16b7fc` matches server - **Packet structure** - All fields properly ordered and serialized per Qt QDataStream format -- **Source ID handling** - Little-endian uint16, correctly set on sourced packets -- **Connection persistence** - Connection now stays alive indefinitely with correct Local ID ✅ -- **Activity tracking** - Server recognizes our sourced packets (Ping, AvatarData) and updates lastHeardMicrostamp ✅ +- **Source ID handling** - Little-endian uint16 at offset 6-7 in sourced packet header +- **HMAC-MD5 implementation** - Correctly calculates hash using OpenSSL with null UUID as key +- **Packet hash insertion** - Properly reserves 16-byte slot and moves payload -### Root Cause of Connection Persistence Bug (FIXED) +### Not Working / Blocked ❌ +- **Connection persistence** - Still killed after 11-18 seconds as "silent node" +- **HMAC verification** - Server rejects all sourced packets due to hash mismatch +- **Keep-alive mechanism** - Cannot send valid Ping packets that server will accept + +### Root Cause: HMAC Verification Deadlock (UNSOLVED) The connection was being killed after 16 seconds because the server couldn't match our sourced packets to our node.