def make_hello(self, challenge_response=None): capabilities = {} add_version_info(capabilities) if challenge_response: capabilities["challenge_response"] = challenge_response if self.encoding: capabilities["encoding"] = self.encoding capabilities["encodings"] = ENCODINGS if self.quality >= 0: capabilities["jpeg"] = self.quality capabilities["quality"] = self.quality capabilities["platform"] = sys.platform capabilities["client_type"] = "Python/Gobject" capabilities["raw_packets"] = True capabilities["chunked_compression"] = True capabilities["rencode"] = has_rencode capabilities["server-window-resize"] = True u = hashlib.sha512() u.update(str(get_machine_id())) if os.name == "posix": u.update("/") u.update(str(os.getuid())) u.update("/") u.update(str(os.getgid())) capabilities["uuid"] = u.hexdigest() capabilities["randr_notify"] = False #only client.py cares about this capabilities["windows"] = False #only client.py cares about this return capabilities
def make_hello(self, challenge_response=None): capabilities = {} add_version_info(capabilities) if challenge_response: capabilities["challenge_response"] = challenge_response if self.encoding: capabilities["encoding"] = self.encoding capabilities["encodings"] = ENCODINGS if self.quality>=0: capabilities["jpeg"] = self.quality capabilities["quality"] = self.quality capabilities["platform"] = sys.platform capabilities["client_type"] = "Python/Gobject" capabilities["raw_packets"] = True capabilities["chunked_compression"] = True capabilities["rencode"] = has_rencode capabilities["server-window-resize"] = True u = hashlib.sha512() u.update(str(get_machine_id())) if os.name=="posix": u.update("/") u.update(str(os.getuid())) u.update("/") u.update(str(os.getgid())) capabilities["uuid"] = u.hexdigest() capabilities["randr_notify"] = False #only client.py cares about this capabilities["windows"] = False #only client.py cares about this return capabilities
def make_hello(self, challenge_response=None): capabilities = {} add_version_info(capabilities) if challenge_response: assert self.password capabilities["challenge_response"] = challenge_response if self.encryption: assert self.encryption in ENCRYPTION_CIPHERS capabilities["cipher"] = self.encryption iv = get_hex_uuid()[:16] capabilities["cipher.iv"] = iv key_salt = get_hex_uuid() capabilities["cipher.key_salt"] = key_salt iterations = 1000 capabilities["cipher.key_stretch_iterations"] = iterations self._protocol.set_cipher_in(self.encryption, iv, self.get_password(), key_salt, iterations) log("encryption capabilities: %s", [(k,v) for k,v in capabilities.items() if k.startswith("cipher")]) if self.encoding: capabilities["encoding"] = self.encoding capabilities["encodings"] = ENCODINGS if self.quality>0: capabilities["jpeg"] = self.quality capabilities["quality"] = self.quality capabilities["encoding.quality"] = self.quality if self.min_quality>0: capabilities["encoding.min-quality"] = self.min_quality if self.speed>=0: capabilities["speed"] = self.speed capabilities["encoding.speed"] = self.speed if self.min_speed>=0: capabilities["encoding.min-speed"] = self.min_speed log("encoding capabilities: %s", [(k,v) for k,v in capabilities.items() if k.startswith("encoding")]) capabilities["platform"] = sys.platform capabilities["platform.release"] = python_platform.release() capabilities["platform.machine"] = python_platform.machine() capabilities["platform.processor"] = python_platform.processor() capabilities["client_type"] = "Python/Gobject" capabilities["raw_packets"] = True capabilities["chunked_compression"] = True capabilities["rencode"] = has_rencode if has_rencode: capabilities["rencode.version"] = rencode_version capabilities["server-window-resize"] = True capabilities["hostname"] = socket.gethostname() capabilities["uuid"] = self.uuid capabilities["randr_notify"] = False #only client.py cares about this capabilities["windows"] = False #only client.py cares about this if self._reverse_aliases: capabilities["aliases"] = self._reverse_aliases return capabilities
def make_hello(self, challenge_response=None): capabilities = {} add_version_info(capabilities) capabilities["python.version"] = sys.version_info[:3] if challenge_response: assert self.password capabilities["challenge_response"] = challenge_response if self.encryption: assert self.encryption in ENCRYPTION_CIPHERS capabilities["cipher"] = self.encryption iv = get_hex_uuid()[:16] capabilities["cipher.iv"] = iv key_salt = get_hex_uuid() capabilities["cipher.key_salt"] = key_salt iterations = 1000 capabilities["cipher.key_stretch_iterations"] = iterations self._protocol.set_cipher_in(self.encryption, iv, self.get_password(), key_salt, iterations) log("encryption capabilities: %s", [(k, v) for k, v in capabilities.items() if k.startswith("cipher")]) capabilities["platform"] = sys.platform capabilities["platform.release"] = python_platform.release() capabilities["platform.machine"] = python_platform.machine() capabilities["platform.processor"] = python_platform.processor() capabilities["client_type"] = self.client_type() capabilities["namespace"] = True capabilities["raw_packets"] = True capabilities["chunked_compression"] = True capabilities["bencode"] = True capabilities["rencode"] = has_rencode if has_rencode: capabilities["rencode.version"] = rencode_version capabilities["hostname"] = socket.gethostname() capabilities["uuid"] = self.uuid try: from xpra.platform.info import get_username, get_name capabilities["username"] = get_username() capabilities["name"] = get_name() except: log.error("failed to get username/name", exc_info=True) capabilities["randr_notify"] = False #only client.py cares about this capabilities["windows"] = False #only client.py cares about this if self._reverse_aliases: capabilities["aliases"] = self._reverse_aliases return capabilities
def make_hello(self, challenge_response=None): capabilities = {} add_version_info(capabilities) if challenge_response: capabilities["challenge_response"] = challenge_response if self.encoding: capabilities["encoding"] = self.encoding capabilities["encodings"] = ENCODINGS if self.jpegquality: capabilities["jpeg"] = self.jpegquality capabilities["platform"] = sys.platform capabilities["raw_packets"] = True capabilities["chunked_compression"] = True capabilities["rencode"] = has_rencode capabilities["server-window-resize"] = True capabilities["randr_notify"] = False #only client.py cares about this return capabilities
def get_server_info(prefix=""): #this function is for non UI thread info info = { prefix + "pid": os.getpid(), prefix + "byteorder": sys.byteorder, prefix + "hostname": socket.gethostname(), prefix + "python.full_version": sys.version, prefix + "python.version": sys.version_info[:3], } for x in ("uid", "gid"): if hasattr(os, "get%s" % x): try: info[prefix + x] = getattr(os, "get%s" % x)() except: pass info.update(get_platform_info(prefix)) add_version_info(info, prefix) return info
def get_server_info(prefix=""): #this function is for non UI thread info info = { prefix+"pid" : os.getpid(), prefix+"byteorder" : sys.byteorder, prefix+"hostname" : socket.gethostname(), prefix+"python.full_version": sys.version, prefix+"python.version" : sys.version_info[:3], } for x in ("uid", "gid"): if hasattr(os, "get%s" % x): try: info[prefix+x] = getattr(os, "get%s" % x)() except: pass info.update(get_platform_info(prefix)) add_version_info(info, prefix) return info
def make_hello_base(self): capabilities = get_network_caps() capabilities.update({ "encoding.generic": True, "namespace": True, "hostname": socket.gethostname(), "uuid": self.uuid, "username": self.username, "name": get_name(), "client_type": self.client_type(), "python.version": sys.version_info[:3], "compression_level": self.compression_level, }) if self.display: capabilities["display"] = self.display capabilities.update(get_platform_info()) add_version_info(capabilities) mid = get_machine_id() if mid: capabilities["machine_id"] = mid if self.encryption: assert self.encryption in ENCRYPTION_CIPHERS iv = get_hex_uuid()[:16] key_salt = get_hex_uuid() + get_hex_uuid() iterations = 1000 capabilities.update({ "cipher": self.encryption, "cipher.iv": iv, "cipher.key_salt": key_salt, "cipher.key_stretch_iterations": iterations, }) key = self.get_encryption_key() if key is None: self.warn_and_quit(EXIT_ENCRYPTION, "encryption key is missing") return self._protocol.set_cipher_in(self.encryption, iv, key, key_salt, iterations) log("encryption capabilities: %s", [(k, v) for k, v in capabilities.items() if k.startswith("cipher")]) return capabilities
def make_hello(self, challenge_response=None): capabilities = {} add_version_info(capabilities) capabilities["python.version"] = sys.version_info[:3] if challenge_response: assert self.password capabilities["challenge_response"] = challenge_response if self.encryption: assert self.encryption in ENCRYPTION_CIPHERS capabilities["cipher"] = self.encryption iv = get_hex_uuid()[:16] capabilities["cipher.iv"] = iv key_salt = get_hex_uuid() capabilities["cipher.key_salt"] = key_salt iterations = 1000 capabilities["cipher.key_stretch_iterations"] = iterations self._protocol.set_cipher_in(self.encryption, iv, self.get_password(), key_salt, iterations) log("encryption capabilities: %s", [(k,v) for k,v in capabilities.items() if k.startswith("cipher")]) capabilities["platform"] = sys.platform capabilities["platform.release"] = python_platform.release() capabilities["platform.machine"] = python_platform.machine() capabilities["platform.processor"] = python_platform.processor() capabilities["client_type"] = self.client_type() capabilities["namespace"] = True capabilities["raw_packets"] = True capabilities["chunked_compression"] = True capabilities["bencode"] = True capabilities["rencode"] = has_rencode if has_rencode: capabilities["rencode.version"] = rencode_version capabilities["hostname"] = socket.gethostname() capabilities["uuid"] = self.uuid try: from xpra.platform.info import get_username, get_name capabilities["username"] = get_username() capabilities["name"] = get_name() except: log.error("failed to get username/name", exc_info=True) capabilities["randr_notify"] = False #only client.py cares about this capabilities["windows"] = False #only client.py cares about this if self._reverse_aliases: capabilities["aliases"] = self._reverse_aliases return capabilities
def make_hello(self, challenge_response=None): capabilities = {} add_version_info(capabilities) if challenge_response: capabilities["challenge_response"] = challenge_response if self.encoding: capabilities["encoding"] = self.encoding capabilities["encodings"] = ENCODINGS if self.jpegquality: capabilities["jpeg"] = self.jpegquality capabilities["platform"] = sys.platform capabilities["raw_packets"] = True capabilities["chunked_compression"] = True capabilities["rencode"] = has_rencode capabilities["server-window-resize"] = True uuid_src = str(get_machine_id()) if os.name=="posix": uuid_src += "/%s/%s" % (os.getuid(), os.getgid()) capabilities["randr_notify"] = False #only client.py cares about this return capabilities
def make_hello(self, challenge_response=None): capabilities = {} add_version_info(capabilities) if challenge_response: capabilities["challenge_response"] = challenge_response if self.encoding: capabilities["encoding"] = self.encoding capabilities["encodings"] = ENCODINGS if self.jpegquality: capabilities["jpeg"] = self.jpegquality capabilities["platform"] = sys.platform capabilities["raw_packets"] = True capabilities["chunked_compression"] = True capabilities["rencode"] = has_rencode capabilities["server-window-resize"] = True uuid_src = str(get_machine_id()) if os.name == "posix": uuid_src += "/%s/%s" % (os.getuid(), os.getgid()) capabilities["randr_notify"] = False #only client.py cares about this return capabilities
def make_hello(self, challenge_response=None): capabilities = {} add_version_info(capabilities) if challenge_response: assert self.password capabilities["challenge_response"] = challenge_response if self.encryption: assert self.encryption in ENCRYPTION_CIPHERS capabilities["cipher"] = self.encryption iv = uuid.uuid4().hex[:16] capabilities["cipher.iv"] = iv key_salt = uuid.uuid4().hex capabilities["cipher.key_salt"] = key_salt iterations = 1000 capabilities["cipher.key_stretch_iterations"] = iterations self._protocol.set_cipher_in(self.encryption, iv, self.get_password(), key_salt, iterations) if self.encoding: capabilities["encoding"] = self.encoding capabilities["encodings"] = ENCODINGS if self.quality>0: capabilities["jpeg"] = self.quality capabilities["quality"] = self.quality capabilities["encoding.quality"] = self.quality if self.min_quality>0: capabilities["encoding.min-quality"] = self.min_quality if self.speed>=0: capabilities["speed"] = self.speed capabilities["encoding.speed"] = self.speed if self.min_speed>=0: capabilities["encoding.min-speed"] = self.min_speed capabilities["platform"] = sys.platform capabilities["client_type"] = "Python/Gobject" capabilities["raw_packets"] = True capabilities["chunked_compression"] = True capabilities["rencode"] = has_rencode capabilities["server-window-resize"] = True capabilities["hostname"] = socket.gethostname() capabilities["uuid"] = self.uuid capabilities["randr_notify"] = False #only client.py cares about this capabilities["windows"] = False #only client.py cares about this return capabilities
def make_hello(self): now = time.time() capabilities = get_network_caps() capabilities.update(get_server_info()) capabilities.update({ "start_time": int(self.start_time), "current_time": int(now), "elapsed_time": int(now - self.start_time), "server_type": "core", "info-request": True, "uuid": get_user_uuid(), }) mid = get_machine_id() if mid: capabilities["machine_id"] = mid if self.session_name: capabilities["session_name"] = self.session_name if self._reverse_aliases: capabilities["aliases"] = self._reverse_aliases add_version_info(capabilities) return capabilities
def make_hello(self): now = time.time() capabilities = get_network_caps() capabilities.update(get_server_info()) capabilities.update({ "start_time" : int(self.start_time), "current_time" : int(now), "elapsed_time" : int(now - self.start_time), "server_type" : "core", "info-request" : True, "uuid" : get_user_uuid(), }) mid = get_machine_id() if mid: capabilities["machine_id"] = mid if self.session_name: capabilities["session_name"] = self.session_name if self._reverse_aliases: capabilities["aliases"] = self._reverse_aliases add_version_info(capabilities) return capabilities
def make_hello_base(self): capabilities = get_network_caps() capabilities.update({ "encoding.generic" : True, "namespace" : True, "hostname" : socket.gethostname(), "uuid" : self.uuid, "username" : self.username, "name" : get_name(), "client_type" : self.client_type(), "python.version" : sys.version_info[:3], "compression_level" : self.compression_level, }) if self.display: capabilities["display"] = self.display capabilities.update(get_platform_info()) add_version_info(capabilities) mid = get_machine_id() if mid: capabilities["machine_id"] = mid if self.encryption: assert self.encryption in ENCRYPTION_CIPHERS iv = get_hex_uuid()[:16] key_salt = get_hex_uuid()+get_hex_uuid() iterations = 1000 capabilities.update({ "cipher" : self.encryption, "cipher.iv" : iv, "cipher.key_salt" : key_salt, "cipher.key_stretch_iterations": iterations, }) key = self.get_encryption_key() if key is None: self.warn_and_quit(EXIT_ENCRYPTION, "encryption key is missing") return self._protocol.set_cipher_in(self.encryption, iv, key, key_salt, iterations) log("encryption capabilities: %s", [(k,v) for k,v in capabilities.items() if k.startswith("cipher")]) return capabilities