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

Macros

#define TAG   FREERDP_TAG("crypto")
 
#define GEN_ALL   (-1)
 

Typedefs

typedef int(* general_name_mapper_pr) (GENERAL_NAME *name, void *data, int index, int count)
 

Functions

CryptoCert crypto_cert_read (BYTE *data, UINT32 length)
 
void crypto_cert_free (CryptoCert cert)
 
BOOL crypto_cert_get_public_key (CryptoCert cert, BYTE **PublicKey, DWORD *PublicKeyLength)
 
static int crypto_rsa_common (const BYTE *input, int length, UINT32 key_length, const BYTE *modulus, const BYTE *exponent, int exponent_size, BYTE *output)
 
static int crypto_rsa_public (const BYTE *input, int length, UINT32 key_length, const BYTE *modulus, const BYTE *exponent, BYTE *output)
 
static int crypto_rsa_private (const BYTE *input, int length, UINT32 key_length, const BYTE *modulus, const BYTE *private_exponent, BYTE *output)
 
int crypto_rsa_public_encrypt (const BYTE *input, int length, UINT32 key_length, const BYTE *modulus, const BYTE *exponent, BYTE *output)
 
int crypto_rsa_public_decrypt (const BYTE *input, int length, UINT32 key_length, const BYTE *modulus, const BYTE *exponent, BYTE *output)
 
int crypto_rsa_private_encrypt (const BYTE *input, int length, UINT32 key_length, const BYTE *modulus, const BYTE *private_exponent, BYTE *output)
 
int crypto_rsa_private_decrypt (const BYTE *input, int length, UINT32 key_length, const BYTE *modulus, const BYTE *private_exponent, BYTE *output)
 
int crypto_rsa_decrypt (const BYTE *input, int length, UINT32 key_length, const BYTE *modulus, const BYTE *private_exponent, BYTE *output)
 
void crypto_reverse (BYTE *data, int length)
 
char * crypto_cert_fingerprint (X509 *xcert)
 
char * crypto_print_name (X509_NAME *name)
 
char * crypto_cert_subject (X509 *xcert)
 
char * crypto_cert_subject_common_name (X509 *xcert, int *length)
 
static const char * general_name_type_label (int general_name_type)
 
static void map_subject_alt_name (X509 *x509, int general_name_type, general_name_mapper_pr mapper, void *data)
 
static void string_list_initialize (string_list *list)
 
static void string_list_allocate (string_list *list, int allocate_count)
 
static void string_list_free (string_list *list)
 
static int extract_string (GENERAL_NAME *name, void *data, int index, int count)
 
static void object_list_initialize (object_list *list)
 
static void object_list_allocate (object_list *list, int allocate_count)
 
static char * object_string (ASN1_TYPE *object)
 
static void object_list_free (object_list *list)
 
static int extract_othername_object_as_string (GENERAL_NAME *name, void *data, int index, int count)
 
char * crypto_cert_get_email (X509 *x509)
 
char * crypto_cert_get_upn (X509 *x509)
 
void crypto_cert_subject_alt_name_free (int count, int *lengths, char **alt_names)
 
void crypto_cert_dns_names_free (int count, int *lengths, char **dns_names)
 
char ** crypto_cert_subject_alt_name (X509 *xcert, int *count, int **lengths)
 
char ** crypto_cert_get_dns_names (X509 *x509, int *count, int **lengths)
 
char * crypto_cert_issuer (X509 *xcert)
 
BOOL x509_verify_certificate (CryptoCert cert, const char *certificate_store_path)
 
rdpCertificateData * crypto_get_certificate_data (X509 *xcert, const char *hostname, UINT16 port)
 
void crypto_cert_print_info (X509 *xcert)
 

Variables

static const char * general_name_type_labels []
 

Macro Definition Documentation

#define GEN_ALL   (-1)
#define TAG   FREERDP_TAG("crypto")

FreeRDP: A Remote Desktop Protocol Implementation Cryptographic Abstraction Layer

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

Typedef Documentation

typedef int(* general_name_mapper_pr) (GENERAL_NAME *name, void *data, int index, int count)

Function Documentation

void crypto_cert_dns_names_free ( int  count,
int *  lengths,
char **  dns_names 
)

Here is the caller graph for this function:

char* crypto_cert_fingerprint ( X509 *  xcert)

Here is the caller graph for this function:

void crypto_cert_free ( CryptoCert  cert)
char** crypto_cert_get_dns_names ( X509 *  x509,
int *  count,
int **  lengths 
)

Here is the call graph for this function:

Here is the caller graph for this function:

char* crypto_cert_get_email ( X509 *  x509)

Here is the call graph for this function:

BOOL crypto_cert_get_public_key ( CryptoCert  cert,
BYTE **  PublicKey,
DWORD *  PublicKeyLength 
)

Here is the caller graph for this function:

char* crypto_cert_get_upn ( X509 *  x509)

Here is the call graph for this function:

char* crypto_cert_issuer ( X509 *  xcert)

Here is the call graph for this function:

Here is the caller graph for this function:

void crypto_cert_print_info ( X509 *  xcert)

Here is the call graph for this function:

CryptoCert crypto_cert_read ( BYTE data,
UINT32  length 
)
char* crypto_cert_subject ( X509 *  xcert)

Here is the call graph for this function:

Here is the caller graph for this function:

char** crypto_cert_subject_alt_name ( X509 *  xcert,
int *  count,
int **  lengths 
)

Here is the call graph for this function:

void crypto_cert_subject_alt_name_free ( int  count,
int *  lengths,
char **  alt_names 
)

Here is the call graph for this function:

char* crypto_cert_subject_common_name ( X509 *  xcert,
int *  length 
)

Here is the call graph for this function:

Here is the caller graph for this function:

rdpCertificateData* crypto_get_certificate_data ( X509 *  xcert,
const char *  hostname,
UINT16  port 
)

Here is the call graph for this function:

Here is the caller graph for this function:

char* crypto_print_name ( X509_NAME *  name)

Here is the caller graph for this function:

void crypto_reverse ( BYTE data,
int  length 
)

Here is the caller graph for this function:

static int crypto_rsa_common ( const BYTE input,
int  length,
UINT32  key_length,
const BYTE modulus,
const BYTE exponent,
int  exponent_size,
BYTE output 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int crypto_rsa_decrypt ( const BYTE input,
int  length,
UINT32  key_length,
const BYTE modulus,
const BYTE private_exponent,
BYTE output 
)

Here is the call graph for this function:

static int crypto_rsa_private ( const BYTE input,
int  length,
UINT32  key_length,
const BYTE modulus,
const BYTE private_exponent,
BYTE output 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int crypto_rsa_private_decrypt ( const BYTE input,
int  length,
UINT32  key_length,
const BYTE modulus,
const BYTE private_exponent,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int crypto_rsa_private_encrypt ( const BYTE input,
int  length,
UINT32  key_length,
const BYTE modulus,
const BYTE private_exponent,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int crypto_rsa_public ( const BYTE input,
int  length,
UINT32  key_length,
const BYTE modulus,
const BYTE exponent,
BYTE output 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int crypto_rsa_public_decrypt ( const BYTE input,
int  length,
UINT32  key_length,
const BYTE modulus,
const BYTE exponent,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int crypto_rsa_public_encrypt ( const BYTE input,
int  length,
UINT32  key_length,
const BYTE modulus,
const BYTE exponent,
BYTE output 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int extract_othername_object_as_string ( GENERAL_NAME *  name,
void data,
int  index,
int  count 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int extract_string ( GENERAL_NAME *  name,
void data,
int  index,
int  count 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* general_name_type_label ( int  general_name_type)
static

Here is the caller graph for this function:

static void map_subject_alt_name ( X509 *  x509,
int  general_name_type,
general_name_mapper_pr  mapper,
void data 
)
static

Here is the caller graph for this function:

static void object_list_allocate ( object_list *  list,
int  allocate_count 
)
static

Here is the caller graph for this function:

static void object_list_free ( object_list *  list)
static

Here is the caller graph for this function:

static void object_list_initialize ( object_list *  list)
static

Here is the caller graph for this function:

static char* object_string ( ASN1_TYPE *  object)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void string_list_allocate ( string_list *  list,
int  allocate_count 
)
static

Here is the caller graph for this function:

static void string_list_free ( string_list *  list)
static

Here is the caller graph for this function:

static void string_list_initialize ( string_list *  list)
static

Here is the caller graph for this function:

BOOL x509_verify_certificate ( CryptoCert  cert,
const char *  certificate_store_path 
)

Here is the caller graph for this function:

Variable Documentation

const char* general_name_type_labels[]
static
Initial value:
= { "OTHERNAME",
"EMAIL ",
"DNS ",
"X400 ",
"DIRNAME ",
"EDIPARTY ",
"URI ",
"IPADD ",
"RID "
}