Merge branch 'master' of github.com:FreeRDP/FreeRDP-1.0
This commit is contained in:
commit
c860fd631d
@ -75,8 +75,7 @@ static int drdynvc_write_variable_uint(STREAM* stream, uint32 val)
|
||||
int drdynvc_write_data(drdynvcPlugin* drdynvc, uint32 ChannelId, char* data, uint32 data_size)
|
||||
{
|
||||
STREAM* data_out;
|
||||
uint32 pos;
|
||||
uint32 t;
|
||||
uint32 pos = 0;
|
||||
uint32 cbChId;
|
||||
uint32 cbLen;
|
||||
uint32 chunk_len;
|
||||
@ -209,7 +208,7 @@ static int drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, int cb
|
||||
pos = stream_get_pos(data_in);
|
||||
DEBUG_DVC("ChannelId=%d ChannelName=%s", ChannelId, stream_get_tail(data_in));
|
||||
|
||||
error = dvcman_create_channel(drdynvc->channel_mgr, ChannelId, stream_get_tail(data_in));
|
||||
error = dvcman_create_channel(drdynvc->channel_mgr, ChannelId, (char*)stream_get_tail(data_in));
|
||||
|
||||
data_out = stream_new(pos + 4);
|
||||
stream_write_uint8(data_out, 0x10 | cbChId);
|
||||
@ -271,7 +270,6 @@ static int drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, STRE
|
||||
|
||||
static int drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* data_in)
|
||||
{
|
||||
int pos;
|
||||
uint32 ChannelId;
|
||||
|
||||
ChannelId = drdynvc_read_variable_uint(data_in, cbChId);
|
||||
|
@ -318,8 +318,8 @@ int dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, uint32 Channel
|
||||
if (listener->listener_callback->OnNewChannelConnection(listener->listener_callback,
|
||||
(IWTSVirtualChannel*)channel, NULL, &bAccept, &pCallback) == 0 && bAccept == 1)
|
||||
{
|
||||
DEBUG_PRINT("DVC", "listener %s created new channel %d",
|
||||
listener->channel_name, channel->channel_id);
|
||||
DEBUG_DVC("listener %s created new channel %d",
|
||||
listener->channel_name, channel->channel_id);
|
||||
channel->channel_callback = pCallback;
|
||||
dvcman_channel_list_add(dvcman->channels, item);
|
||||
return 0;
|
||||
|
@ -34,7 +34,7 @@
|
||||
} while(0)
|
||||
|
||||
#define STRING_COPY(_str) do { \
|
||||
settings->_str = (uint8*) xmalloc(strlen(argv[*i])); \
|
||||
settings->_str = xmalloc(strlen(argv[*i]) + 1); \
|
||||
memcpy(settings->_str, argv[*i], strlen(argv[*i])); \
|
||||
settings->_str[strlen(argv[*i])] = '\0'; \
|
||||
} while(0)
|
||||
@ -145,10 +145,10 @@ boolean freerdp_process_params(int argc, char* argv[], rdpSettings* settings, in
|
||||
&& (p[1] == 0 || (p[1] == ':' && !strchr(p + 2, ':'))))
|
||||
{
|
||||
/* Either "[...]" or "[...]:..." with at most one : after the brackets */
|
||||
settings->hostname = (uint8*) xmalloc(strlen(argv[*i] + 1));
|
||||
settings->hostname = (char*) xmalloc(strlen(argv[*i]) + 1);
|
||||
strncpy(settings->hostname, argv[*i] + 1, strlen(argv[*i] + 1));
|
||||
|
||||
if ((p = strchr(settings->hostname, ']')))
|
||||
if ((p = strchr((const char*)settings->hostname, ']')))
|
||||
{
|
||||
*p = 0;
|
||||
if (p[1] == ':')
|
||||
@ -158,8 +158,9 @@ boolean freerdp_process_params(int argc, char* argv[], rdpSettings* settings, in
|
||||
else
|
||||
{
|
||||
/* Port number is cut off and used if exactly one : in the string */
|
||||
settings->hostname = (uint8*) xmalloc(strlen(argv[*i]));
|
||||
settings->hostname = (char*) xmalloc(strlen(argv[*i]) + 1);
|
||||
strncpy(settings->hostname, argv[*i], strlen(argv[*i]));
|
||||
settings->hostname[strlen(argv[*i])] = '\0';
|
||||
|
||||
if ((p = strchr(settings->hostname, ':')) && !strchr(p + 1, ':'))
|
||||
{
|
||||
|
@ -18,6 +18,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
include_directories(${CUNIT_INCLUDE_DIRS})
|
||||
include_directories(${CMAKE_SOURCE_DIR}) # for some internal tests
|
||||
|
||||
include_directories(../libfreerdp-core)
|
||||
include_directories(../libfreerdp-gdi)
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <freerdp/utils/stream.h>
|
||||
|
||||
#include "test_ber.h"
|
||||
#include "libfreerdp-core/ber.h"
|
||||
|
||||
int init_ber_suite(void)
|
||||
{
|
||||
@ -72,7 +73,7 @@ void test_ber_write_universal_tag(void)
|
||||
STREAM* s;
|
||||
|
||||
s = stream_new(sizeof(ber_universal_tag_expected));
|
||||
ber_write_universal_tag(s, 1);
|
||||
ber_write_universal_tag(s, 1, False);
|
||||
|
||||
ASSERT_STREAM(s, (uint8*) ber_universal_tag_expected, sizeof(ber_universal_tag_expected));
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/utils/hexdump.h>
|
||||
#include <freerdp/utils/stream.h>
|
||||
#include "libfreerdp-core/bitmap.h"
|
||||
|
||||
#include "test_bitmap.h"
|
||||
|
||||
|
@ -48,7 +48,7 @@ int add_chanman_suite(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int test_rdp_channel_data(rdpInst* inst, int chan_id, char* data, int data_size)
|
||||
static int test_rdp_channel_data(rdpInst* inst, int chan_id, uint8* data, int data_size)
|
||||
{
|
||||
printf("chan_id %d data_size %d\n", chan_id, data_size);
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ static const uint8 test_data_response_data[] =
|
||||
"\x6F\x00\x20\x00\x77\x00\x6F\x00\x72\x00\x6c\x00\x64\x00\x00\x00"
|
||||
};
|
||||
|
||||
static int test_rdp_channel_data(rdpInst* inst, int chan_id, char* data, int data_size)
|
||||
static int test_rdp_channel_data(rdpInst* inst, int chan_id, uint8* data, int data_size)
|
||||
{
|
||||
printf("chan_id %d data_size %d\n", chan_id, data_size);
|
||||
freerdp_hexdump(data, data_size);
|
||||
@ -198,7 +198,7 @@ void test_cliprdr(void)
|
||||
event = freerdp_event_new(FRDP_EVENT_TYPE_CB_DATA_RESPONSE, event_process_callback, NULL);
|
||||
data_response_event = (FRDP_CB_DATA_RESPONSE_EVENT*)event;
|
||||
data_response_event->data = (uint8*)xmalloc(6);
|
||||
strcpy(data_response_event->data, "hello");
|
||||
strcpy((char*)data_response_event->data, "hello");
|
||||
data_response_event->size = 6;
|
||||
event_processed = 0;
|
||||
freerdp_chanman_send_event(chan_man, "cliprdr", event);
|
||||
|
@ -57,7 +57,7 @@ static const uint8 test_capability_request_data[] =
|
||||
|
||||
static int data_received = 0;
|
||||
|
||||
static int test_rdp_channel_data(rdpInst* inst, int chan_id, char* data, int data_size)
|
||||
static int test_rdp_channel_data(rdpInst* inst, int chan_id, uint8* data, int data_size)
|
||||
{
|
||||
printf("chan_id %d data_size %d\n", chan_id, data_size);
|
||||
freerdp_hexdump(data, data_size);
|
||||
@ -69,7 +69,6 @@ void test_drdynvc(void)
|
||||
rdpChanMan* chan_man;
|
||||
rdpSettings settings = { 0 };
|
||||
rdpInst inst = { 0 };
|
||||
int i;
|
||||
|
||||
settings.hostname = "testhost";
|
||||
inst.settings = &settings;
|
||||
|
@ -65,7 +65,6 @@ void dump_data(unsigned char * p, int len, int width, char* name)
|
||||
void assert_stream(STREAM* s, uint8* data, int length, const char* func, int line)
|
||||
{
|
||||
int i;
|
||||
char* str;
|
||||
int actual_length;
|
||||
uint8* actual_data;
|
||||
|
||||
|
@ -134,6 +134,8 @@ void test_gcc_write_client_core_data(void)
|
||||
settings->rdp_version = 5;
|
||||
settings->color_depth = 24;
|
||||
settings->kbd_layout = 0x409;
|
||||
settings->kbd_type = 0x04;
|
||||
settings->kbd_fn_keys = 12;
|
||||
settings->client_build = 3790;
|
||||
strcpy(settings->client_hostname, "ELTONS-DEV2");
|
||||
strcpy(settings->client_product_id, "69712-783-0357974-42714");
|
||||
@ -154,6 +156,7 @@ void test_gcc_write_client_security_data(void)
|
||||
s = stream_new(12);
|
||||
settings = settings_new();
|
||||
|
||||
settings->encryption = 1; /* turn on encryption */
|
||||
settings->encryption_method =
|
||||
ENCRYPTION_METHOD_40BIT |
|
||||
ENCRYPTION_METHOD_56BIT |
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <freerdp/utils/stream.h>
|
||||
|
||||
#include "test_per.h"
|
||||
#include "libfreerdp-core/per.h"
|
||||
|
||||
int init_per_suite(void)
|
||||
{
|
||||
|
@ -56,20 +56,20 @@ int add_transport_suite(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int test_finished = 0;
|
||||
|
||||
static int
|
||||
packet_received(rdpTransport * transport, STREAM * stream, void * extra)
|
||||
{
|
||||
#if 0
|
||||
uint16 length;
|
||||
length = tpkt_read_header(stream);
|
||||
CU_ASSERT(length == 19);
|
||||
freerdp_hexdump(stream->data, length);
|
||||
test_finished = 1;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void test_transport(void)
|
||||
{
|
||||
|
@ -19,9 +19,9 @@
|
||||
|
||||
#include "test_freerdp.h"
|
||||
|
||||
int init_list_suite(void);
|
||||
int clean_list_suite(void);
|
||||
int add_list_suite(void);
|
||||
int init_utils_suite(void);
|
||||
int clean_utils_suite(void);
|
||||
int add_utils_suite(void);
|
||||
|
||||
void test_mutex(void);
|
||||
void test_semaphore(void);
|
||||
|
@ -128,7 +128,7 @@ struct _IWTSVirtualChannelCallback
|
||||
/* Notifies the user about data that is being received. */
|
||||
int (*OnDataReceived) (IWTSVirtualChannelCallback* pChannelCallback,
|
||||
uint32 cbSize,
|
||||
char* pBuffer);
|
||||
uint8* pBuffer);
|
||||
/* Notifies the user that the channel has been closed. */
|
||||
int (*OnClose) (IWTSVirtualChannelCallback* pChannelCallback);
|
||||
};
|
||||
|
@ -54,8 +54,8 @@ struct rdp_inst
|
||||
int (* rdp_send_input_unicode)(rdpInst * inst, uint16 character);
|
||||
int (* rdp_send_input_mouse)(rdpInst * inst, uint16 pointerFlags, uint16 xPos, uint16 yPos);
|
||||
int (* rdp_sync_input)(rdpInst * inst, int toggle_flags);
|
||||
int (* rdp_channel_data)(rdpInst * inst, int chan_id, char * data, int data_size);
|
||||
void (*rdp_suppress_output)(rdpInst * inst, int allow_display_updates);
|
||||
int (* rdp_channel_data)(rdpInst * inst, int chan_id, uint8 * data, int data_size);
|
||||
void (* rdp_suppress_output)(rdpInst * inst, int allow_display_updates);
|
||||
void (* rdp_disconnect)(rdpInst * inst);
|
||||
int (* rdp_send_frame_ack)(rdpInst * inst, int frame_id);
|
||||
/* calls from library to ui */
|
||||
|
@ -69,10 +69,10 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
uint32 bias;
|
||||
uint8 standardName[32];
|
||||
char standardName[32];
|
||||
SYSTEM_TIME standardDate;
|
||||
uint32 standardBias;
|
||||
uint8 daylightName[32];
|
||||
char daylightName[32];
|
||||
SYSTEM_TIME daylightDate;
|
||||
uint32 daylightBias;
|
||||
} TIME_ZONE_INFORMATION;
|
||||
@ -153,20 +153,20 @@ struct rdp_settings
|
||||
char client_product_id[32];
|
||||
|
||||
uint16 port;
|
||||
uint8* hostname;
|
||||
uint8* username;
|
||||
uint8* password;
|
||||
uint8* domain;
|
||||
uint8* shell;
|
||||
uint8* directory;
|
||||
char* hostname;
|
||||
char* username;
|
||||
char* password;
|
||||
char* domain;
|
||||
char* shell;
|
||||
char* directory;
|
||||
uint32 performance_flags;
|
||||
|
||||
boolean autologon;
|
||||
boolean compression;
|
||||
|
||||
boolean ipv6;
|
||||
uint8* ip_address;
|
||||
uint8* client_dir;
|
||||
char* ip_address;
|
||||
char* client_dir;
|
||||
TIME_ZONE_INFORMATION client_time_zone;
|
||||
|
||||
boolean auto_reconnection;
|
||||
|
@ -90,7 +90,7 @@ boolean ber_read_universal_tag(STREAM* s, uint8 tag, boolean pc)
|
||||
|
||||
stream_read_uint8(s, byte);
|
||||
|
||||
if (byte != (BER_CLASS_UNIV | BER_PC(pc)) | (BER_TAG_MASK & tag))
|
||||
if (byte != (BER_CLASS_UNIV | BER_PC(pc) | (BER_TAG_MASK & tag)))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
@ -100,6 +100,7 @@ boolean ber_read_universal_tag(STREAM* s, uint8 tag, boolean pc)
|
||||
* Write BER Universal tag.
|
||||
* @param s stream
|
||||
* @param tag BER universally-defined tag
|
||||
* @param pc primitive (False) or constructed (True)
|
||||
*/
|
||||
|
||||
void ber_write_universal_tag(STREAM* s, uint8 tag, boolean pc)
|
||||
|
@ -795,8 +795,6 @@ void rdp_write_glyph_cache_capability_set(STREAM* s, rdpSettings* settings)
|
||||
void rdp_read_offscreen_bitmap_cache_capability_set(STREAM* s, rdpSettings* settings)
|
||||
{
|
||||
uint32 offscreenSupportLevel;
|
||||
uint16 offscreenCacheSize;
|
||||
uint16 offscreenCacheEntries;
|
||||
|
||||
stream_read_uint32(s, offscreenSupportLevel); /* offscreenSupportLevel (4 bytes) */
|
||||
stream_read_uint16(s, settings->offscreen_bitmap_cache_size); /* offscreenCacheSize (2 bytes) */
|
||||
@ -977,8 +975,6 @@ void rdp_write_virtual_channel_capability_set(STREAM* s, rdpSettings* settings)
|
||||
void rdp_read_draw_nine_grid_cache_capability_set(STREAM* s, rdpSettings* settings)
|
||||
{
|
||||
uint32 drawNineGridSupportLevel;
|
||||
uint16 drawNineGridCacheSize;
|
||||
uint16 drawNineGridCacheEntries;
|
||||
|
||||
stream_read_uint32(s, drawNineGridSupportLevel); /* drawNineGridSupportLevel (4 bytes) */
|
||||
stream_read_uint16(s, settings->draw_nine_grid_cache_size); /* drawNineGridCacheSize (2 bytes) */
|
||||
|
@ -119,7 +119,6 @@ void certificate_read_x509_certificate(CERT_BLOB* cert, CERT_INFO* info)
|
||||
int length;
|
||||
uint8 padding;
|
||||
uint32 version;
|
||||
uint8 exponent[4];
|
||||
int modulus_length;
|
||||
int exponent_length;
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "connection.h"
|
||||
#include "info.h"
|
||||
|
||||
/**
|
||||
* Connection Sequence
|
||||
|
@ -144,7 +144,7 @@ void gcc_write_conference_create_request(STREAM* s, STREAM* user_data)
|
||||
per_write_selection(s, 0x08); /* select optional userData from ConferenceCreateRequest */
|
||||
|
||||
/* ConferenceCreateRequest::conferenceName */
|
||||
per_write_numeric_string(s, "1", 1, 1); /* ConferenceName::numeric */
|
||||
per_write_numeric_string(s, (uint8*)"1", 1, 1); /* ConferenceName::numeric */
|
||||
per_write_padding(s, 1); /* padding */
|
||||
|
||||
/* UserData (SET OF SEQUENCE) */
|
||||
@ -160,12 +160,11 @@ void gcc_write_conference_create_request(STREAM* s, STREAM* user_data)
|
||||
|
||||
void gcc_read_conference_create_response(STREAM* s, rdpSettings* settings)
|
||||
{
|
||||
int length;
|
||||
uint16 length;
|
||||
uint32 tag;
|
||||
uint16 nodeID;
|
||||
uint8 result;
|
||||
uint8 choice;
|
||||
uint8 selection;
|
||||
uint8 number;
|
||||
|
||||
/* ConnectData */
|
||||
@ -272,13 +271,13 @@ void gcc_write_user_data_header(STREAM* s, uint16 type, uint16 length)
|
||||
void gcc_write_client_core_data(STREAM* s, rdpSettings *settings)
|
||||
{
|
||||
uint32 version;
|
||||
uint8* clientName;
|
||||
char* clientName;
|
||||
size_t clientNameLength;
|
||||
uint8 connectionType;
|
||||
uint16 highColorDepth;
|
||||
uint16 supportedColorDepths;
|
||||
uint16 earlyCapabilityFlags;
|
||||
uint8* clientDigProductId;
|
||||
char* clientDigProductId;
|
||||
size_t clientDigProductIdLength;
|
||||
|
||||
gcc_write_user_data_header(s, CS_CORE, 216);
|
||||
@ -319,7 +318,6 @@ void gcc_write_client_core_data(STREAM* s, rdpSettings *settings)
|
||||
highColorDepth = MIN(settings->color_depth, 24);
|
||||
|
||||
supportedColorDepths =
|
||||
RNS_UD_32BPP_SUPPORT |
|
||||
RNS_UD_24BPP_SUPPORT |
|
||||
RNS_UD_16BPP_SUPPORT |
|
||||
RNS_UD_15BPP_SUPPORT;
|
||||
|
@ -117,10 +117,10 @@ void rdp_write_client_time_zone(STREAM* s, rdpSettings* settings)
|
||||
rdp_get_client_time_zone(s, settings);
|
||||
clientTimeZone = &settings->client_time_zone;
|
||||
|
||||
standardName = freerdp_uniconv_out(settings->uniconv, clientTimeZone->standardName, &length);
|
||||
standardName = (uint8*)freerdp_uniconv_out(settings->uniconv, clientTimeZone->standardName, &length);
|
||||
standardNameLength = length;
|
||||
|
||||
daylightName = freerdp_uniconv_out(settings->uniconv, clientTimeZone->daylightName, &length);
|
||||
daylightName = (uint8*)freerdp_uniconv_out(settings->uniconv, clientTimeZone->daylightName, &length);
|
||||
daylightNameLength = length;
|
||||
|
||||
if (standardNameLength > 62)
|
||||
@ -204,10 +204,10 @@ void rdp_write_extended_info_packet(STREAM* s, rdpSettings* settings)
|
||||
|
||||
clientAddressFamily = settings->ipv6 ? ADDRESS_FAMILY_INET6 : ADDRESS_FAMILY_INET;
|
||||
|
||||
clientAddress = freerdp_uniconv_out(settings->uniconv, settings->ip_address, &length);
|
||||
clientAddress = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->ip_address, &length);
|
||||
cbClientAddress = length;
|
||||
|
||||
clientDir = freerdp_uniconv_out(settings->uniconv, settings->client_dir, &length);
|
||||
clientDir = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->client_dir, &length);
|
||||
cbClientDir = length;
|
||||
|
||||
cbAutoReconnectLen = settings->client_auto_reconnect_cookie.cbLen;
|
||||
@ -283,19 +283,19 @@ void rdp_write_info_packet(STREAM* s, rdpSettings* settings)
|
||||
if (settings->compression)
|
||||
flags |= INFO_COMPRESSION | PACKET_COMPR_TYPE_64K;
|
||||
|
||||
domain = freerdp_uniconv_out(settings->uniconv, settings->domain, &length);
|
||||
domain = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->domain, &length);
|
||||
cbDomain = length;
|
||||
|
||||
userName = freerdp_uniconv_out(settings->uniconv, settings->username, &length);
|
||||
userName = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->username, &length);
|
||||
cbUserName = length;
|
||||
|
||||
password = freerdp_uniconv_out(settings->uniconv, settings->password, &length);
|
||||
password = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->password, &length);
|
||||
cbPassword = length;
|
||||
|
||||
alternateShell = freerdp_uniconv_out(settings->uniconv, settings->shell, &length);
|
||||
alternateShell = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->shell, &length);
|
||||
cbAlternateShell = length;
|
||||
|
||||
workingDir = freerdp_uniconv_out(settings->uniconv, settings->directory, &length);
|
||||
workingDir = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->directory, &length);
|
||||
cbWorkingDir = length;
|
||||
|
||||
stream_write_uint32(s, 0); /* CodePage */
|
||||
@ -397,7 +397,6 @@ void rdp_recv_logon_error_info(rdpRdp* rdp, STREAM* s)
|
||||
|
||||
void rdp_recv_logon_info_extended(rdpRdp* rdp, STREAM* s)
|
||||
{
|
||||
uint8* m;
|
||||
uint32 cbFieldData;
|
||||
uint32 fieldsPresent;
|
||||
|
||||
|
@ -207,8 +207,6 @@ void license_generate_randoms(rdpLicense* license)
|
||||
|
||||
void license_generate_keys(rdpLicense* license)
|
||||
{
|
||||
int paddingLength;
|
||||
|
||||
security_master_secret(license->premaster_secret, license->client_random,
|
||||
license->server_random, license->master_secret); /* MasterSecret */
|
||||
|
||||
@ -540,9 +538,6 @@ void license_read_license_request_packet(rdpLicense* license, STREAM* s)
|
||||
|
||||
void license_read_platform_challenge_packet(rdpLicense* license, STREAM* s)
|
||||
{
|
||||
CryptoRc4 rc4;
|
||||
uint8* platform_challenge;
|
||||
|
||||
DEBUG_LICENSE("Receiving Platform Challenge Packet");
|
||||
|
||||
stream_seek(s, 4); /* ConnectFlags, Reserved (4 bytes) */
|
||||
@ -675,10 +670,10 @@ void license_send_new_license_request_packet(rdpLicense* license)
|
||||
s = license_send_stream_init(license);
|
||||
DEBUG_LICENSE("Sending New License Request Packet");
|
||||
|
||||
license->client_user_name->data = license->rdp->settings->username;
|
||||
license->client_user_name->length = strlen(license->rdp->settings->username);
|
||||
license->client_user_name->data = (uint8*)license->rdp->settings->username;
|
||||
license->client_user_name->length = strlen((char*)license->rdp->settings->username);
|
||||
|
||||
license->client_machine_name->data = license->rdp->settings->client_hostname;
|
||||
license->client_machine_name->data = (uint8*)license->rdp->settings->client_hostname;
|
||||
license->client_machine_name->length = strlen(license->rdp->settings->client_hostname);
|
||||
|
||||
license_write_new_license_request_packet(license, s);
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include "gcc.h"
|
||||
|
||||
#include "mcs.h"
|
||||
#include "tpdu.h"
|
||||
#include "tpkt.h"
|
||||
|
||||
/**
|
||||
* T.125 MCS is defined in:
|
||||
|
@ -137,6 +137,8 @@ void mcs_send_attach_user_request(rdpMcs* mcs);
|
||||
void mcs_recv_attach_user_confirm(rdpMcs* mcs);
|
||||
void mcs_send_channel_join_request(rdpMcs* mcs, uint16 channel_id);
|
||||
void mcs_recv_channel_join_confirm(rdpMcs* mcs);
|
||||
boolean mcs_read_domain_mcspdu_header(STREAM* s, enum DomainMCSPDU* domainMCSPDU, int* length);
|
||||
void mcs_write_domain_mcspdu_header(STREAM* s, enum DomainMCSPDU domainMCSPDU, int length);
|
||||
|
||||
rdpMcs* mcs_new(rdpTransport* transport);
|
||||
void mcs_free(rdpMcs* mcs);
|
||||
|
@ -134,7 +134,6 @@ int nego_tcp_disconnect(rdpNego* nego)
|
||||
|
||||
void nego_attempt_nla(rdpNego* nego)
|
||||
{
|
||||
uint8 code;
|
||||
nego->requested_protocols = PROTOCOL_NLA | PROTOCOL_TLS;
|
||||
|
||||
DEBUG_NEGO("Attempting NLA security");
|
||||
@ -164,7 +163,6 @@ void nego_attempt_nla(rdpNego* nego)
|
||||
|
||||
void nego_attempt_tls(rdpNego* nego)
|
||||
{
|
||||
uint8 code;
|
||||
nego->requested_protocols = PROTOCOL_TLS;
|
||||
|
||||
DEBUG_NEGO("Attempting TLS security");
|
||||
@ -192,7 +190,6 @@ void nego_attempt_tls(rdpNego* nego)
|
||||
|
||||
void nego_attempt_rdp(rdpNego* nego)
|
||||
{
|
||||
uint8 code;
|
||||
nego->requested_protocols = PROTOCOL_RDP;
|
||||
|
||||
DEBUG_NEGO("Attempting RDP security");
|
||||
@ -296,7 +293,7 @@ void nego_send_negotiation_request(rdpNego* nego)
|
||||
{
|
||||
int cookie_length = strlen(nego->cookie);
|
||||
stream_write(s, "Cookie: mstshash=", 17);
|
||||
stream_write(s, nego->cookie, cookie_length);
|
||||
stream_write(s, (uint8*)nego->cookie, cookie_length);
|
||||
stream_write_uint8(s, 0x0D); /* CR */
|
||||
stream_write_uint8(s, 0x0A); /* LF */
|
||||
length += cookie_length + 19;
|
||||
|
@ -26,7 +26,7 @@
|
||||
* @return
|
||||
*/
|
||||
|
||||
boolean per_read_length(STREAM* s, int* length)
|
||||
boolean per_read_length(STREAM* s, uint16* length)
|
||||
{
|
||||
uint8 byte;
|
||||
|
||||
@ -156,7 +156,7 @@ void per_write_padding(STREAM* s, int length)
|
||||
|
||||
boolean per_read_integer(STREAM* s, uint32* integer)
|
||||
{
|
||||
int length;
|
||||
uint16 length;
|
||||
|
||||
per_read_length(s, &length);
|
||||
|
||||
@ -178,8 +178,6 @@ boolean per_read_integer(STREAM* s, uint32* integer)
|
||||
|
||||
void per_write_integer(STREAM* s, uint32 integer)
|
||||
{
|
||||
int length;
|
||||
|
||||
if (integer <= 0xFF)
|
||||
{
|
||||
per_write_length(s, 1);
|
||||
@ -258,9 +256,9 @@ boolean per_read_enumerated(STREAM* s, uint8* enumerated, uint8 count)
|
||||
boolean per_read_object_identifier(STREAM* s, uint8 oid[6])
|
||||
{
|
||||
uint8 t12;
|
||||
int length;
|
||||
uint16 length;
|
||||
uint8 a_oid[6];
|
||||
boolean status;
|
||||
|
||||
|
||||
per_read_length(s, &length); /* length */
|
||||
|
||||
@ -332,7 +330,7 @@ void per_write_string(STREAM* s, uint8* str, int length)
|
||||
boolean per_read_octet_string(STREAM* s, uint8* oct_str, int length, int min)
|
||||
{
|
||||
int i;
|
||||
int mlength;
|
||||
uint16 mlength;
|
||||
uint8* a_oct_str;
|
||||
|
||||
per_read_length(s, &mlength);
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#include <freerdp/utils/stream.h>
|
||||
|
||||
boolean per_read_length(STREAM* s, int* length);
|
||||
boolean per_read_length(STREAM* s, uint16* length);
|
||||
void per_write_length(STREAM* s, int length);
|
||||
boolean per_read_choice(STREAM* s, uint8* choice);
|
||||
void per_write_choice(STREAM* s, uint8 choice);
|
||||
@ -41,5 +41,7 @@ boolean per_read_object_identifier(STREAM* s, uint8 oid[6]);
|
||||
boolean per_read_octet_string(STREAM* s, uint8* oct_str, int length, int min);
|
||||
void per_write_octet_string(STREAM* s, uint8* oct_str, int length, int min);
|
||||
void per_write_numeric_string(STREAM* s, uint8* num_str, int length, int min);
|
||||
boolean per_read_integer16(STREAM* s, uint16* integer, uint16 min);
|
||||
void per_write_integer16(STREAM* s, uint16 integer, uint16 min);
|
||||
|
||||
#endif /* __PER_H */
|
||||
|
@ -19,6 +19,10 @@
|
||||
|
||||
#include "rdp.h"
|
||||
|
||||
#include "info.h"
|
||||
#include "per.h"
|
||||
#include "redirection.h"
|
||||
|
||||
uint8 DATA_PDU_TYPE_STRINGS[][32] =
|
||||
{
|
||||
"", "", /* 0x00 - 0x01 */
|
||||
|
@ -19,24 +19,24 @@
|
||||
|
||||
#include "registry.h"
|
||||
|
||||
static uint8 registry_dir[] = "freerdp";
|
||||
static uint8 registry_file[] = "config.txt";
|
||||
static char registry_dir[] = "freerdp";
|
||||
static char registry_file[] = "config.txt";
|
||||
|
||||
static REG_SECTION global[] =
|
||||
{
|
||||
REG_TYPE_SECTION, "global", 0, NULL,
|
||||
REG_TYPE_BOOLEAN, "fast_path", 1, "1",
|
||||
REG_TYPE_STRING, "resolution", 8, "1024x768",
|
||||
REG_TYPE_INTEGER, "performance_flags", 4, "0xFFFF",
|
||||
REG_TYPE_NONE, "", 0, NULL
|
||||
{ REG_TYPE_SECTION, "global", 0, NULL },
|
||||
{ REG_TYPE_BOOLEAN, "fast_path", 1, "1" },
|
||||
{ REG_TYPE_STRING, "resolution", 8, "1024x768" },
|
||||
{ REG_TYPE_INTEGER, "performance_flags", 4, "0xFFFF" },
|
||||
{ REG_TYPE_NONE, "", 0, NULL }
|
||||
};
|
||||
|
||||
static REG_SECTION licensing[] =
|
||||
{
|
||||
REG_TYPE_SECTION, "licensing", 0, NULL,
|
||||
REG_TYPE_STRING, "platform_id", 1, "0x000201",
|
||||
REG_TYPE_STRING, "hardware_id", 16, "0xe107d9d372bb6826bd81d3542a419d6",
|
||||
REG_TYPE_NONE, "", 0, NULL
|
||||
{ REG_TYPE_SECTION, "licensing", 0, NULL },
|
||||
{ REG_TYPE_STRING, "platform_id", 1, "0x000201" },
|
||||
{ REG_TYPE_STRING, "hardware_id", 16, "0xe107d9d372bb6826bd81d3542a419d6" },
|
||||
{ REG_TYPE_NONE, "", 0, NULL }
|
||||
};
|
||||
|
||||
static REG_SECTION* sections[] =
|
||||
@ -85,7 +85,8 @@ void registry_print(rdpRegistry* registry, FILE* fp)
|
||||
|
||||
void registry_create(rdpRegistry* registry)
|
||||
{
|
||||
registry->fp = fopen(registry->file, "w+");
|
||||
registry->fp = fopen((char*)registry->file, "w+");
|
||||
|
||||
if (registry->fp == NULL)
|
||||
{
|
||||
printf("registry_create: error opening [%s] for writing\n", registry->file);
|
||||
@ -97,14 +98,14 @@ void registry_create(rdpRegistry* registry)
|
||||
|
||||
void registry_load(rdpRegistry* registry)
|
||||
{
|
||||
registry->fp = fopen(registry->file, "r+");
|
||||
registry->fp = fopen((char*)registry->file, "r+");
|
||||
}
|
||||
|
||||
void registry_open(rdpRegistry* registry)
|
||||
{
|
||||
struct stat stat_info;
|
||||
|
||||
if (stat(registry->file, &stat_info) != 0)
|
||||
if (stat((char*)registry->file, &stat_info) != 0)
|
||||
registry_create(registry);
|
||||
else
|
||||
registry_load(registry);
|
||||
@ -132,10 +133,10 @@ void registry_init(rdpRegistry* registry)
|
||||
return;
|
||||
}
|
||||
|
||||
registry->home = (uint8*) xstrdup(home_path);
|
||||
registry->home = (char*) xstrdup(home_path);
|
||||
printf("home path: %s\n", registry->home);
|
||||
|
||||
registry->path = (uint8*) xmalloc(strlen(registry->home) + strlen("/.") + strlen(registry_dir) + 1);
|
||||
registry->path = (char*) xmalloc(strlen(registry->home) + strlen("/.") + strlen(registry_dir) + 1);
|
||||
sprintf(registry->path, "%s/.%s", registry->home, registry_dir);
|
||||
printf("registry path: %s\n", registry->path);
|
||||
|
||||
@ -146,7 +147,7 @@ void registry_init(rdpRegistry* registry)
|
||||
}
|
||||
|
||||
length = strlen(registry->path);
|
||||
registry->file = (uint8*) xmalloc(strlen(registry->path) + strlen("/") + strlen(registry_file) + 1);
|
||||
registry->file = (char*) xmalloc(strlen(registry->path) + strlen("/") + strlen(registry_file) + 1);
|
||||
sprintf(registry->file, "%s/%s", registry->path, registry_file);
|
||||
printf("registry file: %s\n", registry->file);
|
||||
|
||||
|
@ -41,7 +41,7 @@ enum REG_TYPE
|
||||
typedef struct
|
||||
{
|
||||
uint8 type;
|
||||
uint8* name;
|
||||
char* name;
|
||||
uint32 length;
|
||||
void* value;
|
||||
} REG_ENTRY;
|
||||
@ -54,9 +54,9 @@ typedef REG_ENTRY REG_SECTION;
|
||||
struct rdp_registry
|
||||
{
|
||||
FILE* fp;
|
||||
uint8* path;
|
||||
uint8* file;
|
||||
uint8* home;
|
||||
char* path;
|
||||
char* file;
|
||||
char* home;
|
||||
boolean available;
|
||||
struct rdp_settings* settings;
|
||||
};
|
||||
|
@ -40,7 +40,7 @@ static uint8 pad2[48] =
|
||||
"\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C"
|
||||
};
|
||||
|
||||
void security_salted_hash(uint8* salt, uint8* input, int length, uint8* salt1, uint8* salt2, uint8* output)
|
||||
static void security_salted_hash(uint8* salt, uint8* input, int length, uint8* salt1, uint8* salt2, uint8* output)
|
||||
{
|
||||
CryptoMd5 md5;
|
||||
CryptoSha1 sha1;
|
||||
@ -63,10 +63,10 @@ void security_salted_hash(uint8* salt, uint8* input, int length, uint8* salt1, u
|
||||
crypto_md5_final(md5, output);
|
||||
}
|
||||
|
||||
void security_premaster_hash(uint8* input, int length, uint8* premaster_secret, uint8* client_random, uint8* server_random, uint8* output)
|
||||
static void security_premaster_hash(char* input, int length, uint8* premaster_secret, uint8* client_random, uint8* server_random, uint8* output)
|
||||
{
|
||||
/* PremasterHash(Input) = SaltedHash(PremasterSecret, Input, ClientRandom, ServerRandom) */
|
||||
security_salted_hash(premaster_secret, input, length, client_random, server_random, output);
|
||||
security_salted_hash(premaster_secret, (uint8*)input, length, client_random, server_random, output);
|
||||
}
|
||||
|
||||
void security_master_secret(uint8* premaster_secret, uint8* client_random, uint8* server_random, uint8* output)
|
||||
@ -77,10 +77,10 @@ void security_master_secret(uint8* premaster_secret, uint8* client_random, uint8
|
||||
security_premaster_hash("CCC", 3, premaster_secret, client_random, server_random, &output[32]);
|
||||
}
|
||||
|
||||
void security_master_hash(uint8* input, int length, uint8* master_secret, uint8* client_random, uint8* server_random, uint8* output)
|
||||
static void security_master_hash(char* input, int length, uint8* master_secret, uint8* client_random, uint8* server_random, uint8* output)
|
||||
{
|
||||
/* MasterHash(Input) = SaltedHash(MasterSecret, Input, ServerRandom, ClientRandom) */
|
||||
security_salted_hash(master_secret, input, length, server_random, client_random, output);
|
||||
security_salted_hash(master_secret, (uint8*)input, length, server_random, client_random, output);
|
||||
}
|
||||
|
||||
void security_session_key_blob(uint8* master_secret, uint8* client_random, uint8* server_random, uint8* output)
|
||||
|
@ -26,10 +26,7 @@
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/utils/stream.h>
|
||||
|
||||
void security_salted_hash(uint8* salt, uint8* input, int length, uint8* salt1, uint8* salt2, uint8* output);
|
||||
void security_premaster_hash(uint8* input, int length, uint8* premaster_secret, uint8* client_random, uint8* server_random, uint8* output);
|
||||
void security_master_secret(uint8* premaster_secret, uint8* client_random, uint8* server_random, uint8* output);
|
||||
void security_master_hash(uint8* input, int length, uint8* master_secret, uint8* client_random, uint8* server_random, uint8* output);
|
||||
void security_session_key_blob(uint8* master_secret, uint8* client_random, uint8* server_random, uint8* output);
|
||||
void security_mac_salt_key(uint8* session_key_blob, uint8* client_random, uint8* server_random, uint8* output);
|
||||
void security_licensing_encryption_key(uint8* session_key_blob, uint8* client_random, uint8* server_random, uint8* output);
|
||||
|
@ -101,7 +101,7 @@ rdpSettings* settings_new()
|
||||
settings->draw_nine_grid_cache_size = 2560;
|
||||
settings->draw_nine_grid_cache_entries = 256;
|
||||
|
||||
settings->client_dir = (uint8*)xstrdup(client_dll);
|
||||
settings->client_dir = xstrdup(client_dll);
|
||||
|
||||
settings->uniconv = freerdp_uniconv_new();
|
||||
gethostname(settings->client_hostname, sizeof(settings->client_hostname) - 1);
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <net/if.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <freerdp/utils/stream.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
@ -46,11 +47,12 @@ void tcp_get_ip_address(rdpTcp * tcp)
|
||||
{
|
||||
ip = (uint8*) (&sockaddr.sin_addr);
|
||||
snprintf(tcp->ip_address, sizeof(tcp->ip_address),
|
||||
"%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
|
||||
"%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
strncpy(tcp->ip_address, "127.0.0.1", sizeof(tcp->ip_address));
|
||||
}
|
||||
|
||||
tcp->ip_address[sizeof(tcp->ip_address) - 1] = 0;
|
||||
|
||||
@ -91,7 +93,7 @@ void tcp_get_mac_address(rdpTcp * tcp)
|
||||
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); */
|
||||
}
|
||||
|
||||
boolean tcp_connect(rdpTcp* tcp, const uint8* hostname, uint16 port)
|
||||
boolean tcp_connect(rdpTcp* tcp, const char* hostname, uint16 port)
|
||||
{
|
||||
int status;
|
||||
int sockfd = -1;
|
||||
|
@ -31,14 +31,14 @@
|
||||
|
||||
|
||||
typedef struct rdp_tcp rdpTcp;
|
||||
typedef boolean (*TcpConnect) (rdpTcp* tcp, const uint8* hostname, uint16 port);
|
||||
typedef boolean (*TcpConnect) (rdpTcp* tcp, const char* hostname, uint16 port);
|
||||
typedef boolean (*TcpDisconnect) (rdpTcp* tcp);
|
||||
typedef boolean (*TcpSetBlockingMode) (rdpTcp* tcp, boolean blocking);
|
||||
|
||||
struct rdp_tcp
|
||||
{
|
||||
int sockfd;
|
||||
uint8 ip_address[32];
|
||||
char ip_address[32];
|
||||
uint8 mac_address[6];
|
||||
struct rdp_settings* settings;
|
||||
TcpConnect connect;
|
||||
@ -46,7 +46,7 @@ struct rdp_tcp
|
||||
TcpSetBlockingMode set_blocking_mode;
|
||||
};
|
||||
|
||||
boolean tcp_connect(rdpTcp* tcp, const uint8* hostname, uint16 port);
|
||||
boolean tcp_connect(rdpTcp* tcp, const char* hostname, uint16 port);
|
||||
boolean tcp_disconnect(rdpTcp* tcp);
|
||||
int tcp_read(rdpTcp* tcp, uint8* data, int length);
|
||||
int tcp_write(rdpTcp* tcp, uint8* data, int length);
|
||||
|
@ -51,7 +51,7 @@ STREAM* transport_send_stream_init(rdpTransport* transport, int size)
|
||||
return s;
|
||||
}
|
||||
|
||||
boolean transport_connect(rdpTransport* transport, const uint8* hostname, uint16 port)
|
||||
boolean transport_connect(rdpTransport* transport, const char* hostname, uint16 port)
|
||||
{
|
||||
return transport->tcp->connect(transport->tcp, hostname, port);
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ struct rdp_transport
|
||||
|
||||
STREAM* transport_recv_stream_init(rdpTransport* transport, int size);
|
||||
STREAM* transport_send_stream_init(rdpTransport* transport, int size);
|
||||
boolean transport_connect(rdpTransport* transport, const uint8* hostname, uint16 port);
|
||||
boolean transport_connect(rdpTransport* transport, const char* hostname, uint16 port);
|
||||
boolean transport_disconnect(rdpTransport* transport);
|
||||
boolean transport_connect_rdp(rdpTransport* transport);
|
||||
boolean transport_connect_tls(rdpTransport* transport);
|
||||
|
@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "update.h"
|
||||
#include "bitmap.h"
|
||||
|
||||
uint8 UPDATE_TYPE_STRINGS[][32] =
|
||||
{
|
||||
|
@ -1186,7 +1186,7 @@ void gdi_free(rdpInst* inst)
|
||||
if (gdi)
|
||||
{
|
||||
gdi_bitmap_free(gdi->primary);
|
||||
gdi_DeleteObject((HGDIOBJECT) gdi->hdc);
|
||||
gdi_DeleteDC(gdi->hdc);
|
||||
free(gdi->clrconv);
|
||||
free(gdi);
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
printf("missing username\n");
|
||||
return 0;
|
||||
}
|
||||
settings->username = (uint8*)xstrdup(argv[index]);
|
||||
settings->username = xstrdup(argv[index]);
|
||||
}
|
||||
else if (strcmp("-p", argv[index]) == 0)
|
||||
{
|
||||
@ -79,7 +79,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
printf("missing password\n");
|
||||
return 0;
|
||||
}
|
||||
settings->password = (uint8*)xstrdup(argv[index]);
|
||||
settings->password = xstrdup(argv[index]);
|
||||
settings->autologon = 1;
|
||||
|
||||
/*
|
||||
@ -97,7 +97,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
printf("missing domain\n");
|
||||
return 0;
|
||||
}
|
||||
settings->domain = (uint8*)xstrdup(argv[index]);
|
||||
settings->domain = xstrdup(argv[index]);
|
||||
}
|
||||
else if (strcmp("-s", argv[index]) == 0)
|
||||
{
|
||||
@ -107,7 +107,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
printf("missing shell\n");
|
||||
return 0;
|
||||
}
|
||||
settings->shell = (uint8*)xstrdup(argv[index]);
|
||||
settings->shell = xstrdup(argv[index]);
|
||||
}
|
||||
else if (strcmp("-c", argv[index]) == 0)
|
||||
{
|
||||
@ -117,7 +117,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
printf("missing directory\n");
|
||||
return 0;
|
||||
}
|
||||
settings->directory = (uint8*)xstrdup(argv[index]);
|
||||
settings->directory = xstrdup(argv[index]);
|
||||
}
|
||||
else if (strcmp("-g", argv[index]) == 0)
|
||||
{
|
||||
@ -349,7 +349,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
&& (p[1] == 0 || (p[1] == ':' && !strchr(p + 2, ':'))))
|
||||
{
|
||||
/* Either "[...]" or "[...]:..." with at most one : after the brackets */
|
||||
settings->hostname = (uint8*)xstrdup(argv[index] + 1);
|
||||
settings->hostname = xstrdup(argv[index] + 1);
|
||||
if ((p = strchr((char*)settings->hostname, ']')))
|
||||
{
|
||||
*p = 0;
|
||||
@ -360,7 +360,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
else
|
||||
{
|
||||
/* Port number is cut off and used if exactly one : in the string */
|
||||
settings->hostname = (uint8*)xstrdup(argv[index]);
|
||||
settings->hostname = xstrdup(argv[index]);
|
||||
if ((p = strchr((char*)settings->hostname, ':')) && !strchr(p + 1, ':'))
|
||||
{
|
||||
*p = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user