Skip to content

Commit

Permalink
just override the 'check_password' method which takes a string
Browse files Browse the repository at this point in the history
better fix than ab9e79b
  • Loading branch information
totaam committed Jul 6, 2024
1 parent 59a1c0e commit b5a3c97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions xpra/platform/win32/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@
LOGON32_PROVIDER_DEFAULT = 0


def check(domain="", username: str = "", password: bytes = b"") -> bool:
def check(domain="", username: str = "", password: str = "") -> bool:
token = HANDLE()
# domain = os.environ.get('COMPUTERNAME')
pstr = password.decode("utf8")
if LOG_CREDENTIALS:
log("LogonUser(%s, %s, %s, CLEARTEXT, DEFAULT, %#x)",
username, domain, pstr, addressof(token))
#LogonUser.argtypes = [LPCWSTR, LPCWSTR, LPCWSTR, DWORD, DWORD, POINTER(HANDLE)]
status = LogonUser(username, domain, pstr,
username, domain, password, addressof(token))
status = LogonUser(username, domain, password,
LOGON32_LOGON_NETWORK_CLEARTEXT,
LOGON32_PROVIDER_DEFAULT,
byref(token))
Expand Down
2 changes: 1 addition & 1 deletion xpra/server/auth/win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_challenge(self, digests: Sequence[str]) -> tuple[bytes, str]:
self.req_xor(digests)
return super().do_get_challenge(["xor"])

def check(self, password: bytes) -> bool:
def check_password(self, password: str) -> bool:
domain = "" # os.environ.get('COMPUTERNAME')
if check(domain, self.username, password):
self.password = password
Expand Down

0 comments on commit b5a3c97

Please sign in to comment.