[core,info] do not rely on EarlyCapabilitiesFlags

now rdp_write_extended_info_packet only adds the
cbDynamicDSTTimeZoneKeyName, dynamicDSTTimeZoneKeyName and
dynamicDaylightTimeDisabled fields if both, client and server support
the dynamic timezone settings.
This commit is contained in:
akallabeth 2023-01-27 09:52:37 +01:00 committed by akallabeth
parent 1a87ba8fc2
commit 56a01603bb

View File

@ -322,11 +322,15 @@ static size_t rdp_get_client_address_max_size(const rdpRdp* rdp)
static BOOL rdp_read_extended_info_packet(rdpRdp* rdp, wStream* s)
{
UINT16 clientAddressFamily;
UINT16 cbClientAddress;
UINT16 cbClientDir;
UINT16 cbAutoReconnectLen;
UINT16 clientAddressFamily = 0;
UINT16 cbClientAddress = 0;
UINT16 cbClientDir = 0;
UINT16 cbAutoReconnectLen = 0;
WINPR_ASSERT(rdp);
rdpSettings* settings = rdp->settings;
WINPR_ASSERT(settings);
if (!Stream_CheckAndLogRequiredLength(TAG, s, 4))
return FALSE;
@ -424,7 +428,7 @@ static BOOL rdp_read_extended_info_packet(rdpRdp* rdp, wStream* s)
if (!Stream_CheckAndLogRequiredLength(TAG, s, 2))
return FALSE;
{
UINT16 cbDynamicDSTTimeZoneKeyName;
UINT16 cbDynamicDSTTimeZoneKeyName = 0;
Stream_Read_UINT16(s, cbDynamicDSTTimeZoneKeyName);
@ -462,20 +466,21 @@ end:
static BOOL rdp_write_extended_info_packet(rdpRdp* rdp, wStream* s)
{
BOOL ret = FALSE;
UINT16 clientAddressFamily;
WCHAR* clientAddress = NULL;
size_t cbClientAddress;
size_t cbClientAddress = 0;
const size_t cbClientAddressMax = rdp_get_client_address_max_size(rdp);
WCHAR* clientDir = NULL;
size_t cbClientDir;
size_t cbClientDir = 0;
const size_t cbClientDirMax = 512;
UINT16 cbAutoReconnectCookie;
rdpSettings* settings;
if (!rdp || !rdp->settings || !s)
return FALSE;
settings = rdp->settings;
clientAddressFamily = settings->IPv6Enabled ? ADDRESS_FAMILY_INET6 : ADDRESS_FAMILY_INET;
clientAddress = ConvertUtf8ToWCharAlloc(settings->ClientAddress, &cbClientAddress);
UINT16 cbAutoReconnectCookie = 0;
WINPR_ASSERT(rdp);
rdpSettings* settings = rdp->settings;
WINPR_ASSERT(settings);
const UINT16 clientAddressFamily =
settings->IPv6Enabled ? ADDRESS_FAMILY_INET6 : ADDRESS_FAMILY_INET;
WCHAR* clientAddress = ConvertUtf8ToWCharAlloc(settings->ClientAddress, &cbClientAddress);
if (cbClientAddress > (UINT16_MAX / sizeof(WCHAR)))
goto fail;
@ -554,7 +559,7 @@ static BOOL rdp_write_extended_info_packet(rdpRdp* rdp, wStream* s)
Stream_Write_UINT16(s, 0); /* reserved2 (2 bytes) */
}
if (settings->EarlyCapabilityFlags & RNS_UD_CS_SUPPORT_DYNAMIC_TIME_ZONE)
if (freerdp_settings_get_bool(settings, FreeRDP_SupportDynamicTimeZone))
{
if (!Stream_EnsureRemainingCapacity(s, 10 + 254 * sizeof(WCHAR)))
goto fail;