From 27a865af74451a34688a2d955f09ca75e3cb337d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Thu, 6 Oct 2022 16:47:32 -0400 Subject: [PATCH] Add Negotiate SSPI authentication module filtering --- client/common/cmdline.c | 6 + client/common/cmdline.h | 6 +- include/freerdp/settings.h | 4 +- libfreerdp/common/settings_getters.c | 9 + libfreerdp/common/settings_str.c | 1 + libfreerdp/core/credssp_auth.c | 100 +++- libfreerdp/core/peer.c | 3 +- .../core/test/settings_property_lists.h | 1 + winpr/include/winpr/sspi.h | 125 ++++- winpr/libwinpr/sspi/Kerberos/kerberos.c | 46 +- winpr/libwinpr/sspi/NTLM/ntlm.c | 15 +- winpr/libwinpr/sspi/Negotiate/negotiate.c | 53 +- winpr/libwinpr/sspi/sspi.c | 44 +- winpr/libwinpr/sspi/sspi_winpr.c | 485 +++++++++++++++++- 14 files changed, 792 insertions(+), 106 deletions(-) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 6611f67b4..597ba7586 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -3227,6 +3227,12 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, { settings->AuthenticationOnly = enable; } + CommandLineSwitchCase(arg, "auth-pkg-list") + { + if (!freerdp_settings_set_string(settings, FreeRDP_AuthenticationPackageList, + arg->Value)) + return COMMAND_LINE_ERROR_MEMORY; + } CommandLineSwitchCase(arg, "auto-reconnect") { settings->AutoReconnectionEnabled = enable; diff --git a/client/common/cmdline.h b/client/common/cmdline.h index 3d21ddf86..daadb979f 100644 --- a/client/common/cmdline.h +++ b/client/common/cmdline.h @@ -58,6 +58,8 @@ static const COMMAND_LINE_ARGUMENT_A global_cmd_args[] = { "Audio output mode" }, { "auth-only", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Authenticate only" }, + { "auth-pkg-list", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, + "Authentication package filter (comma-separated list, use '!' to exclude)" }, { "authentication", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "Authentication (experimental)" }, { "auto-reconnect", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, @@ -227,8 +229,8 @@ static const COMMAND_LINE_ARGUMENT_A global_cmd_args[] = { "Send unicode symbols, e.g. use the local keyboard map. ATTENTION: Does not work with every " "RDP server!" }, { "kerberos", COMMAND_LINE_VALUE_REQUIRED, - "[lifetime: