libfreerdp-core: fix sending of extended data blocks when supported only

This commit is contained in:
Marc-André Moreau 2011-12-18 12:10:56 -05:00
parent 8e8d62e067
commit 30e8b63ab6
4 changed files with 13 additions and 6 deletions

View File

@ -208,7 +208,8 @@ struct rdp_settings
uint32 encryption_method; /* 27 */ uint32 encryption_method; /* 27 */
uint32 encryption_level; /* 28 */ uint32 encryption_level; /* 28 */
boolean authentication; /* 29 */ boolean authentication; /* 29 */
uint32 paddingB[48 - 30]; /* 30 */ uint32 negotiationFlags; /* 30 */
uint32 paddingB[48 - 31]; /* 31 */
/* Connection Settings */ /* Connection Settings */
uint32 port; /* 48 */ uint32 port; /* 48 */

View File

@ -350,16 +350,20 @@ boolean gcc_read_client_data_blocks(STREAM* s, rdpSettings *settings, int length
return true; return true;
} }
void gcc_write_client_data_blocks(STREAM* s, rdpSettings *settings) void gcc_write_client_data_blocks(STREAM* s, rdpSettings* settings)
{ {
gcc_write_client_core_data(s, settings); gcc_write_client_core_data(s, settings);
gcc_write_client_cluster_data(s, settings); gcc_write_client_cluster_data(s, settings);
gcc_write_client_security_data(s, settings); gcc_write_client_security_data(s, settings);
gcc_write_client_network_data(s, settings); gcc_write_client_network_data(s, settings);
gcc_write_client_monitor_data(s, settings);
/* extended client data supported */
if (settings->negotiationFlags)
gcc_write_client_monitor_data(s, settings);
} }
boolean gcc_read_server_data_blocks(STREAM* s, rdpSettings *settings, int length) boolean gcc_read_server_data_blocks(STREAM* s, rdpSettings* settings, int length)
{ {
uint16 type; uint16 type;
uint16 offset = 0; uint16 offset = 0;

View File

@ -84,6 +84,7 @@ boolean nego_connect(rdpNego* nego)
/* update settings with negotiated protocol security */ /* update settings with negotiated protocol security */
nego->transport->settings->requested_protocols = nego->requested_protocols; nego->transport->settings->requested_protocols = nego->requested_protocols;
nego->transport->settings->selected_protocol = nego->selected_protocol; nego->transport->settings->selected_protocol = nego->selected_protocol;
nego->transport->settings->negotiationFlags = nego->flags;
if(nego->selected_protocol == PROTOCOL_RDP) if(nego->selected_protocol == PROTOCOL_RDP)
{ {
@ -458,12 +459,11 @@ void nego_process_negotiation_request(rdpNego* nego, STREAM* s)
void nego_process_negotiation_response(rdpNego* nego, STREAM* s) void nego_process_negotiation_response(rdpNego* nego, STREAM* s)
{ {
uint8 flags;
uint16 length; uint16 length;
DEBUG_NEGO("RDP_NEG_RSP"); DEBUG_NEGO("RDP_NEG_RSP");
stream_read_uint8(s, flags); stream_read_uint8(s, nego->flags);
stream_read_uint16(s, length); stream_read_uint16(s, length);
stream_read_uint32(s, nego->selected_protocol); stream_read_uint32(s, nego->selected_protocol);
@ -566,6 +566,7 @@ void nego_init(rdpNego* nego)
nego->requested_protocols = PROTOCOL_RDP; nego->requested_protocols = PROTOCOL_RDP;
nego->transport->recv_callback = nego_recv; nego->transport->recv_callback = nego_recv;
nego->transport->recv_extra = (void*) nego; nego->transport->recv_extra = (void*) nego;
nego->flags = 0;
} }
/** /**

View File

@ -71,6 +71,7 @@ enum RDP_NEG_MSG
struct rdp_nego struct rdp_nego
{ {
int port; int port;
uint32 flags;
char* hostname; char* hostname;
char* cookie; char* cookie;
NEGO_STATE state; NEGO_STATE state;