Fixed some stuff.

This commit is contained in:
Ezri Brimhall 2025-06-24 10:45:27 -06:00
parent 14d1c4b38c
commit 4b28b98f8c
Signed by: ezri
GPG Key ID: 058A78E5680C6F24

View File

@ -78,6 +78,8 @@ class GlobalProtectConnection(
async def _prelogin(self, options: dict[str, Variant]):
"""Perform prelogin request."""
self.logger.debug("Begin preauth with options:", {options})
## Extract options from vardict
if "spoof_clientos" in options:
clientos = options["spoof_clientos"].value
@ -143,6 +145,8 @@ class GlobalProtectConnection(
# Raise a D-Bus generic prelogin failure
raise errors.PreloginFailure(f"An unexpected error occurred: {rootex}")
self.logger.debug("Got XML response:", res.text)
# Pass XML parsing off to agent for security reasons
result = await self._manager.request_credentials(
AuthFlows.GLOBALPROTECT_PARSE_PRELOGIN, Variant("s", res.text)
@ -154,11 +158,16 @@ class GlobalProtectConnection(
"Received unexpected response from agent. Expected strdict (a{ss}), got "
f"{result.signature}"
)
self.logger.debug("Got parsed result", result.value)
return result.value
async def authenticate(self, options: dict[str, Variant]) -> Variant:
f"""{super().authenticate.__doc__}"""
self.logger.info("Starting GlobalProtect authentication.")
preauth: dict[str, str] = await self._prelogin(options)
if "saml-auth-method" not in preauth or "saml-request" not in preauth: