From 05dab47cbd0e6686ae553298324b7bbd7026fef4 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 16 Jan 2023 08:33:46 +0100 Subject: [PATCH] [core,settings] add missing redirection options * RedirectionGuid * TargetCertificate --- include/freerdp/settings.h | 13 ++++++++- libfreerdp/common/settings.c | 6 ++++ libfreerdp/common/settings_getters.c | 28 +++++++++++++++++++ libfreerdp/common/settings_str.c | 7 +++++ .../core/test/settings_property_lists.h | 4 +++ 5 files changed, 57 insertions(+), 1 deletion(-) diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 6907c7022..e0ed0e4e0 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -278,6 +278,9 @@ typedef enum #define LB_TARGET_NET_ADDRESSES 0x00000800 #define LB_CLIENT_TSV_URL 0x00001000 #define LB_SERVER_TSV_CAPABLE 0x00002000 +#define LB_PASSWORD_IS_PK_ENCRYPTED 0x00004000 +#define LB_REDIRECTION_GUID 0x00008000 +#define LB_TARGET_CERTIFICATE 0x00010000 #define LB_PASSWORD_MAX_LENGTH 512 @@ -699,6 +702,10 @@ typedef struct #define FreeRDP_RedirectionAcceptedCert (1231) #define FreeRDP_RedirectionAcceptedCertLength (1232) #define FreeRDP_RedirectionPreferType (1233) +#define FreeRDP_RedirectionGuid (1234) +#define FreeRDP_RedirectionGuidLength (1235) +#define FreeRDP_RedirectionTargetCertificate (1236) +#define FreeRDP_RedirectionTargetCertificateLength (1237) #define FreeRDP_Password51 (1280) #define FreeRDP_Password51Length (1281) #define FreeRDP_SmartcardLogon (1282) @@ -1214,7 +1221,11 @@ struct rdp_settings ALIGN64 char* RedirectionAcceptedCert; /* 1231 */ ALIGN64 UINT32 RedirectionAcceptedCertLength; /* 1232 */ ALIGN64 UINT32 RedirectionPreferType; /* 1233 */ - UINT64 padding1280[1280 - 1234]; /* 1234 */ + ALIGN64 BYTE* RedirectionGuid; /* 1234 */ + ALIGN64 UINT32 RedirectionGuidLength; /* 1235 */ + ALIGN64 BYTE* RedirectionTargetCertificate; /* 1236 */ + ALIGN64 UINT32 RedirectionTargetCertificateLength; /* 1237 */ + UINT64 padding1280[1280 - 1238]; /* 1238 */ /** * Security diff --git a/libfreerdp/common/settings.c b/libfreerdp/common/settings.c index f9cb4a4ba..985ba02bc 100644 --- a/libfreerdp/common/settings.c +++ b/libfreerdp/common/settings.c @@ -1331,6 +1331,12 @@ BOOL freerdp_settings_set_pointer_len(rdpSettings* settings, size_t id, const vo case FreeRDP_RedirectionTsvUrl: return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_RedirectionTsvUrlLength, data, len, sizeof(char)); + case FreeRDP_RedirectionTargetCertificate: + return freerdp_settings_set_pointer_len_( + settings, id, FreeRDP_RedirectionTargetCertificateLength, data, len, sizeof(BYTE)); + case FreeRDP_RedirectionGuid: + return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_RedirectionGuidLength, + data, len, sizeof(BYTE)); case FreeRDP_LoadBalanceInfo: return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_LoadBalanceInfoLength, data, len, sizeof(char)); diff --git a/libfreerdp/common/settings_getters.c b/libfreerdp/common/settings_getters.c index 19771a517..f3e0bd110 100644 --- a/libfreerdp/common/settings_getters.c +++ b/libfreerdp/common/settings_getters.c @@ -1715,12 +1715,18 @@ UINT32 freerdp_settings_get_uint32(const rdpSettings* settings, size_t id) case FreeRDP_RedirectionFlags: return settings->RedirectionFlags; + case FreeRDP_RedirectionGuidLength: + return settings->RedirectionGuidLength; + case FreeRDP_RedirectionPasswordLength: return settings->RedirectionPasswordLength; case FreeRDP_RedirectionPreferType: return settings->RedirectionPreferType; + case FreeRDP_RedirectionTargetCertificateLength: + return settings->RedirectionTargetCertificateLength; + case FreeRDP_RedirectionTsvUrlLength: return settings->RedirectionTsvUrlLength; @@ -2183,6 +2189,10 @@ BOOL freerdp_settings_set_uint32(rdpSettings* settings, size_t id, UINT32 val) settings->RedirectionFlags = cnv.c; break; + case FreeRDP_RedirectionGuidLength: + settings->RedirectionGuidLength = cnv.c; + break; + case FreeRDP_RedirectionPasswordLength: settings->RedirectionPasswordLength = cnv.c; break; @@ -2191,6 +2201,10 @@ BOOL freerdp_settings_set_uint32(rdpSettings* settings, size_t id, UINT32 val) settings->RedirectionPreferType = cnv.c; break; + case FreeRDP_RedirectionTargetCertificateLength: + settings->RedirectionTargetCertificateLength = cnv.c; + break; + case FreeRDP_RedirectionTsvUrlLength: settings->RedirectionTsvUrlLength = cnv.c; break; @@ -3400,9 +3414,15 @@ void* freerdp_settings_get_pointer_writable(rdpSettings* settings, size_t id) case FreeRDP_ReceivedCapabilityDataSizes: return settings->ReceivedCapabilityDataSizes; + case FreeRDP_RedirectionGuid: + return settings->RedirectionGuid; + case FreeRDP_RedirectionPassword: return settings->RedirectionPassword; + case FreeRDP_RedirectionTargetCertificate: + return settings->RedirectionTargetCertificate; + case FreeRDP_RedirectionTsvUrl: return settings->RedirectionTsvUrl; @@ -3527,10 +3547,18 @@ BOOL freerdp_settings_set_pointer(rdpSettings* settings, size_t id, const void* settings->ReceivedCapabilityDataSizes = cnv.v; break; + case FreeRDP_RedirectionGuid: + settings->RedirectionGuid = cnv.v; + break; + case FreeRDP_RedirectionPassword: settings->RedirectionPassword = cnv.v; break; + case FreeRDP_RedirectionTargetCertificate: + settings->RedirectionTargetCertificate = cnv.v; + break; + case FreeRDP_RedirectionTsvUrl: settings->RedirectionTsvUrl = cnv.v; break; diff --git a/libfreerdp/common/settings_str.c b/libfreerdp/common/settings_str.c index d925a7948..b0fe15940 100644 --- a/libfreerdp/common/settings_str.c +++ b/libfreerdp/common/settings_str.c @@ -360,10 +360,14 @@ static const struct settings_str_entry settings_map[] = { { FreeRDP_RedirectionAcceptedCertLength, FREERDP_SETTINGS_TYPE_UINT32, "FreeRDP_RedirectionAcceptedCertLength" }, { FreeRDP_RedirectionFlags, FREERDP_SETTINGS_TYPE_UINT32, "FreeRDP_RedirectionFlags" }, + { FreeRDP_RedirectionGuidLength, FREERDP_SETTINGS_TYPE_UINT32, + "FreeRDP_RedirectionGuidLength" }, { FreeRDP_RedirectionPasswordLength, FREERDP_SETTINGS_TYPE_UINT32, "FreeRDP_RedirectionPasswordLength" }, { FreeRDP_RedirectionPreferType, FREERDP_SETTINGS_TYPE_UINT32, "FreeRDP_RedirectionPreferType" }, + { FreeRDP_RedirectionTargetCertificateLength, FREERDP_SETTINGS_TYPE_UINT32, + "FreeRDP_RedirectionTargetCertificateLength" }, { FreeRDP_RedirectionTsvUrlLength, FREERDP_SETTINGS_TYPE_UINT32, "FreeRDP_RedirectionTsvUrlLength" }, { FreeRDP_RemoteAppNumIconCacheEntries, FREERDP_SETTINGS_TYPE_UINT32, @@ -552,7 +556,10 @@ static const struct settings_str_entry settings_map[] = { "FreeRDP_ReceivedCapabilityData" }, { FreeRDP_ReceivedCapabilityDataSizes, FREERDP_SETTINGS_TYPE_POINTER, "FreeRDP_ReceivedCapabilityDataSizes" }, + { FreeRDP_RedirectionGuid, FREERDP_SETTINGS_TYPE_POINTER, "FreeRDP_RedirectionGuid" }, { FreeRDP_RedirectionPassword, FREERDP_SETTINGS_TYPE_POINTER, "FreeRDP_RedirectionPassword" }, + { FreeRDP_RedirectionTargetCertificate, FREERDP_SETTINGS_TYPE_POINTER, + "FreeRDP_RedirectionTargetCertificate" }, { FreeRDP_RedirectionTsvUrl, FREERDP_SETTINGS_TYPE_POINTER, "FreeRDP_RedirectionTsvUrl" }, { FreeRDP_ServerAutoReconnectCookie, FREERDP_SETTINGS_TYPE_POINTER, "FreeRDP_ServerAutoReconnectCookie" }, diff --git a/libfreerdp/core/test/settings_property_lists.h b/libfreerdp/core/test/settings_property_lists.h index 446dac7e9..8729e3c89 100644 --- a/libfreerdp/core/test/settings_property_lists.h +++ b/libfreerdp/core/test/settings_property_lists.h @@ -283,8 +283,10 @@ static const size_t uint32_list_indices[] = { FreeRDP_RedirectedSessionId, FreeRDP_RedirectionAcceptedCertLength, FreeRDP_RedirectionFlags, + FreeRDP_RedirectionGuidLength, FreeRDP_RedirectionPasswordLength, FreeRDP_RedirectionPreferType, + FreeRDP_RedirectionTargetCertificateLength, FreeRDP_RedirectionTsvUrlLength, FreeRDP_RemoteAppNumIconCacheEntries, FreeRDP_RemoteAppNumIconCaches, @@ -445,7 +447,9 @@ static const size_t pointer_list_indices[] = { FreeRDP_ReceivedCapabilities, FreeRDP_ReceivedCapabilityData, FreeRDP_ReceivedCapabilityDataSizes, + FreeRDP_RedirectionGuid, FreeRDP_RedirectionPassword, + FreeRDP_RedirectionTargetCertificate, FreeRDP_RedirectionTsvUrl, FreeRDP_ServerAutoReconnectCookie, FreeRDP_ServerCertificate,