[core,utils] do not abort on auth fail

Authenticate and GatewayAuthenticate return FALSE when there are no
credentials supplied. AuthenticateEx indicates connection termination
with that return value. Handle this accordingly
This commit is contained in:
Armin Novak 2023-03-11 11:37:30 +01:00 committed by Martin Fleisz
parent 461a307c42
commit 0c8a08817c

View File

@ -90,16 +90,21 @@ auth_status utils_authenticate_gateway(freerdp* instance, rdp_auth_reason reason
return AUTH_NO_CREDENTIALS;
if (!instance->GatewayAuthenticate)
{
proceed =
instance->AuthenticateEx(instance, &settings->GatewayUsername,
&settings->GatewayPassword, &settings->GatewayDomain, reason);
if (!proceed)
return AUTH_CANCELLED;
}
else
{
proceed =
instance->GatewayAuthenticate(instance, &settings->GatewayUsername,
&settings->GatewayPassword, &settings->GatewayDomain);
if (!proceed)
return AUTH_CANCELLED;
if (!proceed)
return AUTH_NO_CREDENTIALS;
}
if (utils_str_is_empty(settings->GatewayUsername) ||
utils_str_is_empty(settings->GatewayPassword))
@ -178,14 +183,19 @@ auth_status utils_authenticate(freerdp* instance, rdp_auth_reason reason, BOOL o
return AUTH_NO_CREDENTIALS;
if (!instance->Authenticate)
{
proceed = instance->AuthenticateEx(instance, &settings->Username, &settings->Password,
&settings->Domain, reason);
if (!proceed)
return AUTH_CANCELLED;
}
else
{
proceed = instance->Authenticate(instance, &settings->Username, &settings->Password,
&settings->Domain);
if (!proceed)
return AUTH_CANCELLED;
if (!proceed)
return AUTH_NO_CREDENTIALS;
}
if (utils_str_is_empty(settings->Username) || utils_str_is_empty(settings->Password))
return AUTH_NO_CREDENTIALS;