Skip to content

Commit

Permalink
we need the display name to validate
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Feb 12, 2024
1 parent 3a13088 commit 8468840
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 6 additions & 2 deletions xpra/server/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1387,8 +1387,12 @@ def ssh_password_authenticate(username, password) -> bool:
return False
return True

return make_ssh_server_connection(conn, socket_options,
none_auth=none_auth, password_auth=ssh_password_authenticate)
return make_ssh_server_connection(
conn, socket_options,
none_auth=none_auth,
password_auth=ssh_password_authenticate,
display_name=self.display_name,
)

def try_upgrade_to_rfb(self, proto) -> bool:
self.cancel_upgrade_to_rfb_timer(proto)
Expand Down
11 changes: 8 additions & 3 deletions xpra/server/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,14 @@ def find_fingerprint(filename: str, fingerprint):


class SSHServer(paramiko.ServerInterface):
def __init__(self, none_auth=False, pubkey_auth=True, password_auth=None, options=None):
def __init__(self, none_auth=False, pubkey_auth=True, password_auth=None, options=None, display_name=""):
self.event = Event()
self.none_auth = none_auth
self.pubkey_auth = pubkey_auth
self.password_auth = password_auth
self.proxy_channel = None
self.options = options or {}
self.display_name = display_name
self.agent = None
self.transport = None

Expand Down Expand Up @@ -411,9 +412,13 @@ def stdin_reader() -> None:
channel.proxy_process = proc


def make_ssh_server_connection(conn, socket_options, none_auth: bool = False, password_auth: Callable | None = None):
def make_ssh_server_connection(conn, socket_options,
none_auth: bool = False,
password_auth: Callable | None = None,
display_name: str=""):
log("make_ssh_server_connection%s", (conn, socket_options, none_auth, password_auth))
ssh_server = SSHServer(none_auth=none_auth, password_auth=password_auth, options=socket_options)
ssh_server = SSHServer(none_auth=none_auth, password_auth=password_auth, options=socket_options,
display_name=display_name)
DoGSSAPIKeyExchange = parse_bool("ssh-gss-key-exchange", socket_options.get("ssh-gss-key-exchange", False), False)
sock = conn._socket
t = None
Expand Down

0 comments on commit 8468840

Please sign in to comment.