Added CertificateAcceptedFingerprints to settings

This commit is contained in:
Armin Novak 2020-02-12 12:01:27 +01:00 committed by akallabeth
parent e3acc01bfb
commit d3b36ab299
4 changed files with 85 additions and 62 deletions

View File

@ -695,6 +695,7 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL;
#define FreeRDP_RdpKeyContent (1418)
#define FreeRDP_AutoAcceptCertificate (1419)
#define FreeRDP_AutoDenyCertificate (1420)
#define FreeRDP_CertificateAcceptedFingerprints (1421)
#define FreeRDP_Workarea (1536)
#define FreeRDP_Fullscreen (1537)
#define FreeRDP_PercentScreen (1538)
@ -1161,7 +1162,8 @@ struct rdp_settings
ALIGN64 char* RdpKeyContent; /* 1418 */
ALIGN64 BOOL AutoAcceptCertificate; /* 1419 */
ALIGN64 BOOL AutoDenyCertificate; /* 1420 */
UINT64 padding1472[1472 - 1421]; /* 1421 */
ALIGN64 char* CertificateAcceptedFingerprints; /* 1421 */
UINT64 padding1472[1472 - 1422]; /* 1422 */
UINT64 padding1536[1536 - 1472]; /* 1472 */
/**

View File

@ -2262,6 +2262,9 @@ const char* freerdp_settings_get_string(const rdpSettings* settings, size_t id)
case FreeRDP_RdpKeyContent:
return settings->RdpKeyContent;
case FreeRDP_CertificateAcceptedFingerprints:
return settings->CertificateAcceptedFingerprints;
case FreeRDP_WindowTitle:
return settings->WindowTitle;
@ -2542,6 +2545,11 @@ BOOL freerdp_settings_set_string(rdpSettings* settings, size_t id, const char* v
settings->RdpKeyContent = (val ? _strdup(val) : NULL);
return (!val || settings->RdpKeyContent != NULL);
case FreeRDP_CertificateAcceptedFingerprints:
free(settings->CertificateAcceptedFingerprints);
settings->CertificateAcceptedFingerprints = (val ? _strdup(val) : NULL);
return (!val || settings->CertificateAcceptedFingerprints != NULL);
case FreeRDP_WindowTitle:
free(settings->WindowTitle);
settings->WindowTitle = (val ? _strdup(val) : NULL);
@ -2704,6 +2712,54 @@ const void* freerdp_settings_get_pointer(const rdpSettings* settings, size_t id)
case FreeRDP_instance:
return settings->instance;
case FreeRDP_RdpServerCertificate:
return settings->RdpServerCertificate;
case FreeRDP_ServerAutoReconnectCookie:
return settings->ServerAutoReconnectCookie;
case FreeRDP_BitmapCacheV2CellInfo:
return settings->BitmapCacheV2CellInfo;
case FreeRDP_RdpServerRsaKey:
return settings->RdpServerRsaKey;
case FreeRDP_MonitorIds:
return settings->MonitorIds;
case FreeRDP_TargetNetPorts:
return settings->TargetNetPorts;
case FreeRDP_MonitorDefArray:
return settings->MonitorDefArray;
case FreeRDP_ChannelDefArray:
return settings->ChannelDefArray;
case FreeRDP_ClientAutoReconnectCookie:
return settings->ClientAutoReconnectCookie;
case FreeRDP_TargetNetAddresses:
return settings->TargetNetAddresses;
case FreeRDP_StaticChannelArray:
return settings->StaticChannelArray;
case FreeRDP_DynamicChannelArray:
return settings->DynamicChannelArray;
case FreeRDP_DeviceArray:
return settings->DeviceArray;
case FreeRDP_GlyphCache:
return settings->GlyphCache;
case FreeRDP_FragCache:
return settings->FragCache;
case FreeRDP_ClientTimeZone:
return settings->ClientTimeZone;
case FreeRDP_ServerRandom:
return settings->ServerRandom;
@ -2731,54 +2787,6 @@ const void* freerdp_settings_get_pointer(const rdpSettings* settings, size_t id)
case FreeRDP_OrderSupport:
return settings->OrderSupport;
case FreeRDP_ChannelDefArray:
return settings->ChannelDefArray;
case FreeRDP_MonitorDefArray:
return settings->MonitorDefArray;
case FreeRDP_MonitorIds:
return settings->MonitorIds;
case FreeRDP_TargetNetPorts:
return settings->TargetNetPorts;
case FreeRDP_ClientAutoReconnectCookie:
return settings->ClientAutoReconnectCookie;
case FreeRDP_ServerAutoReconnectCookie:
return settings->ServerAutoReconnectCookie;
case FreeRDP_ClientTimeZone:
return settings->ClientTimeZone;
case FreeRDP_TargetNetAddresses:
return settings->TargetNetAddresses;
case FreeRDP_RdpServerRsaKey:
return settings->RdpServerRsaKey;
case FreeRDP_RdpServerCertificate:
return settings->RdpServerCertificate;
case FreeRDP_BitmapCacheV2CellInfo:
return settings->BitmapCacheV2CellInfo;
case FreeRDP_GlyphCache:
return settings->GlyphCache;
case FreeRDP_FragCache:
return settings->FragCache;
case FreeRDP_DeviceArray:
return settings->DeviceArray;
case FreeRDP_StaticChannelArray:
return settings->StaticChannelArray;
case FreeRDP_DynamicChannelArray:
return settings->DynamicChannelArray;
default:
WLog_ERR(TAG, "[%s] Invalid key index %" PRIuz, __FUNCTION__, id);
return FALSE;

View File

@ -658,6 +658,7 @@ static void freerdp_settings_free_internal(rdpSettings* settings)
free(settings->CertificateContent);
free(settings->PrivateKeyContent);
free(settings->RdpKeyContent);
free(settings->CertificateAcceptedFingerprints);
free(settings->ClientAutoReconnectCookie);
free(settings->ServerAutoReconnectCookie);
free(settings->ClientTimeZone);
@ -931,6 +932,17 @@ BOOL freerdp_settings_copy(rdpSettings* _settings, const rdpSettings* settings)
CopyMemory(_settings->GlyphCache, settings->GlyphCache, sizeof(GLYPH_CACHE_DEFINITION) * 10);
CopyMemory(_settings->FragCache, settings->FragCache, sizeof(GLYPH_CACHE_DEFINITION));
if (settings->CertificateContent)
_settings->CertificateContent = _strdup(settings->CertificateContent);
if (settings->PrivateKeyContent)
_settings->PrivateKeyContent = _strdup(settings->PrivateKeyContent);
if (settings->RdpKeyContent)
_settings->RdpKeyContent = _strdup(settings->RdpKeyContent);
if (settings->CertificateAcceptedFingerprints)
_settings->CertificateAcceptedFingerprints =
_strdup(settings->CertificateAcceptedFingerprints);
_settings->ClientAutoReconnectCookie =
(ARC_CS_PRIVATE_PACKET*)malloc(sizeof(ARC_CS_PRIVATE_PACKET));

View File

@ -338,6 +338,7 @@ static const size_t string_list_indices[] = {
FreeRDP_CertificateContent,
FreeRDP_PrivateKeyContent,
FreeRDP_RdpKeyContent,
FreeRDP_CertificateAcceptedFingerprints,
FreeRDP_WindowTitle,
FreeRDP_WmClass,
FreeRDP_ComputerName,
@ -371,7 +372,18 @@ static const size_t string_list_indices[] = {
#define have_pointer_list_indices
static const size_t pointer_list_indices[] = {
FreeRDP_StaticChannelArray,
FreeRDP_DynamicChannelArray,
FreeRDP_instance,
FreeRDP_RdpServerCertificate,
FreeRDP_MonitorIds,
FreeRDP_TargetNetPorts,
FreeRDP_DeviceArray,
FreeRDP_ClientAutoReconnectCookie,
FreeRDP_TargetNetAddresses,
FreeRDP_MonitorDefArray,
FreeRDP_BitmapCacheV2CellInfo,
FreeRDP_ServerAutoReconnectCookie,
FreeRDP_ServerRandom,
FreeRDP_ServerCertificate,
FreeRDP_ClientRandom,
@ -381,22 +393,11 @@ static const size_t pointer_list_indices[] = {
FreeRDP_Password51,
FreeRDP_ReceivedCapabilities,
FreeRDP_OrderSupport,
FreeRDP_ChannelDefArray,
FreeRDP_MonitorDefArray,
FreeRDP_MonitorIds,
FreeRDP_TargetNetPorts,
FreeRDP_ClientAutoReconnectCookie,
FreeRDP_ServerAutoReconnectCookie,
FreeRDP_ClientTimeZone,
FreeRDP_TargetNetAddresses,
FreeRDP_RdpServerRsaKey,
FreeRDP_RdpServerCertificate,
FreeRDP_BitmapCacheV2CellInfo,
FreeRDP_GlyphCache,
FreeRDP_FragCache,
FreeRDP_DeviceArray,
FreeRDP_StaticChannelArray,
FreeRDP_DynamicChannelArray,
FreeRDP_ClientTimeZone,
FreeRDP_ChannelDefArray,
};
#endif /* TEST_SETTINGS_PROPERTY_LISTS */