mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
fix vnc security type handshake for rfb version 3 (#172)
This commit is contained in:
parent
73f929b260
commit
5cc815cfa0
@ -261,11 +261,15 @@ class RfbClient(RfbClientStream): # pylint: disable=too-many-instance-attribute
|
|||||||
await self._write_reason("refusing security type reason", msg)
|
await self._write_reason("refusing security type reason", msg)
|
||||||
raise RfbError(msg)
|
raise RfbError(msg)
|
||||||
|
|
||||||
await self._write_struct("security types", "B" + "B" * len(sec_types), len(sec_types), *sec_types) # Keep dict priority
|
if self.__rfb_version > 3:
|
||||||
|
await self._write_struct("security types", "B" + "B" * len(sec_types), len(sec_types), *sec_types) # Keep dict priority
|
||||||
|
|
||||||
sec_type = await self._read_number("selected security type", "B")
|
sec_type = await self._read_number("selected security type", "B")
|
||||||
if sec_type not in sec_types:
|
if sec_type not in sec_types:
|
||||||
raise RfbError(f"Invalid security type: {sec_type}")
|
raise RfbError(f"Invalid security type: {sec_type}")
|
||||||
|
else:
|
||||||
|
sec_type = min(sec_types.keys())
|
||||||
|
await self._write_struct("selected security type", "L", sec_type)
|
||||||
|
|
||||||
(sec_name, handler) = sec_types[sec_type]
|
(sec_name, handler) = sec_types[sec_type]
|
||||||
get_logger(0).info("%s [main]: Using %s security type", self._remote, sec_name)
|
get_logger(0).info("%s [main]: Using %s security type", self._remote, sec_name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user