FreeRDP
|
#include <freerdp/config.h>
#include <errno.h>
#include <winpr/wtypes.h>
#include <winpr/collections.h>
#include <winpr/string.h>
#include <winpr/crt.h>
#include <winpr/crypto.h>
#include <winpr/print.h>
#include <winpr/windows.h>
#include <winpr/ssl.h>
#include <winpr/file.h>
#include <freerdp/log.h>
#include <freerdp/client/file.h>
#include <freerdp/client/cmdline.h>
#include <freerdp/assistance.h>
#include "../core/settings.h"
Macros | |
#define | TAG FREERDP_TAG("common") |
Functions | |
static const char * | strrstr (const char *haystack, size_t len, const char *needle) |
static BOOL | update_option (char **opt, const char *val, size_t len) |
static BOOL | update_name (rdpAssistanceFile *file, const char *name) |
static BOOL | update_password (rdpAssistanceFile *file, const char *password) |
static BOOL | update_connectionstring2_nocopy (rdpAssistanceFile *file, char *str) |
static BOOL | update_connectionstring2 (rdpAssistanceFile *file, const char *str, size_t len) |
static BOOL | update_connectionstring2_wchar (rdpAssistanceFile *file, const WCHAR *str, size_t len) |
static BOOL | freerdp_assistance_crypt_derive_key_sha1 (const BYTE *hash, size_t hashLength, BYTE *key, size_t keyLength) |
static BOOL | append_address_to_list (wArrayList *MachineAddresses, const char *str, size_t len) |
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_attr (const char **opt, size_t *plength, const char *key, const char *tag) |
static BOOL | freerdp_assistance_parse_attr_str (char **opt, const char *key, const char *tag) |
static BOOL | freerdp_assistance_parse_attr_bool (BOOL *opt, const char *key, const char *tag) |
static BOOL | freerdp_assistance_parse_attr_uint32 (UINT32 *opt, const char *key, const char *tag) |
static char * | freerdp_assistance_contains_element (char *input, size_t ilen, const char *key, size_t *plen, char **pdata, size_t *pdlen) |
static BOOL | freerdp_assistance_consume_input_and_get_element (char *input, const char *key, char **element, size_t *elen) |
this function returns a XML element identified by key The input string will be manipulated, so that the element found is '\0' terminated. More... | |
static BOOL | freerdp_assistance_get_element (char *input, size_t ilen, const char *key, char **element, size_t *elen) |
static BOOL | freerdp_assistance_parse_all_elements_of (rdpAssistanceFile *file, char *data, size_t len, const char *key, BOOL(*fkt)(rdpAssistanceFile *file, char *data, size_t len)) |
static BOOL | freerdp_assistance_parse_all_elements_of_l (rdpAssistanceFile *file, char *data, size_t len) |
static BOOL | freerdp_assistance_parse_all_elements_of_t (rdpAssistanceFile *file, char *data, size_t len) |
static BOOL | freerdp_assistance_parse_all_elements_of_c (rdpAssistanceFile *file, char *data, size_t len) |
static BOOL | freerdp_assistance_parse_find_elements_of_c (rdpAssistanceFile *file, char *data, size_t len) |
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) |
BYTE * | freerdp_assistance_encrypt_pass_stub (const char *password, const char *passStub, size_t *pEncryptedSize) |
static BOOL | freerdp_assistance_decrypt2 (rdpAssistanceFile *file) |
BYTE * | freerdp_assistance_hex_string_to_bin (const void *raw, size_t *size) |
char * | freerdp_assistance_bin_to_hex_string (const void *raw, size_t size) |
static int | freerdp_assistance_parse_uploadinfo (rdpAssistanceFile *file, char *uploadinfo, size_t uploadinfosize) |
static int | freerdp_assistance_parse_file_buffer_int (rdpAssistanceFile *file, char *buffer, size_t size, const char *password) |
int | freerdp_assistance_parse_file_buffer (rdpAssistanceFile *file, const char *cbuffer, 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) |
static BOOL | setup_string (wArrayList *list) |
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) |
#define TAG FREERDP_TAG("common") |
FreeRDP: A Remote Desktop Protocol Implementation Remote Assistance
Copyright 2014 Marc-Andre Moreau marca ndre .more au@g mail. 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.
|
static |
|
static |
char* freerdp_assistance_bin_to_hex_string | ( | const void * | raw, |
size_t | size | ||
) |
char* freerdp_assistance_construct_expert_blob | ( | const char * | name, |
const char * | pass | ||
) |
|
static |
this function returns a XML element identified by key The input string will be manipulated, so that the element found is '\0' terminated.
!
This function can not find multiple elements on the same level as the input string is changed!
|
static |
|
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.
|
static |
BYTE* freerdp_assistance_encrypt_pass_stub | ( | const char * | password, |
const char * | passStub, | ||
size_t * | pEncryptedSize | ||
) |
void freerdp_assistance_file_free | ( | rdpAssistanceFile * | file | ) |
rdpAssistanceFile* freerdp_assistance_file_new | ( | void | ) |
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
|
static |
BOOL freerdp_assistance_get_encrypted_pass_stub | ( | rdpAssistanceFile * | file, |
const char ** | pwd, | ||
size_t * | size | ||
) |
BYTE* freerdp_assistance_hex_string_to_bin | ( | const void * | raw, |
size_t * | size | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
<ProtocolVersion>,<protocolType>,<machineAddressList>,<assistantAccountPwd>, <RASessionID>,<RASessionName>,<RASessionPwd>,<protocolSpecificParms>
|
static |
int freerdp_assistance_parse_file | ( | rdpAssistanceFile * | file, |
const char * | name, | ||
const char * | password | ||
) |
int freerdp_assistance_parse_file_buffer | ( | rdpAssistanceFile * | file, |
const char * | cbuffer, | ||
size_t | size, | ||
const char * | password | ||
) |
|
static |
|
static |
|
static |
BOOL freerdp_assistance_populate_settings_from_assistance_file | ( | rdpAssistanceFile * | file, |
rdpSettings * | settings | ||
) |
void freerdp_assistance_print_file | ( | rdpAssistanceFile * | file, |
wLog * | log, | ||
DWORD | level | ||
) |
int freerdp_assistance_set_connection_string2 | ( | rdpAssistanceFile * | file, |
const char * | string, | ||
const char * | password | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |