FreeRDP
assistance.c File Reference
#include <errno.h>
#include <winpr/wtypes.h>
#include <winpr/crt.h>
#include <winpr/crypto.h>
#include <winpr/print.h>
#include <winpr/windows.h>
#include <freerdp/log.h>
#include <freerdp/client/file.h>
#include <freerdp/client/cmdline.h>
#include <freerdp/assistance.h>

Macros

#define TAG   FREERDP_TAG("common")
 

Functions

static BOOL freerdp_assistance_crypt_derive_key_sha1 (BYTE *hash, size_t hashLength, BYTE *key, size_t keyLength)
 
static BOOL reallocate (rdpAssistanceFile *file, const char *host, UINT32 port)
 
static BOOL append_address (rdpAssistanceFile *file, const char *host, const char *port)
 
static BOOL freerdp_assistance_parse_address_list (rdpAssistanceFile *file, char *list)
 
static BOOL freerdp_assistance_parse_connection_string1 (rdpAssistanceFile *file)
 
static BOOL freerdp_assistance_parse_connection_string2 (rdpAssistanceFile *file)
 
char * freerdp_assistance_construct_expert_blob (const char *name, const char *pass)
 
char * freerdp_assistance_generate_pass_stub (DWORD flags)
 
BYTEfreerdp_assistance_encrypt_pass_stub (const char *password, const char *passStub, size_t *pEncryptedSize)
 
static BOOL freerdp_assistance_decrypt2 (rdpAssistanceFile *file, const char *password)
 
BYTEfreerdp_assistance_hex_string_to_bin (const char *str, size_t *size)
 
char * freerdp_assistance_bin_to_hex_string (const BYTE *data, size_t size)
 
int freerdp_assistance_parse_file_buffer (rdpAssistanceFile *file, const char *buffer, size_t size, const char *password)
 
int freerdp_assistance_parse_file (rdpAssistanceFile *file, const char *name, const char *password)
 
BOOL freerdp_assistance_populate_settings_from_assistance_file (rdpAssistanceFile *file, rdpSettings *settings)
 
rdpAssistanceFile * freerdp_assistance_file_new (void)
 
void freerdp_assistance_file_free (rdpAssistanceFile *file)
 
void freerdp_assistance_print_file (rdpAssistanceFile *file, wLog *log, DWORD level)
 
BOOL freerdp_assistance_get_encrypted_pass_stub (rdpAssistanceFile *file, const char **pwd, size_t *size)
 
int freerdp_assistance_set_connection_string2 (rdpAssistanceFile *file, const char *string, const char *password)
 

Macro Definition Documentation

#define TAG   FREERDP_TAG("common")

FreeRDP: A Remote Desktop Protocol Implementation Remote Assistance

Copyright 2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..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

static BOOL append_address ( rdpAssistanceFile *  file,
const char *  host,
const char *  port 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

char* freerdp_assistance_bin_to_hex_string ( const BYTE data,
size_t  size 
)

Here is the caller graph for this function:

char* freerdp_assistance_construct_expert_blob ( const char *  name,
const char *  pass 
)

Here is the caller graph for this function:

static BOOL freerdp_assistance_crypt_derive_key_sha1 ( BYTE hash,
size_t  hashLength,
BYTE key,
size_t  keyLength 
)
static

Password encryption in establishing a remote assistance session of type 1: http://blogs.msdn.com/b/openspecification/archive/2011/10/31/password-encryption-in-establishing-a-remote-assistance-session-of-type-1.aspx

Creation of PassStub for the Remote Assistance Ticket: http://social.msdn.microsoft.com/Forums/en-US/6316c3f4-ea09-4343-a4a1-9cca46d70d28/creation-of-passstub-for-the-remote-assistance-ticket?forum=os_windowsprotocols CryptDeriveKey Function: http://msdn.microsoft.com/en-us/library/windows/desktop/aa379916/

Let n be the required derived key length, in bytes. The derived key is the first n bytes of the hash value after the hash computation has been completed by CryptDeriveKey. If the hash is not a member of the SHA-2 family and the required key is for either 3DES or AES, the key is derived as follows:

Form a 64-byte buffer by repeating the constant 0x36 64 times. Let k be the length of the hash value that is represented by the input parameter hBaseData. Set the first k bytes of the buffer to the result of an XOR operation of the first k bytes of the buffer with the hash value that is represented by the input parameter hBaseData.

Form a 64-byte buffer by repeating the constant 0x5C 64 times. Set the first k bytes of the buffer to the result of an XOR operation of the first k bytes of the buffer with the hash value that is represented by the input parameter hBaseData.

Hash the result of step 1 by using the same hash algorithm as that used to compute the hash value that is represented by the hBaseData parameter.

Hash the result of step 2 by using the same hash algorithm as that used to compute the hash value that is represented by the hBaseData parameter.

Concatenate the result of step 3 with the result of step 4. Use the first n bytes of the result of step 5 as the derived key.

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL freerdp_assistance_decrypt2 ( rdpAssistanceFile *  file,
const char *  password 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BYTE* freerdp_assistance_encrypt_pass_stub ( const char *  password,
const char *  passStub,
size_t *  pEncryptedSize 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void freerdp_assistance_file_free ( rdpAssistanceFile *  file)

Here is the caller graph for this function:

rdpAssistanceFile* freerdp_assistance_file_new ( void  )

Here is the caller graph for this function:

char* freerdp_assistance_generate_pass_stub ( DWORD  flags)

PassStub generation:

Characters 0 and 5-13 are from the set A-Z a-z 0-9 * _ Character 1 is from the set !#$&^*()-+= Character 2 is from the set 0-9 Character 3 is from the set A-Z Character 4 is from the set a-z

Example: WB^6HsrIaFmEpi

Here is the call graph for this function:

BOOL freerdp_assistance_get_encrypted_pass_stub ( rdpAssistanceFile *  file,
const char **  pwd,
size_t *  size 
)

Here is the caller graph for this function:

BYTE* freerdp_assistance_hex_string_to_bin ( const char *  str,
size_t *  size 
)

Here is the caller graph for this function:

static BOOL freerdp_assistance_parse_address_list ( rdpAssistanceFile *  file,
char *  list 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL freerdp_assistance_parse_connection_string1 ( rdpAssistanceFile *  file)
static

<ProtocolVersion>,<protocolType>,<machineAddressList>,<assistantAccountPwd>, <RASessionID>,<RASessionName>,<RASessionPwd>,<protocolSpecificParms>

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL freerdp_assistance_parse_connection_string2 ( rdpAssistanceFile *  file)
static

Decrypted Connection String 2:

<E> <T id="1" sid="0"> <L p="49228" n="fe80::1032:53d9:5a01:909b%3"> <L p="49229" n="fe80::3d8f:9b2d:6b4e:6aa%6"> <L p="49230" n="192.168.1.200"> <L p="49231" n="169.254.6.170"> </T> </E>

Here is the call graph for this function:

Here is the caller graph for this function:

int freerdp_assistance_parse_file ( rdpAssistanceFile *  file,
const char *  name,
const char *  password 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int freerdp_assistance_parse_file_buffer ( rdpAssistanceFile *  file,
const char *  buffer,
size_t  size,
const char *  password 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL freerdp_assistance_populate_settings_from_assistance_file ( rdpAssistanceFile *  file,
rdpSettings *  settings 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void freerdp_assistance_print_file ( rdpAssistanceFile *  file,
wLog *  log,
DWORD  level 
)

Here is the caller graph for this function:

int freerdp_assistance_set_connection_string2 ( rdpAssistanceFile *  file,
const char *  string,
const char *  password 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL reallocate ( rdpAssistanceFile *  file,
const char *  host,
UINT32  port 
)
static

Here is the call graph for this function:

Here is the caller graph for this function: