Cleanup and clarify the implementation of TS_UD_CS_CLUSTER.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1762 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Henrik Andersson 2013-11-28 11:10:35 +00:00
parent 448a16511f
commit 2503dbb9d9
3 changed files with 27 additions and 5 deletions

View File

@ -107,13 +107,24 @@ enum MCS_PDU_TYPE
#define SEC_TAG_CLI_INFO 0xc001
#define SEC_TAG_CLI_CRYPT 0xc002
#define SEC_TAG_CLI_CHANNELS 0xc003
#define SEC_TAG_CLI_4 0xc004
#define SEC_TAG_CLI_CLUSTER 0xc004
#define SEC_TAG_PUBKEY 0x0006
#define SEC_TAG_KEYSIG 0x0008
#define SEC_RSA_MAGIC 0x31415352 /* RSA1 */
/* Client cluster constants */
#define SEC_CC_REDIRECTION_SUPPORTED 0x00000001
#define SEC_CC_REDIRECT_SESSIONID_FIELD_VALID 0x00000002
#define SEC_CC_REDIRECTED_SMARTCARD 0x00000040
#define SEC_CC_REDIRECT_VERSION_MASK 0x0000003c
#define SEC_CC_REDIRECT_VERSION_3 0x02
#define SEC_CC_REDIRECT_VERSION_4 0x03
#define SEC_CC_REDIRECT_VERSION_5 0x04
#define SEC_CC_REDIRECT_VERSION_6 0x05
/* RDP licensing constants */
#define LICENCE_TOKEN_SIZE 10
#define LICENCE_HWID_SIZE 20

View File

@ -122,6 +122,7 @@ char *g_redirect_username;
uint8 *g_redirect_lb_info;
uint32 g_redirect_lb_info_len;
uint32 g_redirect_flags = 0;
uint32 g_redirect_session_id = 0;
uint32 g_reconnect_logonid = 0;
char g_reconnect_random[16];

View File

@ -33,6 +33,7 @@ extern RD_BOOL g_licence_issued;
extern RD_BOOL g_licence_error_result;
extern RDP_VERSION g_rdp_version;
extern RD_BOOL g_console_session;
extern uint32 g_redirect_session_id;
extern int g_server_depth;
extern VCHANNEL g_channels[];
extern unsigned int g_num_channels;
@ -453,10 +454,19 @@ sec_out_mcs_data(STREAM s, uint32 selected_protocol)
out_uint8s(s, 64);
out_uint32_le(s, selected_protocol); /* End of client info */
out_uint16_le(s, SEC_TAG_CLI_4);
out_uint16_le(s, 12);
out_uint32_le(s, g_console_session ? 0xb : 9);
out_uint32(s, 0);
/* Write a Client Cluster Data (TS_UD_CS_CLUSTER) */
uint32 cluster_flags = 0;
out_uint16_le(s, SEC_TAG_CLI_CLUSTER); /* header.type */
out_uint16_le(s, 12); /* length */
cluster_flags |= SEC_CC_REDIRECTION_SUPPORTED;
cluster_flags |= (SEC_CC_REDIRECT_VERSION_3 << 2);
if (g_console_session || g_redirect_session_id != 0)
cluster_flags |= SEC_CC_REDIRECT_SESSIONID_FIELD_VALID;
out_uint32_le(s, cluster_flags);
out_uint32(s, g_redirect_session_id);
/* Client encryption settings */
out_uint16_le(s, SEC_TAG_CLI_CRYPT);