mirror of
https://github.com/rustdesk/hbb_common.git
synced 2026-12-03 03:32:20 +00:00
Keep the client session while a signed hello replaces it
A client that re-signs its session dropped it first, so until the new welcome came back pushes under the old key could not open and a plaintext push was taken even from a server that seals every push. ClientSeal::hello builds a hello without touching the session; the welcome replaces it as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8
This commit is contained in:
1 parent
1462a4b17c
commit
94a6d132dc
1 file changed
+5
@@ -504,6 +504,11 @@ impl ClientSeal {
|
|||||||
s.next_pn += 1;
|
s.next_pn += 1;
|
||||||
return seal_data(&s.key, KIND_TO_SERVER, s.key_id, pn, payload);
|
return seal_data(&s.key, KIND_TO_SERVER, s.key_id, pn, payload);
|
||||||
}
|
}
|
||||||
|
self.hello(payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A fresh hello even under a session, which stays in use until the welcome replaces it.
|
||||||
|
pub fn hello(&mut self, payload: &[u8]) -> Option<Vec<u8>> {
|
||||||
let now = SystemTime::now()
|
let now = SystemTime::now()
|
||||||
.duration_since(UNIX_EPOCH)
|
.duration_since(UNIX_EPOCH)
|
||||||
.map_or(0, |d| d.as_millis() as u64);
|
.map_or(0, |d| d.as_millis() as u64);
|
||||||
|
|||||||
Reference in new issue
Block a user