Commit Graph
490 Commits
Author SHA1 Message Date
rustdesk a6a1a0cd37 test: initialize isolated app names without production overrides 2026-11-15 08:50:08 +08:00
rustdesk f7842eb3e8 test: isolate unit-test configuration paths 2026-11-14 19:55:04 +08:00
RustDesk bb416bc94e Merge pull request #634 from fufesou/fix/tcp-websocket-error-propagation
fix: preserve TCP and WebSocket error causes
2026-11-10 16:59:32 +08:00
fufesou 450cc1d7b7 fix: preserve TCP and WebSocket error causes
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-09 19:11:51 -08:00
RustDesk fae47e024d Merge pull request #619 from fufesou/fix/trusted-device-v2
Add trusted-device storage with atomic legacy migration
2026-10-28 10:43:54 +08:00
RustDesk af4aa80adc Merge pull request #628 from jahvari/codex/fix-udp-send-recovery-upstream
Recover direct UDP sends after a failed datagram
2026-10-28 09:06:16 +08:00
jahvari 73633529f1 Document changed function contracts 2026-10-27 10:23:37 -05:00
jahvari 4db65ced52 Keep direct UDP send failures from poisoning later datagrams 2026-10-26 13:11:38 -05:00
fufesou 3ee3afd438 Serialize peer deletion with credential writes
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-26 15:22:00 +08:00
fufesou f15eb3d40d Merge branch 'main' into fix/trusted-device-v2 2026-10-25 18:07:47 +08:00
RustDesk edefa08b79 Merge pull request #626 from rustdesk/custom-websocket-port
feat(websocket): add websocket-port for a proxy off the default port
2026-10-22 17:52:30 +08:00
rustdeskandClaude Opus 5.5 dfb9d0d1c6 fix(websocket): match websocket-port only against configured servers
websocket_port() took the rendezvous host from get_rendezvous_server(),
which falls back to a cached or public server when none is set. With
only relay-server and websocket-port set, the public rendezvous server
also got the port, and registration failed. Match the servers this
client is set up with instead: the exe-name host, custom-rendezvous-server,
the build-time server, and relay-server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 17:28:28 +08:00
rustdeskandClaude Opus 5.5 b3bf7b76e2 fix(websocket): throttle the invalid websocket-port warning
check_ws runs on every rendezvous reconnect, online query and relay
connect, so an invalid websocket-port logged a warning each time.
Keep one line a minute with a count of the rest. Also import the key
with the other config keys instead of in the function body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 17:04:26 +08:00
fufesou cef0aedf40 Keep trusted-device credentials in configuration sync snapshots
Refresh cached trust fields after successful credential writes and provide explicit persisted credential synchronization. Ordinary settings saves continue to preserve the destination credentials.

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-22 16:25:27 +08:00
rustdeskandClaude Opus 5.5 34846eef9f feat(websocket): add websocket-port for a proxy off the default port
check_ws turns a domain endpoint into ws(s)://<domain>/ws/id or
/ws/relay with no port, so a reverse proxy that cannot take 443 (or 80)
is unreachable, even when api-server already points at it, for example
https://example.com:8443.

websocket-port adds that port for the hosts this client is configured
with: custom-rendezvous-server and relay-server. A relay that hbbs hands
out on another host, or a peer's server, keeps the default port, since
another machine has its own proxy. IP endpoints are unchanged, and an
empty option gives the same URL as before.

https://github.com/rustdesk/rustdesk-server-pro/discussions/1029

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:05:24 +08:00
fufesou 41d50c4052 Remove unused trusted-device import stripping helper
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-21 23:07:40 +08:00
fufesou 77f924d7a3 fix: support atomic legacy trusted-device migration
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-20 23:24:04 +08:00
RustDesk ed07431021 Merge pull request #620 from 21pages/suppress_log
fix: reduce noisy smithay client toolkit logs
2026-10-20 16:50:15 +08:00
fufesou 040bf3f662 refactor: remove unused legacy trusted-device detector
The V2 management UI no longer displays legacy enrollment metadata. Remove the unused presence helper while preserving legacy records during ordinary saves.

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-20 16:11:45 +08:00
fufesou e2b17fd06c fix: recover config saves while preserving valid legacy trust
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-19 01:21:02 -07:00
fufesou e4f0e8fa9b Merge branch 'main' into fix/trusted-device-v2 2026-10-18 20:45:59 -07:00
fufesou 2289227c5f fix: preserve legacy trust data and validate V2 storage
Retain legacy trusted-device records for migration without using them for authentication. Preserve malformed V2 values for strict validation while allowing explicit revocation to replace them.

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-16 05:21:07 -07:00
21pages 20d5019a42 fix: reduce noisy smithay client toolkit logs 2026-10-16 17:35:46 +08:00
RustDesk 5d52530b63 Merge pull request #609 from AzimovIz/remoteUSB
Add REMOTE_USB connection type
2026-10-14 20:51:07 +08:00
RustDesk a63c5b2301 Merge pull request #600 from 21pages/websocket-proxy
websocket proxy support
2026-10-14 20:50:15 +08:00
21pages 423fb71085 fix: return local address for direct WebSocket connections 2026-10-14 20:04:48 +08:00
fufesou dcc0381b7b fix: preserve trusted credentials when configuration reads fail
Stop ordinary Config2 and peer settings saves when the current file cannot be read. Keep first-save behavior for missing files and log failures without replacing V2 records with defaults.

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-14 02:21:27 -07:00
fufesou c11a5971a3 fix: minimize trusted-device configuration save changes
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-13 18:48:53 -07:00
fufesou 8791bf0d33 fix: simplify trusted-device configuration storage
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-13 18:18:38 -07:00
21pages 0ccaaf2cf6 fix: parse IPv6 HTTP proxy authorities correctly 2026-10-13 18:58:42 +08:00
fufesou a2df328d0b fix: preserve trusted-device grants in Config2
Add fallible grant persistence with file locking and atomic replacement. Preserve the persisted grant state during ordinary settings writes so stale configuration snapshots cannot restore revoked devices.

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-12 21:59:19 -07:00
21pages 2d998e7b02 fix: reuse the initial TCP connection for HTTPS proxies 2026-10-13 11:51:29 +08:00
21pages 4c04a7a130 fix: allow proxy reads while flushing is pending 2026-10-13 11:51:29 +08:00
21pages 19b8b2242d fix: always use configured proxy for WebSocket 2026-10-12 18:58:03 +08:00
21pages 9ee2f3ef9a fix: bracket IPv6 targets in HTTP CONNECT requests 2026-10-10 19:45:51 +08:00
21pages 3aade011c0 feat: add opt-in WebSocket proxy support
Support WS and WSS over SOCKS5, HTTP, and HTTPS proxies, including custom
ports. Use the configured proxy only when allow-websocket-proxy is enabled;
explicit proxy configuration takes precedence. Propagate proxy failures
without retrying a direct connection.

Add regression coverage for proxy routing, authentication, TLS, custom
ports, direct defaults, and failure handling.

Signed-off-by: 21pages <sunboeasy@gmail.com>

fix: flush WebSocket proxy tunnels before native TLS reads

Flush buffered HTTP and HTTPS tunnel writes before NativeTls reads so WSS handshakes can complete on macOS. Apply the adapter only to NativeTls WebSocket connections through HTTP or HTTPS proxies.

Extend the existing proxy round-trip test with HTTPS and SOCKS5 NativeTls cases. The websocket_proxy integration test passes in the rustdesk workspace.

Signed-off-by: 21pages <sunboeasy@gmail.com>

refactor: simplify WebSocket proxy configuration

Select the configured proxy inside WsFramedStream::new based on the WebSocket proxy option and remove the explicit proxy argument. Update the socket client and drop the unused Stream::connect_websocket wrapper.

Adapt integration tests to configured proxies and cover custom target ports and WebSocket close handling.
2026-10-10 11:50:09 +08:00
AzimovIzandClaude Opus 5.5 b4be9744bf Drop the REMOTE_USB connection type
USB forwarding now runs inside a normal remote desktop session
(rustdesk/rustdesk#16278), so it needs no connection type of its own. Only
ControlPermissions.Permission.usb remains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: AzimovIz <sergo.p.987@gmail.com>
2026-10-09 13:44:15 +00:00
AzimovIzandClaude Opus 5.5 bee7c2458c Add REMOTE_USB connection type and usb control permission
Adds ConnType::REMOTE_USB for the RemoteUsb feature (rustdesk/rustdesk#16278),
following the same pattern as TERMINAL, and ControlPermissions.Permission.usb
so USB forwarding can be controlled centrally like the other permissions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: AzimovIz <sergo.p.987@gmail.com>
2026-09-26 13:12:59 +00:00
rustdeskandClaude Opus 5.5 94ec710894 Build the webrtc feature standalone against the rustdesk-org fork
src/webrtc.rs calls fork-only APIs (set_ice_max_binding_requests,
set_no_congestion_control), which only rustdesk's root [patch] supplied,
so building this crate on its own with --features webrtc failed with
E0425/E0599. Mirror the root patch here; it applies only when this crate
is the root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
2026-09-25 16:30:59 +08:00
RustDesk 229b904508 Merge pull request #614 from rustdesk/kx-v2
Kx v2
2026-09-23 14:48:27 +08:00
rustdeskandClaude Fable 5.1 42c77b9a3b tcp: pin the subkeys for an advertisement above the pick
With advertised and picked both 1, swapping their order in the
derivation leaves the vector unchanged. Advertised 3 with picked 1 is
what a client meets at a newer server, and tells the two apart.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
2026-09-23 14:27:51 +08:00
rustdeskandClaude Opus 5.5 2849258460 tcp: pin the version 0 frame and the version 1 subkeys
The existing tests run both ends on the same code, so they pass even
if the derivation changes. Fixed bytes catch that: the version 0 frame
released peers send, and the same subkey vector hbbs's copy of this
code pins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
2026-09-23 13:20:36 +08:00
rustdeskandClaude Opus 5.5 cee8cf3dc3 stream: refuse a key exchange version set_negotiated_key does not know
Version 1 is matched explicitly and any other picked version is an
error, so adding a version without its arm here fails instead of
running as version 1. WebRTC takes only version 0, as both handshakes
already require.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
2026-09-23 13:20:36 +08:00
rustdeskandClaude Opus 5.5 cbc8772d4a stream: set_negotiated_key, one place that maps the picked version to a key
Every handshake picked a version and then repeated the same choice: at
least 1 splits the key, 0 sets it as before. Stream now makes that choice
from the transcript it is already given, so callers make one call and a
later version is handled here rather than at each of them. Version 0
still goes through set_key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
2026-09-23 09:53:34 +08:00
rustdeskandClaude Fable 5.1 26582e163d 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
2026-09-22 17:59:11 +08:00
rustdeskandClaude Fable 5.1 e74a188f4f 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
2026-09-22 17:43:38 +08:00
rustdeskandClaude Fable 5.1 5194159858 kx: drop the advertisement echo
signed_version settles the server's version inside the key exchange, so
an echo of it on the messages after has nothing left to confirm. With it
go RendezvousMessage.kx_advertised, the check the transport ran on each
decrypted frame, and the tests of both.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
2026-09-22 17:22:01 +08:00
rustdeskandClaude Fable 5.1 e3452acf59 kx: comments say what the fields and functions are
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
2026-09-22 15:02:44 +08:00
rustdeskandClaude Fable 5.1 d9f519e915 KeyExchange: signed_version, the server's signature over its version
The echo catches an advertisement lowered in the clear only once a tagged
frame arrives, so the initiator's first frame has already gone out under
the lower version by then. A server that signs its version instead sets
bit 255 of the ephemeral X25519 key inside the signed keys[0] and puts
sign("rdkx-ver" || key || version LE) here. RFC 7748 masks that bit, so
the box opens as before on either side, and a legacy server, whose keys
are canonical, never sets it. A client that sees the bit, or the field,
verifies before trusting the version, so the pair settles it at the
handshake rather than one frame pair later.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
2026-09-22 13:18:45 +08:00
rustdeskandClaude Fable 5.1 1266b56150 kx_advertised: every message after the exchange, not the first alone
The contract named the server's first message after the key exchange. That
frame sits at a position an attacker needs no key to find, so one who had
lowered the advertisement in the clear only had to drop it to be rid of
the check for the whole session. With every message carrying the echo,
being rid of it means dropping them all, which is a plain DoS.

The client already kept the check armed until an echo arrived; this is the
wording the server side is written to.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab
2026-09-21 18:33:33 +08:00