FreeRDP
libfreerdp/core/security.c File Reference
#include "security.h"
#include <freerdp/log.h>
#include <winpr/crypto.h>

Macros

#define TAG   FREERDP_TAG("core")
 

Functions

static BOOL security_salted_hash (const BYTE *salt, const BYTE *input, int length, const BYTE *salt1, const BYTE *salt2, BYTE *output)
 
static BOOL security_premaster_hash (const char *input, int length, const BYTE *premaster_secret, const BYTE *client_random, const BYTE *server_random, BYTE *output)
 
BOOL security_master_secret (const BYTE *premaster_secret, const BYTE *client_random, const BYTE *server_random, BYTE *output)
 
static BOOL security_master_hash (const char *input, int length, const BYTE *master_secret, const BYTE *client_random, const BYTE *server_random, BYTE *output)
 
BOOL security_session_key_blob (const BYTE *master_secret, const BYTE *client_random, const BYTE *server_random, BYTE *output)
 
void security_mac_salt_key (const BYTE *session_key_blob, const BYTE *client_random, const BYTE *server_random, BYTE *output)
 
BOOL security_md5_16_32_32 (const BYTE *in0, const BYTE *in1, const BYTE *in2, BYTE *output)
 
BOOL security_md5_16_32_32_Allow_FIPS (const BYTE *in0, const BYTE *in1, const BYTE *in2, BYTE *output)
 
BOOL security_licensing_encryption_key (const BYTE *session_key_blob, const BYTE *client_random, const BYTE *server_random, BYTE *output)
 
void security_UINT32_le (BYTE *output, UINT32 value)
 
BOOL security_mac_data (const BYTE *mac_salt_key, const BYTE *data, UINT32 length, BYTE *output)
 
BOOL security_mac_signature (rdpRdp *rdp, const BYTE *data, UINT32 length, BYTE *output)
 
BOOL security_salted_mac_signature (rdpRdp *rdp, const BYTE *data, UINT32 length, BOOL encryption, BYTE *output)
 
static BOOL security_A (BYTE *master_secret, const BYTE *client_random, BYTE *server_random, BYTE *output)
 
static BOOL security_X (BYTE *master_secret, const BYTE *client_random, BYTE *server_random, BYTE *output)
 
static void fips_expand_key_bits (BYTE *in, BYTE *out)
 
BOOL security_establish_keys (const BYTE *client_random, rdpRdp *rdp)
 
BOOL security_key_update (BYTE *key, BYTE *update_key, int key_len, rdpRdp *rdp)
 
BOOL security_encrypt (BYTE *data, size_t length, rdpRdp *rdp)
 
BOOL security_decrypt (BYTE *data, size_t length, rdpRdp *rdp)
 
BOOL security_hmac_signature (const BYTE *data, size_t length, BYTE *output, rdpRdp *rdp)
 
BOOL security_fips_encrypt (BYTE *data, size_t length, rdpRdp *rdp)
 
BOOL security_fips_decrypt (BYTE *data, size_t length, rdpRdp *rdp)
 
BOOL security_fips_check_signature (const BYTE *data, size_t length, const BYTE *sig, rdpRdp *rdp)
 

Variables

static const BYTE pad1 [40]
 
static const BYTE pad2 [48]
 
static const BYTE fips_reverse_table [256]
 
static const BYTE fips_oddparity_table [256]
 

Macro Definition Documentation

#define TAG   FREERDP_TAG("core")

FreeRDP: A Remote Desktop Protocol Implementation RDP Security

Copyright 2011 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2014 Norbert Federa norbe.nosp@m.rt.f.nosp@m.edera.nosp@m.@thi.nosp@m.ncast.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 void fips_expand_key_bits ( BYTE in,
BYTE out 
)
static

Here is the caller graph for this function:

static BOOL security_A ( BYTE master_secret,
const BYTE client_random,
BYTE server_random,
BYTE output 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_decrypt ( BYTE data,
size_t  length,
rdpRdp *  rdp 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_encrypt ( BYTE data,
size_t  length,
rdpRdp *  rdp 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_establish_keys ( const BYTE client_random,
rdpRdp *  rdp 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_fips_check_signature ( const BYTE data,
size_t  length,
const BYTE sig,
rdpRdp *  rdp 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_fips_decrypt ( BYTE data,
size_t  length,
rdpRdp *  rdp 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_fips_encrypt ( BYTE data,
size_t  length,
rdpRdp *  rdp 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_hmac_signature ( const BYTE data,
size_t  length,
BYTE output,
rdpRdp *  rdp 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_key_update ( BYTE key,
BYTE update_key,
int  key_len,
rdpRdp *  rdp 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_licensing_encryption_key ( const BYTE session_key_blob,
const BYTE client_random,
const BYTE server_random,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_mac_data ( const BYTE mac_salt_key,
const BYTE data,
UINT32  length,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void security_mac_salt_key ( const BYTE session_key_blob,
const BYTE client_random,
const BYTE server_random,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_mac_signature ( rdpRdp *  rdp,
const BYTE data,
UINT32  length,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL security_master_hash ( const char *  input,
int  length,
const BYTE master_secret,
const BYTE client_random,
const BYTE server_random,
BYTE output 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_master_secret ( const BYTE premaster_secret,
const BYTE client_random,
const BYTE server_random,
BYTE output 
)

FreeRDP: A Remote Desktop Protocol Implementation RDP Security

Copyright 2011 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.

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_md5_16_32_32 ( const BYTE in0,
const BYTE in1,
const BYTE in2,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_md5_16_32_32_Allow_FIPS ( const BYTE in0,
const BYTE in1,
const BYTE in2,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL security_premaster_hash ( const char *  input,
int  length,
const BYTE premaster_secret,
const BYTE client_random,
const BYTE server_random,
BYTE output 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL security_salted_hash ( const BYTE salt,
const BYTE input,
int  length,
const BYTE salt1,
const BYTE salt2,
BYTE output 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_salted_mac_signature ( rdpRdp *  rdp,
const BYTE data,
UINT32  length,
BOOL  encryption,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL security_session_key_blob ( const BYTE master_secret,
const BYTE client_random,
const BYTE server_random,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void security_UINT32_le ( BYTE output,
UINT32  value 
)

Here is the caller graph for this function:

static BOOL security_X ( BYTE master_secret,
const BYTE client_random,
BYTE server_random,
BYTE output 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const BYTE fips_oddparity_table[256]
static
const BYTE fips_reverse_table[256]
static
const BYTE pad1[40]
static
Initial value:
=
{
"\x36\x36\x36\x36\x36\x36\x36\x36"
"\x36\x36\x36\x36\x36\x36\x36\x36"
"\x36\x36\x36\x36\x36\x36\x36\x36"
"\x36\x36\x36\x36\x36\x36\x36\x36"
"\x36\x36\x36\x36\x36\x36\x36\x36"
}
const BYTE pad2[48]
static
Initial value:
=
{
"\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C"
"\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C"
"\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C"
"\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C"
"\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C"
"\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C"
}