From 0ed7a4bc3e3a1c7b881645542cddb95cf0ad8ba9 Mon Sep 17 00:00:00 2001 From: portersky Date: Sat, 29 Aug 2026 13:47:43 +0200 Subject: [PATCH] debug: trace GIP authentication headers Log incoming and outgoing authentication context, command, option, and length fields to isolate the handshake failure before input reports begin. Co-Authored-By: openai/gpt-5.6-luna: added authentication diagnostics --- src/auth/auth.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/auth/auth.cpp b/src/auth/auth.cpp index 65ebe6c..5ea66eb 100644 --- a/src/auth/auth.cpp +++ b/src/auth/auth.cpp @@ -157,6 +157,12 @@ auto auth::process_pkt(std::span data) -> int if (data.size() < sizeof(*hdr)) return -EINVAL; + log_msg(log_level::debug, + "auth: rx context=0x%02x options=0x%02x error=0x%02x " + "command=0x%02x length=%u", + hdr->context, hdr->options, hdr->error, hdr->command, + load_be16(&hdr->length)); + if (hdr->error) return -EPROTO; @@ -187,6 +193,9 @@ auto auth::send_pkt(u8 cmd, void const* pkt, std::size_t len) -> int store_be16(&hdr->data.length, static_cast(data_len - sizeof(hdr->data))); last_sent_command_ = cmd; + log_msg(log_level::debug, + "auth: tx command=0x%02x data_length=%u acknowledge=1", + cmd, data_len); transcript_.update( {reinterpret_cast(hdr) + sizeof(hdr->handshake), data_len}); @@ -204,6 +213,9 @@ auto auth::request_pkt(u8 cmd, std::uint16_t len) -> int req.header.command = cmd; store_be16(&req.header.length, data_len); + log_msg(log_level::debug, + "auth: tx request command=0x%02x data_length=%u acknowledge=1", + cmd, data_len); return sink_.send({reinterpret_cast(&req), sizeof(req)}, true); }