diff --git a/libfreerdp/core/utils.c b/libfreerdp/core/utils.c index 25cdcab97..4a77d34d8 100644 --- a/libfreerdp/core/utils.c +++ b/libfreerdp/core/utils.c @@ -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;