From e74a188f4fa13e78f8ff0c51383d758f8a62ab59 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 22 Sep 2026 17:43:38 +0800 Subject: [PATCH] KeyExchange: sign KxParams, a structure, in place of a fixed byte string The server's second signature covered "rdkx-ver" || key || version, a layout that could take nothing more. It now covers KxParams, a message holding the key as it went out and the advertised version, so anything the server needs signed later is a field added to it, and a client that does not know a field parses past it, as with IdPk on the peer side. Field 3 keeps its number under the name signed_params. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns --- protos/rendezvous.proto | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/protos/rendezvous.proto b/protos/rendezvous.proto index b1e405f94..3cee04e2e 100644 --- a/protos/rendezvous.proto +++ b/protos/rendezvous.proto @@ -237,9 +237,16 @@ message KeyExchange { // From the server: the newest key exchange version it speaks. From the client: the version it // picked, the highest both speak. Absent, i.e. 0, is the original scheme. uint32 version = 2; - // Server signature of "rdkx-ver" || on-wire ephemeral public key || little-endian uint32 version. - // Bit 255 of the signed X25519 public key requires this field; legacy keys leave it clear. - bytes signed_version = 3; + // Server signature of KxParams. Bit 255 of the signed X25519 public key requires this field; + // legacy keys leave it clear. + bytes signed_params = 3; +} + +// Signed by the server beside its ephemeral public key: that key as it went out, so the signature +// belongs to this exchange alone, and the newest key exchange version the server speaks. +message KxParams { + bytes pk = 1; + uint32 version = 2; } message HealthCheck {