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
This commit is contained in:
@@ -157,6 +157,12 @@ auto auth::process_pkt(std::span<u8 const> data) -> int
|
|||||||
if (data.size() < sizeof(*hdr))
|
if (data.size() < sizeof(*hdr))
|
||||||
return -EINVAL;
|
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)
|
if (hdr->error)
|
||||||
return -EPROTO;
|
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<u16>(data_len - sizeof(hdr->data)));
|
store_be16(&hdr->data.length, static_cast<u16>(data_len - sizeof(hdr->data)));
|
||||||
|
|
||||||
last_sent_command_ = cmd;
|
last_sent_command_ = cmd;
|
||||||
|
log_msg(log_level::debug,
|
||||||
|
"auth: tx command=0x%02x data_length=%u acknowledge=1",
|
||||||
|
cmd, data_len);
|
||||||
transcript_.update(
|
transcript_.update(
|
||||||
{reinterpret_cast<u8 const*>(hdr) + sizeof(hdr->handshake), data_len});
|
{reinterpret_cast<u8 const*>(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;
|
req.header.command = cmd;
|
||||||
store_be16(&req.header.length, data_len);
|
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<u8 const*>(&req), sizeof(req)}, true);
|
return sink_.send({reinterpret_cast<u8 const*>(&req), sizeof(req)}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user