#define INVALID_INTEGER_VALUE 0xFFFFFFFF
+#define RDP_FILE_LINE_FLAG_FORMATTED 0x00000001
+#define RDP_FILE_LINE_FLAG_STANDARD 0x00000002
+#define RDP_FILE_LINE_FLAG_TYPE_STRING 0x00000010
+#define RDP_FILE_LINE_FLAG_TYPE_INTEGER 0x00000020
+#define RDP_FILE_LINE_FLAG_TYPE_BINARY 0x00000040
+
+struct rdp_file_line
+{
+ int index;
+ char* text;
+ DWORD flags;
+ char* name;
+ LPSTR sValue;
+ DWORD iValue;
+ PBYTE bValue;
+ int valueLength;
+};
+typedef struct rdp_file_line rdpFileLine;
+
+struct rdp_file
+{
+ DWORD UseMultiMon; /* use multimon */
+ DWORD ScreenModeId; /* screen mode id */
+ DWORD SpanMonitors; /* span monitors */
+ DWORD SmartSizing; /* smartsizing */
+ DWORD EnableSuperSpan; /* enablesuperpan */
+ DWORD SuperSpanAccelerationFactor; /* superpanaccelerationfactor */
+
+ DWORD DesktopWidth; /* desktopwidth */
+ DWORD DesktopHeight; /* desktopheight */
+ DWORD DesktopSizeId; /* desktop size id */
+ DWORD SessionBpp; /* session bpp */
+
+ DWORD Compression; /* compression */
+ DWORD KeyboardHook; /* keyboardhook */
+ DWORD DisableCtrlAltDel; /* disable ctrl+alt+del */
+
+ DWORD AudioMode; /* audiomode */
+ DWORD AudioQualityMode; /* audioqualitymode */
+ DWORD AudioCaptureMode; /* audiocapturemode */
+ DWORD VideoPlaybackMode; /* videoplaybackmode */
+
+ DWORD ConnectionType; /* connection type */
+
+ DWORD NetworkAutoDetect; /* networkautodetect */
+ DWORD BandwidthAutoDetect; /* bandwidthautodetect */
+
+ DWORD PinConnectionBar; /* pinconnectionbar */
+ DWORD DisplayConnectionBar; /* displayconnectionbar */
+
+ DWORD WorkspaceId; /* workspaceid */
+ DWORD EnableWorkspaceReconnect; /* enableworkspacereconnect */
+
+ DWORD DisableWallpaper; /* disable wallpaper */
+ DWORD AllowFontSmoothing; /* allow font smoothing */
+ DWORD AllowDesktopComposition; /* allow desktop composition */
+ DWORD DisableFullWindowDrag; /* disable full window drag */
+ DWORD DisableMenuAnims; /* disable menu anims */
+ DWORD DisableThemes; /* disable themes */
+ DWORD DisableCursorSetting; /* disable cursor setting */
+
+ DWORD BitmapCacheSize; /* bitmapcachesize */
+ DWORD BitmapCachePersistEnable; /* bitmapcachepersistenable */
+
+ LPSTR Username; /* username */
+ LPSTR Domain; /* domain */
+ LPSTR Password; /*password*/
+ PBYTE Password51; /* password 51 */
+
+ LPSTR FullAddress; /* full address */
+ LPSTR AlternateFullAddress; /* alternate full address */
+ DWORD ServerPort; /* server port */
+
+ DWORD RedirectDrives; /* redirectdrives */
+ DWORD RedirectPrinters; /* redirectprinters */
+ DWORD RedirectComPorts; /* redirectcomports */
+ DWORD RedirectSmartCards; /* redirectsmartcards */
+ DWORD RedirectClipboard; /* redirectclipboard */
+ DWORD RedirectPosDevices; /* redirectposdevices */
+ DWORD RedirectDirectX; /* redirectdirectx */
+ DWORD DisablePrinterRedirection; /* disableprinterredirection */
+ DWORD DisableClipboardRedirection; /* disableclipboardredirection */
+ LPSTR UsbDevicesToRedirect; /* usbdevicestoredirect */
+
+ DWORD ConnectToConsole; /* connect to console */
+ DWORD AdministrativeSession; /* administrative session */
+ DWORD AutoReconnectionEnabled; /* autoreconnection enabled */
+ DWORD AutoReconnectMaxRetries; /* autoreconnect max retries */
+
+ DWORD PublicMode; /* public mode */
+ DWORD AuthenticationLevel; /* authentication level */
+ DWORD PromptCredentialOnce; /* promptcredentialonce */
+ DWORD PromptForCredentials; /* prompt for credentials */
+ DWORD NegotiateSecurityLayer; /* negotiate security layer */
+ DWORD EnableCredSSPSupport; /* enablecredsspsupport */
+ LPSTR LoadBalanceInfo; /* loadbalanceinfo */
+
+ DWORD RemoteApplicationMode; /* remoteapplicationmode */
+ LPSTR RemoteApplicationName; /* remoteapplicationname */
+ LPSTR RemoteApplicationIcon; /* remoteapplicationicon */
+ LPSTR RemoteApplicationProgram; /* remoteapplicationprogram */
+ LPSTR RemoteApplicationFile; /* remoteapplicationfile */
+ LPSTR RemoteApplicationGuid; /* remoteapplicationguid */
+ LPSTR RemoteApplicationCmdLine; /* remoteapplicationcmdline */
+ DWORD RemoteApplicationExpandCmdLine; /* remoteapplicationexpandcmdline */
+ DWORD RemoteApplicationExpandWorkingDir; /* remoteapplicationexpandworkingdir */
+ DWORD DisableConnectionSharing; /* disableconnectionsharing */
+ DWORD DisableRemoteAppCapsCheck; /* disableremoteappcapscheck */
+
+ LPSTR AlternateShell; /* alternate shell */
+ LPSTR ShellWorkingDirectory; /* shell working directory */
+
+ LPSTR GatewayHostname; /* gatewayhostname */
+ DWORD GatewayUsageMethod; /* gatewayusagemethod */
+ DWORD GatewayProfileUsageMethod; /* gatewayprofileusagemethod */
+ DWORD GatewayCredentialsSource; /* gatewaycredentialssource */
+ LPSTR GatewayAccessToken; /* gatewayaccesstoken */
+
+ DWORD UseRedirectionServerName; /* use redirection server name */
+
+ DWORD RdgIsKdcProxy; /* rdgiskdcproxy */
+ LPSTR KdcProxyName; /* kdcproxyname */
+
+ LPSTR DrivesToRedirect; /* drivestoredirect */
+ LPSTR DevicesToRedirect; /* devicestoredirect */
+ LPSTR WinPosStr; /* winposstr */
+
+ LPSTR PreconnectionBlob; /* pcb */
+
+ int lineCount;
+ int lineSize;
+ rdpFileLine* lines;
+
+ int argc;
+ char** argv;
+ int argSize;
+};
+
/*
* Set an integer in a rdpFile
*
file->AuthenticationLevel = value;
else if (_stricmp(name, "promptcredentialonce") == 0)
file->PromptCredentialOnce = value;
- else if (_stricmp(name, "prompt for credentials") == 0)
+ else if ((_stricmp(name, "prompt for credentials") == 0) ||
+ (_stricmp(name, "prompt for credentials on client") == 0))
file->PromptForCredentials = value;
- else if (_stricmp(name, "promptcredentialonce") == 0)
- file->PromptForCredentialsOnce = value;
else if (_stricmp(name, "negotiate security layer") == 0)
file->NegotiateSecurityLayer = value;
else if (_stricmp(name, "enablecredsspsupport") == 0)
SETTING_MODIFIED_SET_STRING(file->GatewayAccessToken, settings, GatewayAccessToken);
SETTING_MODIFIED_SET(file->GatewayUsageMethod, settings, GatewayUsageMethod);
SETTING_MODIFIED_SET(file->PromptCredentialOnce, settings, GatewayUseSameCredentials);
+ SETTING_MODIFIED_SET(file->PromptForCredentials, settings, PromptForCredentials);
SETTING_MODIFIED_SET(file->RemoteApplicationMode, settings, RemoteApplicationMode);
SETTING_MODIFIED_SET_STRING(file->RemoteApplicationProgram, settings, RemoteApplicationProgram);
SETTING_MODIFIED_SET_STRING(file->RemoteApplicationName, settings, RemoteApplicationName);
return FALSE;
}
+ if (~file->PromptForCredentials)
+ {
+ if (!freerdp_settings_set_bool(settings, FreeRDP_PromptForCredentials,
+ file->PromptForCredentials))
+ return FALSE;
+ }
+
if (~file->RemoteApplicationMode)
{
if (!freerdp_settings_set_bool(settings, FreeRDP_RemoteApplicationMode,
#include <freerdp/api.h>
#include <freerdp/freerdp.h>
-#define RDP_FILE_LINE_FLAG_FORMATTED 0x00000001
-#define RDP_FILE_LINE_FLAG_STANDARD 0x00000002
-#define RDP_FILE_LINE_FLAG_TYPE_STRING 0x00000010
-#define RDP_FILE_LINE_FLAG_TYPE_INTEGER 0x00000020
-#define RDP_FILE_LINE_FLAG_TYPE_BINARY 0x00000040
-
-struct rdp_file_line
-{
- int index;
- char* text;
- DWORD flags;
- char* name;
- LPSTR sValue;
- DWORD iValue;
- PBYTE bValue;
- int valueLength;
-};
-typedef struct rdp_file_line rdpFileLine;
-
-struct rdp_file
-{
- DWORD UseMultiMon; /* use multimon */
- DWORD ScreenModeId; /* screen mode id */
- DWORD SpanMonitors; /* span monitors */
- DWORD SmartSizing; /* smartsizing */
- DWORD EnableSuperSpan; /* enablesuperpan */
- DWORD SuperSpanAccelerationFactor; /* superpanaccelerationfactor */
-
- DWORD DesktopWidth; /* desktopwidth */
- DWORD DesktopHeight; /* desktopheight */
- DWORD DesktopSizeId; /* desktop size id */
- DWORD SessionBpp; /* session bpp */
-
- DWORD Compression; /* compression */
- DWORD KeyboardHook; /* keyboardhook */
- DWORD DisableCtrlAltDel; /* disable ctrl+alt+del */
-
- DWORD AudioMode; /* audiomode */
- DWORD AudioQualityMode; /* audioqualitymode */
- DWORD AudioCaptureMode; /* audiocapturemode */
- DWORD VideoPlaybackMode; /* videoplaybackmode */
-
- DWORD ConnectionType; /* connection type */
-
- DWORD NetworkAutoDetect; /* networkautodetect */
- DWORD BandwidthAutoDetect; /* bandwidthautodetect */
-
- DWORD PinConnectionBar; /* pinconnectionbar */
- DWORD DisplayConnectionBar; /* displayconnectionbar */
-
- DWORD WorkspaceId; /* workspaceid */
- DWORD EnableWorkspaceReconnect; /* enableworkspacereconnect */
-
- DWORD DisableWallpaper; /* disable wallpaper */
- DWORD AllowFontSmoothing; /* allow font smoothing */
- DWORD AllowDesktopComposition; /* allow desktop composition */
- DWORD DisableFullWindowDrag; /* disable full window drag */
- DWORD DisableMenuAnims; /* disable menu anims */
- DWORD DisableThemes; /* disable themes */
- DWORD DisableCursorSetting; /* disable cursor setting */
-
- DWORD BitmapCacheSize; /* bitmapcachesize */
- DWORD BitmapCachePersistEnable; /* bitmapcachepersistenable */
-
- LPSTR Username; /* username */
- LPSTR Domain; /* domain */
- LPSTR Password; /*password*/
- PBYTE Password51; /* password 51 */
-
- LPSTR FullAddress; /* full address */
- LPSTR AlternateFullAddress; /* alternate full address */
- DWORD ServerPort; /* server port */
-
- DWORD RedirectDrives; /* redirectdrives */
- DWORD RedirectPrinters; /* redirectprinters */
- DWORD RedirectComPorts; /* redirectcomports */
- DWORD RedirectSmartCards; /* redirectsmartcards */
- DWORD RedirectClipboard; /* redirectclipboard */
- DWORD RedirectPosDevices; /* redirectposdevices */
- DWORD RedirectDirectX; /* redirectdirectx */
- DWORD DisablePrinterRedirection; /* disableprinterredirection */
- DWORD DisableClipboardRedirection; /* disableclipboardredirection */
- LPSTR UsbDevicesToRedirect; /* usbdevicestoredirect */
-
- DWORD ConnectToConsole; /* connect to console */
- DWORD AdministrativeSession; /* administrative session */
- DWORD AutoReconnectionEnabled; /* autoreconnection enabled */
- DWORD AutoReconnectMaxRetries; /* autoreconnect max retries */
-
- DWORD PublicMode; /* public mode */
- DWORD AuthenticationLevel; /* authentication level */
- DWORD PromptCredentialOnce; /* promptcredentialonce */
- DWORD PromptForCredentials; /* prompt for credentials */
- DWORD PromptForCredentialsOnce; /* promptcredentialonce */
- DWORD NegotiateSecurityLayer; /* negotiate security layer */
- DWORD EnableCredSSPSupport; /* enablecredsspsupport */
- LPSTR LoadBalanceInfo; /* loadbalanceinfo */
-
- DWORD RemoteApplicationMode; /* remoteapplicationmode */
- LPSTR RemoteApplicationName; /* remoteapplicationname */
- LPSTR RemoteApplicationIcon; /* remoteapplicationicon */
- LPSTR RemoteApplicationProgram; /* remoteapplicationprogram */
- LPSTR RemoteApplicationFile; /* remoteapplicationfile */
- LPSTR RemoteApplicationGuid; /* remoteapplicationguid */
- LPSTR RemoteApplicationCmdLine; /* remoteapplicationcmdline */
- DWORD RemoteApplicationExpandCmdLine; /* remoteapplicationexpandcmdline */
- DWORD RemoteApplicationExpandWorkingDir; /* remoteapplicationexpandworkingdir */
- DWORD DisableConnectionSharing; /* disableconnectionsharing */
- DWORD DisableRemoteAppCapsCheck; /* disableremoteappcapscheck */
-
- LPSTR AlternateShell; /* alternate shell */
- LPSTR ShellWorkingDirectory; /* shell working directory */
-
- LPSTR GatewayHostname; /* gatewayhostname */
- DWORD GatewayUsageMethod; /* gatewayusagemethod */
- DWORD GatewayProfileUsageMethod; /* gatewayprofileusagemethod */
- DWORD GatewayCredentialsSource; /* gatewaycredentialssource */
- LPSTR GatewayAccessToken; /* gatewayaccesstoken */
-
- DWORD UseRedirectionServerName; /* use redirection server name */
-
- DWORD RdgIsKdcProxy; /* rdgiskdcproxy */
- LPSTR KdcProxyName; /* kdcproxyname */
-
- LPSTR DrivesToRedirect; /* drivestoredirect */
- LPSTR DevicesToRedirect; /* devicestoredirect */
- LPSTR WinPosStr; /* winposstr */
-
- LPSTR PreconnectionBlob; /* pcb */
-
- int lineCount;
- int lineSize;
- rdpFileLine* lines;
-
- int argc;
- char** argv;
- int argSize;
-};
-
typedef struct rdp_file rdpFile;
#ifdef __cplusplus
#define FreeRDP_Password51 (1280)
#define FreeRDP_Password51Length (1281)
#define FreeRDP_SmartcardLogon (1282)
+#define FreeRDP_PromptForCredentials (1283)
#define FreeRDP_KerberosKdc (1344)
#define FreeRDP_KerberosRealm (1345)
#define FreeRDP_IgnoreCertificate (1408)
*/
/* Credentials Cache */
- ALIGN64 BYTE* Password51; /* 1280 */
- ALIGN64 UINT32 Password51Length; /* 1281 */
- ALIGN64 BOOL SmartcardLogon; /* 1282 */
- UINT64 padding1344[1344 - 1283]; /* 1283 */
+ ALIGN64 BYTE* Password51; /* 1280 */
+ ALIGN64 UINT32 Password51Length; /* 1281 */
+ ALIGN64 BOOL SmartcardLogon; /* 1282 */
+ ALIGN64 BOOL PromptForCredentials; /* 1283 */
+ UINT64 padding1344[1344 - 1284]; /* 1284 */
/* Kerberos Authentication */
ALIGN64 char* KerberosKdc; /* 1344 */
case FreeRDP_SmartcardLogon:
return settings->SmartcardLogon;
+ case FreeRDP_PromptForCredentials:
+ return settings->PromptForCredentials;
+
case FreeRDP_IgnoreCertificate:
return settings->IgnoreCertificate;
settings->SmartcardLogon = val;
break;
+ case FreeRDP_PromptForCredentials:
+ settings->PromptForCredentials = val;
+ break;
+
case FreeRDP_IgnoreCertificate:
settings->IgnoreCertificate = val;
break;
case FreeRDP_DrivesToRedirect:
return settings->DrivesToRedirect;
+ case FreeRDP_RDP2TCPArgs:
+ return settings->RDP2TCPArgs;
+
default:
WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id);
return FALSE;
settings->DrivesToRedirect = _strdup(val);
return settings->DrivesToRedirect != NULL;
+ case FreeRDP_RDP2TCPArgs:
+ free(settings->RDP2TCPArgs);
+ settings->RDP2TCPArgs = _strdup(val);
+ return settings->RDP2TCPArgs != NULL;
+
default:
WLog_ERR(TAG, "[%s] Invalid key index %"PRIuz, __FUNCTION__, id);
return FALSE;
if (!settings->GatewayPassword || !settings->GatewayUsername ||
!strlen(settings->GatewayPassword) || !strlen(settings->GatewayUsername))
{
- if (instance->GatewayAuthenticate)
+ if (!instance->settings->PromptForCredentials || !instance->GatewayAuthenticate)
+ {
+ freerdp_set_last_error(context, FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS);
+ return TRUE;
+ }
+ else
{
BOOL proceed = instance->GatewayAuthenticate(instance, &settings->GatewayUsername,
&settings->GatewayPassword, &settings->GatewayDomain);
if (!proceed)
{
- freerdp_set_last_error(context, FREERDP_ERROR_CONNECT_CANCELLED);
+ freerdp_set_last_error(context, FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS);
return TRUE;
}
if (!settings->GatewayPassword || !settings->GatewayUsername ||
!strlen(settings->GatewayPassword) || !strlen(settings->GatewayUsername))
{
- if (instance->GatewayAuthenticate)
+ if (!instance->settings->PromptForCredentials || !instance->GatewayAuthenticate)
+ {
+ freerdp_set_last_error(context, FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS);
+ return FALSE;
+ }
+ else
{
BOOL proceed = instance->GatewayAuthenticate(instance, &settings->GatewayUsername,
&settings->GatewayPassword, &settings->GatewayDomain);
if (!proceed)
{
- freerdp_set_last_error(context, FREERDP_ERROR_CONNECT_CANCELLED);
+ freerdp_set_last_error(context, FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS);
return FALSE;
}
if (promptPassword)
{
- if (instance->GatewayAuthenticate)
+ if (!instance->settings->PromptForCredentials || !instance->GatewayAuthenticate)
+ {
+ freerdp_set_last_error(instance->context, FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS);
+ return 0;
+ }
+ else
{
BOOL proceed = instance->GatewayAuthenticate(instance,
&settings->GatewayUsername, &settings->GatewayPassword, &settings->GatewayDomain);
if (!proceed)
{
- freerdp_set_last_error(instance->context, FREERDP_ERROR_CONNECT_CANCELLED);
+ freerdp_set_last_error(instance->context, FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS);
return 0;
}
if (PromptPassword)
{
- if (instance->Authenticate)
+ if (!instance->settings->PromptForCredentials || !instance->Authenticate)
+ {
+ freerdp_set_last_error(instance->context, FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS);
+ return 0;
+ }
+ else
{
BOOL proceed = instance->Authenticate(instance,
&settings->Username, &settings->Password, &settings->Domain);
settings->ActionScript = _strdup("~/.config/freerdp/action.sh");
settings->SmartcardLogon = FALSE;
+ settings->PromptForCredentials = TRUE;
settings->TlsSecLevel = 1;
settings->OrderSupport = calloc(1, 32);
FreeRDP_MstscCookieMode,
FreeRDP_SendPreconnectionPdu,
FreeRDP_SmartcardLogon,
+ FreeRDP_PromptForCredentials,
FreeRDP_IgnoreCertificate,
FreeRDP_ExternalCertificateManagement,
FreeRDP_AutoAcceptCertificate,
FreeRDP_RemoteApplicationWorkingDir,
FreeRDP_ImeFileName,
FreeRDP_DrivesToRedirect,
+ FreeRDP_RDP2TCPArgs,
};
#define have_pointer_list_indices