From 26582e163d7bb581d00f02094c68a739d01e157a Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 22 Sep 2026 17:59:11 +0800 Subject: [PATCH] tcp: KX_PARAMS_DOMAIN, the prefix under which KxParams is signed The server signs its ephemeral key, IdPk records and KxParams with one key, and a protobuf carries no type of its own: a signed IdPk parses as a KxParams whose pk is the id and whose version is 0. The prefix keeps the three apart; the client requires it before parsing. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns --- src/tcp.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tcp.rs b/src/tcp.rs index d04ed1e66..35d22d639 100644 --- a/src/tcp.rs +++ b/src/tcp.rs @@ -30,6 +30,10 @@ pub struct DynTcpStream(pub Box); /// the handshake transcript into both, and keeps the nonce layout. pub const KX_VERSION_LATEST: u32 = 1; +/// Prefix of what the server signs as `KxParams`. The same key signs other messages, and a +/// protobuf carries no type of its own, so the prefix is what keeps them apart. +pub const KX_PARAMS_DOMAIN: &[u8] = b"rdkx-params"; + /// The version to run against a peer that advertised `advertised`: the highest both sides /// support. #[inline]