Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* move rfb to its own package (split it from desktop server)
* allow shadow servers to provide rfb
* make send_disconnect() a protocol function, and just close the connection for rfb
* refactor auth code: keep auth classes in a dict
* refactor session sharing arbitration code so rfb can use it: handle_sharing()
* move handling of default packets (hello, disconnect, etc) to a non-ui thread, only call hello_oked() from the ui thread
* add "des" (implemented in d3des.py) to the list of digests we can handle - used by rfb only
* rfb now handles authentication using the regular authentication steps: challenge + verify
* protocol refactoring: provide queue utility functions separately, add docstrings, simplify start and end packet callbacks, split write function so subclasses can more easily override just what they need (ie: udp)
* fix some pydev warnings

git-svn-id: https://xpra.org/svn/Xpra/trunk@16712 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Aug 27, 2017
1 parent de918cf commit 344b95d
Show file tree
Hide file tree
Showing 15 changed files with 1,217 additions and 557 deletions.
4 changes: 3 additions & 1 deletion src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def is_RH():
from xpra.platform.features import LOCAL_SERVERS_SUPPORTED, SHADOW_SUPPORTED
shadow_ENABLED = SHADOW_SUPPORTED and not (PYTHON3 and LINUX) and DEFAULT #shadow servers use some GTK2 code..
server_ENABLED = (LOCAL_SERVERS_SUPPORTED or shadow_ENABLED) and not (PYTHON3 and LINUX) and DEFAULT
rfb_ENABLED = server_ENABLED
service_ENABLED = LINUX and server_ENABLED
sd_listen_ENABLED = POSIX and pkg_config_ok("--exists", "libsystemd")
proxy_ENABLED = DEFAULT
Expand Down Expand Up @@ -224,7 +225,7 @@ def is_RH():
"sound", "opengl", "printing", "webcam",
"rebuild",
"annotate", "warn", "strict",
"shadow", "proxy",
"shadow", "proxy", "rfb",
"debug", "PIC",
"Xdummy", "Xdummy_wrapper", "verbose", "tests", "bundle_tests"]
if WIN32:
Expand Down Expand Up @@ -1643,6 +1644,7 @@ def osx_pkgconfig(*pkgs_options, **ekw):
toggle_packages(dbus_ENABLED, "xpra.dbus")
toggle_packages(mdns_ENABLED, "xpra.net.mdns")
toggle_packages(server_ENABLED or proxy_ENABLED or shadow_ENABLED, "xpra.server", "xpra.server.auth")
toggle_packages(rfb_ENABLED, "xpra.server.rfb")
toggle_packages(proxy_ENABLED, "xpra.server.proxy")
toggle_packages(server_ENABLED, "xpra.server.window")
toggle_packages(server_ENABLED and shadow_ENABLED, "xpra.server.shadow")
Expand Down
19 changes: 17 additions & 2 deletions src/xpra/net/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ def validate_backend(try_backend):


def get_digests():
return ["hmac", "xor"] + ["hmac+%s" % x for x in list(reversed(sorted(hashlib.algorithms_available)))]
digests = ["hmac", "xor"] + ["hmac+%s" % x for x in list(reversed(sorted(hashlib.algorithms_available)))]
try:
from xpra.net import d3des
assert d3des
digests.append("des")
except:
pass
return digests

def get_digest_module(digest):
log("get_digest_module(%s)", digest)
Expand Down Expand Up @@ -121,11 +128,19 @@ def choose_digest(options):
return "hmac"
if "xor" in options:
return "xor"
if "des" in options:
return "des"
raise Exception("no known digest options found in '%s'" % csv(options))

def get_hexdigest(digest, password, salt):
assert digest and password and salt
if digest=="xor":
if digest=="des":
from xpra.net.d3des import generate_response
password = password.ljust(8, "\x00")[:8]
salt = salt.ljust(16, "\x00")[:16]
v = generate_response(password, salt)
return binascii.hexlify(v)
elif digest=="xor":
salt = salt.ljust(16, "\x00")[:len(password)]
v = memoryview_to_bytes(xor(password, salt))
return binascii.hexlify(v)
Expand Down
Loading

0 comments on commit 344b95d

Please sign in to comment.