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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
This commit is contained in:
rustdesk
2026-09-22 17:43:38 +08:00
co-authored by Claude Fable 5.1
parent 5194159858
commit e74a188f4f
+10 -3
View File
@@ -237,9 +237,16 @@ message KeyExchange {
// From the server: the newest key exchange version it speaks. From the client: the version it // 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. // picked, the highest both speak. Absent, i.e. 0, is the original scheme.
uint32 version = 2; uint32 version = 2;
// Server signature of "rdkx-ver" || on-wire ephemeral public key || little-endian uint32 version. // Server signature of KxParams. Bit 255 of the signed X25519 public key requires this field;
// Bit 255 of the signed X25519 public key requires this field; legacy keys leave it clear. // legacy keys leave it clear.
bytes signed_version = 3; 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 { message HealthCheck {