Merge branch 'master' of git@github.com:FreeRDP/FreeRDP-1.0

This commit is contained in:
Jay Sorg 2011-07-08 16:50:34 -07:00
commit 8e2e309678
8 changed files with 73 additions and 41 deletions

View File

@ -154,6 +154,12 @@ void test_gcc_write_client_security_data(void)
s = stream_new(12);
settings = settings_new();
settings->encryption_methods =
ENCRYPTION_40BIT_FLAG |
ENCRYPTION_56BIT_FLAG |
ENCRYPTION_128BIT_FLAG |
ENCRYPTION_FIPS_FLAG;
gcc_write_client_security_data(s, settings);
ASSERT_STREAM(s, (uint8*) gcc_client_security_data_expected, sizeof(gcc_client_security_data_expected));

View File

@ -80,5 +80,7 @@ int main(int argc, char* argv[])
mcs = mcs_new(transport);
mcs_send_connect_initial(mcs);
mcs_recv(mcs);
return 0;
}

View File

@ -23,6 +23,7 @@
#include <freerdp/types.h>
#include <freerdp/utils/unicode.h>
/* Performance Flags */
#define PERF_FLAG_NONE 0x00000000
#define PERF_DISABLE_WALLPAPER 0x00000001
#define PERF_DISABLE_FULLWINDOWDRAG 0x00000002
@ -33,6 +34,12 @@
#define PERF_ENABLE_FONT_SMOOTHING 0x00000080
#define PERF_ENABLE_DESKTOP_COMPOSITION 0x00000100
/* Encryption Methods */
#define ENCRYPTION_40BIT_FLAG 0x00000001
#define ENCRYPTION_128BIT_FLAG 0x00000002
#define ENCRYPTION_56BIT_FLAG 0x00000008
#define ENCRYPTION_FIPS_FLAG 0x00000010
struct rdp_chan
{
char name[8]; /* ui sets */
@ -68,6 +75,7 @@ struct rdp_settings
uint32 kbd_fn_keys;
uint32 client_build;
uint32 selected_protocol;
uint32 encryption_methods;
int console_session;
uint32 redirected_session_id;

View File

@ -202,7 +202,12 @@ void gcc_write_client_core_data(STREAM* s, rdpSettings *settings)
stream_write_uint32(s, 0); /* serialNumber (should be initialized to 0) */
highColorDepth = MIN(settings->color_depth, 24);
supportedColorDepths = RNS_UD_24BPP_SUPPORT | RNS_UD_16BPP_SUPPORT | RNS_UD_15BPP_SUPPORT;
supportedColorDepths =
RNS_UD_32BPP_SUPPORT |
RNS_UD_24BPP_SUPPORT |
RNS_UD_16BPP_SUPPORT |
RNS_UD_15BPP_SUPPORT;
connectionType = 0;
earlyCapabilityFlags = RNS_UD_CS_SUPPORT_ERRINFO_PDU;
@ -250,26 +255,18 @@ void gcc_write_client_core_data(STREAM* s, rdpSettings *settings)
void gcc_write_client_security_data(STREAM* s, rdpSettings *settings)
{
uint16 encryptionMethods;
gcc_write_user_data_header(s, CS_SECURITY, 12);
encryptionMethods =
ENCRYPTION_40BIT_FLAG |
ENCRYPTION_56BIT_FLAG |
ENCRYPTION_128BIT_FLAG |
ENCRYPTION_FIPS_FLAG;
if (settings->encryption > 0)
{
stream_write_uint32(s, encryptionMethods); /* encryptionMethods */
stream_write_uint32(s, settings->encryption_methods); /* encryptionMethods */
stream_write_uint32(s, 0); /* extEncryptionMethods */
}
else
{
/* French locale, disable encryption */
stream_write_uint32(s, 0); /* encryptionMethods */
stream_write_uint32(s, encryptionMethods); /* extEncryptionMethods */
stream_write_uint32(s, settings->encryption_methods); /* extEncryptionMethods */
}
}

View File

@ -85,12 +85,6 @@
#define CONNECTION_TYPE_WAN 0x05
#define CONNECTION_TYPE_LAN 0x06
/* Encryption Methods */
#define ENCRYPTION_40BIT_FLAG 0x00000001
#define ENCRYPTION_128BIT_FLAG 0x00000002
#define ENCRYPTION_56BIT_FLAG 0x00000008
#define ENCRYPTION_FIPS_FLAG 0x00000010
/* Cluster Information Flags */
#define REDIRECTION_SUPPORTED 0x00000001
#define REDIRECTED_SESSIONID_FIELD_VALID 0x00000002

View File

@ -121,12 +121,12 @@ static void mcs_write_domain_parameters(STREAM* s, DOMAIN_PARAMETERS* domainPara
void mcs_write_connect_initial(STREAM* s, rdpMcs* mcs, STREAM* user_data)
{
int length;
uint8 *bm, *em;
int gcc_CCrq_length = stream_get_length(user_data);
length = gcc_CCrq_length + 97;
/* Connect-Initial (APPLICATION 101, IMPLICIT SEQUENCE) */
ber_write_application_tag(s, MCS_TYPE_CONNECT_INITIAL, length);
stream_get_mark(s, bm);
stream_seek(s, 5);
/* callingDomainSelector (OCTET_STRING) */
ber_write_octet_string(s, callingDomainSelector, sizeof(callingDomainSelector));
@ -148,6 +148,26 @@ void mcs_write_connect_initial(STREAM* s, rdpMcs* mcs, STREAM* user_data)
/* userData (OCTET_STRING) */
ber_write_octet_string(s, user_data->data, gcc_CCrq_length);
stream_get_mark(s, em);
length = (em - bm) - 5;
stream_set_mark(s, bm);
/* Connect-Initial (APPLICATION 101, IMPLICIT SEQUENCE) */
ber_write_application_tag(s, MCS_TYPE_CONNECT_INITIAL, length);
stream_set_mark(s, em);
}
int mcs_recv(rdpMcs* mcs)
{
int bytes_read;
int size = 2048;
char *recv_buffer;
recv_buffer = xmalloc(size);
bytes_read = tls_read(mcs->transport->tls, recv_buffer, size);
return 0;
}
void mcs_send_connect_initial(rdpMcs* mcs)

View File

@ -28,14 +28,14 @@
typedef struct
{
uint32 maxChannelIds;
uint32 maxUserIds;
uint32 maxTokenIds;
uint32 numPriorities;
uint32 minThroughput;
uint32 maxHeight;
uint32 maxMCSPDUsize;
uint32 protocolVersion;
uint16 maxChannelIds;
uint16 maxUserIds;
uint16 maxTokenIds;
uint16 numPriorities;
uint16 minThroughput;
uint16 maxHeight;
uint16 maxMCSPDUsize;
uint16 protocolVersion;
} DOMAIN_PARAMETERS;
struct rdp_mcs
@ -54,6 +54,8 @@ void mcs_write_connect_initial(STREAM* s, rdpMcs* mcs, STREAM* user_data);
void mcs_send_connect_initial(rdpMcs* mcs);
int mcs_recv(rdpMcs* mcs);
rdpMcs* mcs_new(rdpTransport* transport);
void mcs_free(rdpMcs* mcs);

View File

@ -37,9 +37,9 @@ rdpSettings* settings_new()
settings->tls_security = 1;
settings->rdp_security = 1;
settings->client_build = 2600;
settings->kbd_type = 4;
settings->kbd_type = 0;
settings->kbd_subtype = 0;
settings->kbd_fn_keys = 12;
settings->kbd_fn_keys = 0;
settings->kbd_layout = 0x409;
settings->encryption = 1;
@ -48,8 +48,11 @@ rdpSettings* settings_new()
PERF_DISABLE_MENUANIMATIONS |
PERF_DISABLE_WALLPAPER;
settings->encryption_methods =
ENCRYPTION_40BIT_FLAG |
ENCRYPTION_128BIT_FLAG;
settings->uniconv = freerdp_uniconv_new();
strcpy(settings->client_product_id, "69712-783-0357974-42714");
gethostname(settings->client_hostname, sizeof(settings->client_hostname) - 1);
}