Add an exit code for a security protocol negotiation failure

This commit is contained in:
rbarnett
2018-09-13 10:29:23 -05:00
parent 56d001ef1b
commit 1e7be9908b
2 changed files with 8 additions and 3 deletions

View File

@@ -1488,6 +1488,8 @@ static DWORD WINAPI xf_client_thread(LPVOID param)
if (freerdp_get_last_error(instance->context) ==
FREERDP_ERROR_AUTHENTICATION_FAILED)
exit_code = XF_EXIT_AUTH_FAILURE;
else if (freerdp_get_last_error(instance->context) == FREERDP_ERROR_SECURITY_NEGO_CONNECT_FAILED)
exit_code = XF_EXIT_NEGO_FAILURE;
else
exit_code = XF_EXIT_CONN_FAILED;
}
@@ -1591,8 +1593,10 @@ static DWORD WINAPI xf_client_thread(LPVOID param)
continue;
else
{
// Indicate an unsuccessful connection attempt if reconnect
// did not succeed, but did not give some other reason.
/*
* Indicate an unsuccessful connection attempt if reconnect
* did not succeed and no other error was specified.
*/
if (freerdp_error_info(instance) == 0)
exit_code = XF_EXIT_CONN_FAILED;
}
@@ -1643,7 +1647,7 @@ end:
DWORD xf_exit_code_from_disconnect_reason(DWORD reason)
{
if (reason == 0 || (reason >= XF_EXIT_PARSE_ARGUMENTS
&& reason <= XF_EXIT_AUTH_FAILURE))
&& reason <= XF_EXIT_NEGO_FAILURE))
return reason;
/* License error set */
else if (reason >= 0x100 && reason <= 0x10A)

View File

@@ -278,6 +278,7 @@ enum XF_EXIT_CODE
XF_EXIT_PROTOCOL = 130,
XF_EXIT_CONN_FAILED = 131,
XF_EXIT_AUTH_FAILURE = 132,
XF_EXIT_NEGO_FAILURE = 133,
XF_EXIT_UNKNOWN = 255,
};