From c6a998d2c366b495f0c9ce8086dfc47c8a917fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 14 Nov 2012 23:06:56 -0500 Subject: [PATCH] libfreerdp-core: got further in TSG connection --- client/common/cmdline.c | 10 ++++++++++ libfreerdp/core/rpc.c | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 5a76870f7..297225d3c 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -75,6 +75,8 @@ COMMAND_LINE_ARGUMENT_A args[] = { "sec-ext", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "nla extended protocol security" }, { "cert-name", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "certificate name" }, { "cert-ignore", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "ignore certificate" }, + { "authentication", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "authentication (hack!)" }, + { "encryption", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "encryption (hack!)" }, { "version", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_VERSION, NULL, NULL, NULL, -1, NULL, "print version" }, { "help", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_HELP, NULL, NULL, NULL, -1, "?", "print help" }, { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } @@ -710,6 +712,14 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin { settings->IgnoreCertificate = TRUE; } + CommandLineSwitchCase(arg, "authentication") + { + settings->Authentication = arg->Value ? TRUE : FALSE; + } + CommandLineSwitchCase(arg, "encryption") + { + settings->DisableEncryption = arg->Value ? FALSE : TRUE; + } CommandLineSwitchDefault(arg) { diff --git a/libfreerdp/core/rpc.c b/libfreerdp/core/rpc.c index 61466246a..b97a457db 100644 --- a/libfreerdp/core/rpc.c +++ b/libfreerdp/core/rpc.c @@ -962,6 +962,7 @@ int rpc_recv_fault_pdu(RPC_PDU_HEADER* header) BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* header, UINT32* offset, UINT32* length) { + UINT32 alloc_hint = 0; RPC_PDU_HEADER* pCommonFields; *offset = RPC_COMMON_FIELDS_LENGTH; @@ -971,11 +972,13 @@ BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* header, UINT32* offset, UINT32* l { *offset += 4; rpc_offset_align(offset, 8); + alloc_hint = *((UINT32*) &header[16]); } else if (pCommonFields->ptype == PTYPE_REQUEST) { *offset += 4; rpc_offset_align(offset, 8); + alloc_hint = *((UINT32*) &header[16]); } else { @@ -984,7 +987,10 @@ BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* header, UINT32* offset, UINT32* l if (length) { - *length = pCommonFields->frag_length - (pCommonFields->auth_length + *offset); + if (alloc_hint > 0) + *length = alloc_hint; + else + *length = pCommonFields->frag_length - (pCommonFields->auth_length + *offset); } return TRUE;