FreeRDP
gcc.c File Reference
#include <winpr/crt.h>
#include <winpr/crypto.h>
#include <freerdp/log.h>
#include "gcc.h"
#include "certificate.h"

Macros

#define TAG   FREERDP_TAG("core.gcc")
 

Functions

static DWORD rdp_version_common (DWORD serverVersion, DWORD clientVersion)
 
BOOL gcc_read_conference_create_request (wStream *s, rdpMcs *mcs)
 
void gcc_write_conference_create_request (wStream *s, wStream *userData)
 
BOOL gcc_read_conference_create_response (wStream *s, rdpMcs *mcs)
 
void gcc_write_conference_create_response (wStream *s, wStream *userData)
 
BOOL gcc_read_client_data_blocks (wStream *s, rdpMcs *mcs, int length)
 
void gcc_write_client_data_blocks (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_server_data_blocks (wStream *s, rdpMcs *mcs, int length)
 
BOOL gcc_write_server_data_blocks (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_user_data_header (wStream *s, UINT16 *type, UINT16 *length)
 
void gcc_write_user_data_header (wStream *s, UINT16 type, UINT16 length)
 
BOOL gcc_read_client_core_data (wStream *s, rdpMcs *mcs, UINT16 blockLength)
 
void gcc_write_client_core_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_server_core_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_write_server_core_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_client_security_data (wStream *s, rdpMcs *mcs, UINT16 blockLength)
 
void gcc_write_client_security_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_server_security_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_write_server_security_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_client_network_data (wStream *s, rdpMcs *mcs, UINT16 blockLength)
 
void gcc_write_client_network_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_server_network_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_write_server_network_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_client_cluster_data (wStream *s, rdpMcs *mcs, UINT16 blockLength)
 
void gcc_write_client_cluster_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_client_monitor_data (wStream *s, rdpMcs *mcs, UINT16 blockLength)
 
void gcc_write_client_monitor_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_client_monitor_extended_data (wStream *s, rdpMcs *mcs, UINT16 blockLength)
 
void gcc_write_client_monitor_extended_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_client_message_channel_data (wStream *s, rdpMcs *mcs, UINT16 blockLength)
 
void gcc_write_client_message_channel_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_server_message_channel_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_write_server_message_channel_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_client_multitransport_channel_data (wStream *s, rdpMcs *mcs, UINT16 blockLength)
 
void gcc_write_client_multitransport_channel_data (wStream *s, rdpMcs *mcs)
 
BOOL gcc_read_server_multitransport_channel_data (wStream *s, rdpMcs *mcs)
 
void gcc_write_server_multitransport_channel_data (wStream *s, rdpMcs *mcs)
 

Variables

BYTE t124_02_98_oid [6] = { 0, 0, 20, 124, 0, 1 }
 
BYTE h221_cs_key [4] = "Duca"
 
BYTE h221_sc_key [4] = "McDn"
 
static const BYTE initial_signature []
 
const BYTE tssk_modulus []
 
const BYTE tssk_privateExponent []
 
const BYTE tssk_exponent []
 

Macro Definition Documentation

#define TAG   FREERDP_TAG("core.gcc")

FreeRDP: A Remote Desktop Protocol Implementation T.124 Generic Conference Control (GCC)

Copyright 2011 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2014 Norbert Federa norbe.nosp@m.rt.f.nosp@m.edera.nosp@m.@thi.nosp@m.ncast.nosp@m..com Copyright 2014 DI (FH) Martin Haimberger marti.nosp@m.n.ha.nosp@m.imber.nosp@m.ger@.nosp@m.thinc.nosp@m.ast..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

BOOL gcc_read_client_cluster_data ( wStream *  s,
rdpMcs *  mcs,
UINT16  blockLength 
)

Read a client cluster data block (TS_UD_CS_CLUSTER).
http://msdn.microsoft.com/en-us/library/cc240514/

Parameters
sstream
settingsrdp settings

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_client_core_data ( wStream *  s,
rdpMcs *  mcs,
UINT16  blockLength 
)

Read a client core data block (TS_UD_CS_CORE).
http://msdn.microsoft.com/en-us/library/cc240510/

Parameters
sstream
settingsrdp settings

The following fields are all optional. If one field is present, all of the preceding fields MUST also be present. If one field is not present, all of the subsequent fields MUST NOT be present. We must check the bytes left before reading each field.

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_client_data_blocks ( wStream *  s,
rdpMcs *  mcs,
int  length 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_client_message_channel_data ( wStream *  s,
rdpMcs *  mcs,
UINT16  blockLength 
)

Read a client message channel data block (TS_UD_CS_MCS_MSGCHANNEL).
http://msdn.microsoft.com/en-us/library/jj217627/

Parameters
sstream
settingsrdp settings

Here is the caller graph for this function:

BOOL gcc_read_client_monitor_data ( wStream *  s,
rdpMcs *  mcs,
UINT16  blockLength 
)

Read a client monitor data block (TS_UD_CS_MONITOR).
http://msdn.microsoft.com/en-us/library/dd305336/

Parameters
sstream
settingsrdp settings

Here is the caller graph for this function:

BOOL gcc_read_client_monitor_extended_data ( wStream *  s,
rdpMcs *  mcs,
UINT16  blockLength 
)

Here is the caller graph for this function:

BOOL gcc_read_client_multitransport_channel_data ( wStream *  s,
rdpMcs *  mcs,
UINT16  blockLength 
)

Read a client multitransport channel data block (TS_UD_CS_MULTITRANSPORT).
http://msdn.microsoft.com/en-us/library/jj217498/

Parameters
sstream
settingsrdp settings

Here is the caller graph for this function:

BOOL gcc_read_client_network_data ( wStream *  s,
rdpMcs *  mcs,
UINT16  blockLength 
)

Read a client network data block (TS_UD_CS_NET).
http://msdn.microsoft.com/en-us/library/cc240512/

Parameters
sstream
settingsrdp settings

CHANNEL_DEF

  • name: an 8-byte array containing a null-terminated collection of seven ANSI characters that uniquely identify the channel.
  • options: a 32-bit, unsigned integer. Channel option flags

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_client_security_data ( wStream *  s,
rdpMcs *  mcs,
UINT16  blockLength 
)

Read a client security data block (TS_UD_CS_SEC).
http://msdn.microsoft.com/en-us/library/cc240511/

Parameters
sstream
settingsrdp settings

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_conference_create_request ( wStream *  s,
rdpMcs *  mcs 
)

Read a GCC Conference Create Request.
http://msdn.microsoft.com/en-us/library/cc240836/

Parameters
sstream
settingsrdp settings

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_conference_create_response ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_server_core_data ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_server_data_blocks ( wStream *  s,
rdpMcs *  mcs,
int  length 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_server_message_channel_data ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_server_multitransport_channel_data ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_server_network_data ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_server_security_data ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_read_user_data_header ( wStream *  s,
UINT16 type,
UINT16 length 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_client_cluster_data ( wStream *  s,
rdpMcs *  mcs 
)

Write a client cluster data block (TS_UD_CS_CLUSTER).
http://msdn.microsoft.com/en-us/library/cc240514/

Parameters
sstream
settingsrdp settings

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_client_core_data ( wStream *  s,
rdpMcs *  mcs 
)

Write a client core data block (TS_UD_CS_CORE).
http://msdn.microsoft.com/en-us/library/cc240510/

Parameters
sstream
settingsrdp settings

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_client_data_blocks ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_client_message_channel_data ( wStream *  s,
rdpMcs *  mcs 
)

Write a client message channel data block (TS_UD_CS_MCS_MSGCHANNEL).
http://msdn.microsoft.com/en-us/library/jj217627/

Parameters
sstream
settingsrdp settings

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_client_monitor_data ( wStream *  s,
rdpMcs *  mcs 
)

Write a client monitor data block (TS_UD_CS_MONITOR).
http://msdn.microsoft.com/en-us/library/dd305336/

Parameters
sstream
settingsrdp settings

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_client_monitor_extended_data ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_client_multitransport_channel_data ( wStream *  s,
rdpMcs *  mcs 
)

Write a client multitransport channel data block (TS_UD_CS_MULTITRANSPORT).
http://msdn.microsoft.com/en-us/library/jj217498/

Parameters
sstream
settingsrdp settings

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_client_network_data ( wStream *  s,
rdpMcs *  mcs 
)

Write a client network data block (TS_UD_CS_NET).
http://msdn.microsoft.com/en-us/library/cc240512/

Parameters
sstream
settingsrdp settings

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_client_security_data ( wStream *  s,
rdpMcs *  mcs 
)

Write a client security data block (TS_UD_CS_SEC).
http://msdn.microsoft.com/en-us/library/cc240511/

Parameters
sstream
settingsrdp settings

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_conference_create_request ( wStream *  s,
wStream *  userData 
)

Write a GCC Conference Create Request.
http://msdn.microsoft.com/en-us/library/cc240836/

Parameters
sstream
user_dataclient data blocks

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_conference_create_response ( wStream *  s,
wStream *  userData 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_write_server_core_data ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_write_server_data_blocks ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_write_server_message_channel_data ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_server_multitransport_channel_data ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

BOOL gcc_write_server_network_data ( wStream *  s,
rdpMcs *  mcs 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL gcc_write_server_security_data ( wStream *  s,
rdpMcs *  mcs 
)

Re: settings->EncryptionLevel: This is configured/set by the server implementation and serves the same purpose as the "Encryption Level" setting in the RDP-Tcp configuration dialog of Microsoft's Remote Desktop Session Host Configuration. Re: settings->EncryptionMethods: at this point this setting contains the client's supported encryption methods we've received in gcc_read_client_security_data()

Here is the call graph for this function:

Here is the caller graph for this function:

void gcc_write_user_data_header ( wStream *  s,
UINT16  type,
UINT16  length 
)

Write a user data header (TS_UD_HEADER).
http://msdn.microsoft.com/en-us/library/cc240509/

Parameters
sstream
typedata block type
lengthdata block length

Here is the call graph for this function:

Here is the caller graph for this function:

static DWORD rdp_version_common ( DWORD  serverVersion,
DWORD  clientVersion 
)
static

Here is the caller graph for this function:

Variable Documentation

BYTE h221_cs_key[4] = "Duca"
BYTE h221_sc_key[4] = "McDn"
const BYTE initial_signature[]
static
Initial value:
=
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01
}
BYTE t124_02_98_oid[6] = { 0, 0, 20, 124, 0, 1 }

T.124 GCC is defined in:

http://www.itu.int/rec/T-REC-T.124-199802-S/en ITU-T T.124 (02/98): Generic Conference Control ConnectData ::= SEQUENCE { t124Identifier Key, connectPDU OCTET_STRING }

Key ::= CHOICE { object OBJECT_IDENTIFIER, h221NonStandard H221NonStandardIdentifier }

ConnectGCCPDU ::= CHOICE { conferenceCreateRequest ConferenceCreateRequest, conferenceCreateResponse ConferenceCreateResponse, conferenceQueryRequest ConferenceQueryRequest, conferenceQueryResponse ConferenceQueryResponse, conferenceJoinRequest ConferenceJoinRequest, conferenceJoinResponse ConferenceJoinResponse, conferenceInviteRequest ConferenceInviteRequest, conferenceInviteResponse ConferenceInviteResponse, ... }

ConferenceCreateRequest ::= SEQUENCE { conferenceName ConferenceName, convenerPassword Password OPTIONAL, password Password OPTIONAL, lockedConference BOOLEAN, listedConference BOOLEAN, conductibleConference BOOLEAN, terminationMethod TerminationMethod, conductorPrivileges SET OF Privilege OPTIONAL, conductedPrivileges SET OF Privilege OPTIONAL, nonConductedPrivileges SET OF Privilege OPTIONAL, conferenceDescription TextString OPTIONAL, callerIdentifier TextString OPTIONAL, userData UserData OPTIONAL, ..., conferencePriority ConferencePriority OPTIONAL, conferenceMode ConferenceMode OPTIONAL }

ConferenceCreateResponse ::= SEQUENCE { nodeID UserID, tag INTEGER, result ENUMERATED { success (0), userRejected (1), resourcesNotAvailable (2), rejectedForSymmetryBreaking (3), lockedConferenceNotSupported (4) }, userData UserData OPTIONAL, ... }

ConferenceName ::= SEQUENCE { numeric SimpleNumericString text SimpleTextString OPTIONAL, ... }

SimpleNumericString ::= NumericString (SIZE (1..255)) (FROM ("0123456789"))

UserData ::= SET OF SEQUENCE { key Key, value OCTET_STRING OPTIONAL }

H221NonStandardIdentifier ::= OCTET STRING (SIZE (4..255))

UserID ::= DynamicChannelID

ChannelID ::= INTEGER (1..65535) StaticChannelID ::= INTEGER (1..1000) DynamicChannelID ::= INTEGER (1001..65535)

const BYTE tssk_exponent[]
Initial value:
=
{
0x5b, 0x7b, 0x88, 0xc0
}
const BYTE tssk_modulus[]
Initial value:
=
{
0x3d, 0x3a, 0x5e, 0xbd, 0x72, 0x43, 0x3e, 0xc9,
0x4d, 0xbb, 0xc1, 0x1e, 0x4a, 0xba, 0x5f, 0xcb,
0x3e, 0x88, 0x20, 0x87, 0xef, 0xf5, 0xc1, 0xe2,
0xd7, 0xb7, 0x6b, 0x9a, 0xf2, 0x52, 0x45, 0x95,
0xce, 0x63, 0x65, 0x6b, 0x58, 0x3a, 0xfe, 0xef,
0x7c, 0xe7, 0xbf, 0xfe, 0x3d, 0xf6, 0x5c, 0x7d,
0x6c, 0x5e, 0x06, 0x09, 0x1a, 0xf5, 0x61, 0xbb,
0x20, 0x93, 0x09, 0x5f, 0x05, 0x6d, 0xea, 0x87
}
const BYTE tssk_privateExponent[]
Initial value:
=
{
0x87, 0xa7, 0x19, 0x32, 0xda, 0x11, 0x87, 0x55,
0x58, 0x00, 0x16, 0x16, 0x25, 0x65, 0x68, 0xf8,
0x24, 0x3e, 0xe6, 0xfa, 0xe9, 0x67, 0x49, 0x94,
0xcf, 0x92, 0xcc, 0x33, 0x99, 0xe8, 0x08, 0x60,
0x17, 0x9a, 0x12, 0x9f, 0x24, 0xdd, 0xb1, 0x24,
0x99, 0xc7, 0x3a, 0xb8, 0x0a, 0x7b, 0x0d, 0xdd,
0x35, 0x07, 0x79, 0x17, 0x0b, 0x51, 0x9b, 0xb3,
0xc7, 0x10, 0x01, 0x13, 0xe7, 0x3f, 0xf3, 0x5f
}