mirror of
https://github.com/rustdesk/hbb_common.git
synced 2026-10-25 21:50:07 +00:00
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
This commit is contained in:
1 parent
e74a188f4f
commit
26582e163d
1 file changed
+4
@@ -30,6 +30,10 @@ pub struct DynTcpStream(pub Box<dyn TcpStreamTrait + Send + Sync>);
|
|||||||
/// the handshake transcript into both, and keeps the nonce layout.
|
/// the handshake transcript into both, and keeps the nonce layout.
|
||||||
pub const KX_VERSION_LATEST: u32 = 1;
|
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
|
/// The version to run against a peer that advertised `advertised`: the highest both sides
|
||||||
/// support.
|
/// support.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|||||||
Reference in new issue
Block a user