gnutls_cert.c File Reference

#include <gnutls_int.h>
#include <gnutls_errors.h>
#include <auth_cert.h>
#include <gnutls_cert.h>
#include <gnutls_datum.h>
#include <gnutls_mpi.h>
#include <gnutls_global.h>
#include <gnutls_algorithms.h>
#include <gnutls_dh.h>
#include <gnutls_str.h>
#include <gnutls_state.h>
#include <gnutls_auth_int.h>
#include <gnutls_x509.h>
#include "x509.h"
#include "mpi.h"

Include dependency graph for gnutls_cert.c:

Go to the source code of this file.

Defines

#define SMALL_DER   512

Functions

void MHD__gnutls_certificate_free_keys (MHD_gtls_cert_credentials_t sc)
void MHD__gnutls_certificate_free_cas (MHD_gtls_cert_credentials_t sc)
void MHD__gnutls_certificate_free_ca_names (MHD_gtls_cert_credentials_t sc)
MHD_gtls_rsa_params_t MHD_gtls_certificate_get_rsa_params (MHD_gtls_rsa_params_t rsa_params, MHD_gnutls_params_function *func, MHD_gtls_session_t session)
void MHD__gnutls_certificate_free_credentials (MHD_gtls_cert_credentials_t sc)
int MHD__gnutls_certificate_allocate_credentials (MHD_gtls_cert_credentials_t *res)
int MHD_gtls_selected_cert_supported_kx (MHD_gtls_session_t session, enum MHD_GNUTLS_KeyExchangeAlgorithm **alg, int *alg_size)
int MHD_gtls_raw_cert_to_gcert (MHD_gnutls_cert *gcert, enum MHD_GNUTLS_CertificateType type, const MHD_gnutls_datum_t *raw_cert, int flags)
int MHD_gtls_x509_raw_cert_to_gcert (MHD_gnutls_cert *gcert, const MHD_gnutls_datum_t *derCert, int flags)
int MHD_gtls_x509_crt_to_gcert (MHD_gnutls_cert *gcert, MHD_gnutls_x509_crt_t cert, unsigned int flags)
void MHD_gtls_gcert_deinit (MHD_gnutls_cert *cert)


Define Documentation

#define SMALL_DER   512


Function Documentation

int MHD__gnutls_certificate_allocate_credentials ( MHD_gtls_cert_credentials_t res  ) 

MHD__gnutls_certificate_allocate_credentials - Used to allocate a MHD_gtls_cert_credentials_t structure : is a pointer to an MHD_gtls_cert_credentials_t structure.

This structure is complex enough to manipulate directly thus this helper function is provided in order to allocate it.

Returns: GNUTLS_E_SUCCESS on success, or an error code.

Definition at line 207 of file gnutls_cert.c.

References DEFAULT_VERIFY_BITS, DEFAULT_VERIFY_DEPTH, GNUTLS_E_MEMORY_ERROR, and MHD_gnutls_calloc.

void MHD__gnutls_certificate_free_ca_names ( MHD_gtls_cert_credentials_t  sc  ) 

MHD__gnutls_certificate_free_ca_names - Used to free all the CA names from a MHD_gtls_cert_credentials_t structure : is an MHD_gtls_cert_credentials_t structure.

This function will delete all the CA name in the given credentials. Clients may call this to save some memory since in client side the CA names are not used.

CA names are used by servers to advertize the CAs they support to clients.

Definition at line 127 of file gnutls_cert.c.

References MHD__gnutls_free_datum, and MHD_gtls_certificate_credentials_st::x509_rdn_sequence.

Referenced by MHD__gnutls_certificate_free_credentials().

Here is the caller graph for this function:

void MHD__gnutls_certificate_free_cas ( MHD_gtls_cert_credentials_t  sc  ) 

MHD__gnutls_certificate_free_cas - Used to free all the CAs from a MHD_gtls_cert_credentials_t structure : is an MHD_gtls_cert_credentials_t structure.

This function will delete all the CAs associated with the given credentials. Servers that do not use MHD_gtls_certificate_verify_peers2() may call this to save some memory.

Definition at line 98 of file gnutls_cert.c.

References MHD_gnutls_free, MHD_gnutls_x509_crt_deinit(), MHD_gtls_certificate_credentials_st::x509_ca_list, and MHD_gtls_certificate_credentials_st::x509_ncas.

Referenced by MHD__gnutls_certificate_free_credentials().

Here is the call graph for this function:

Here is the caller graph for this function:

void MHD__gnutls_certificate_free_credentials ( MHD_gtls_cert_credentials_t  sc  ) 

MHD__gnutls_certificate_free_credentials - Used to free an allocated MHD_gtls_cert_credentials_t structure : is an MHD_gtls_cert_credentials_t structure.

This structure is complex enough to manipulate directly thus this helper function is provided in order to free (deallocate) it.

This function does not free any temporary parameters associated with this structure (ie RSA and DH parameters are not freed by this function).

Definition at line 184 of file gnutls_cert.c.

References MHD_gtls_certificate_credentials_st::keyring, MHD__gnutls_certificate_free_ca_names(), MHD__gnutls_certificate_free_cas(), MHD__gnutls_certificate_free_keys(), MHD__gnutls_free_datum, and MHD_gnutls_free.

Referenced by MHD_stop_daemon().

Here is the call graph for this function:

Here is the caller graph for this function:

void MHD__gnutls_certificate_free_keys ( MHD_gtls_cert_credentials_t  sc  ) 

MHD__gnutls_certificate_free_keys - Used to free all the keys from a MHD_gtls_cert_credentials_t structure : is an MHD_gtls_cert_credentials_t structure.

This function will delete all the keys and the certificates associated with the given credentials. This function must not be called when a TLS negotiation that uses the credentials is in progress.

Definition at line 56 of file gnutls_cert.c.

References MHD_gtls_certificate_credentials_st::cert_list, MHD_gtls_certificate_credentials_st::cert_list_length, MHD_gnutls_free, MHD_gtls_gcert_deinit(), MHD_gtls_gkey_deinit(), MHD_gtls_certificate_credentials_st::ncerts, and MHD_gtls_certificate_credentials_st::pkey.

Referenced by MHD__gnutls_certificate_free_credentials().

Here is the call graph for this function:

Here is the caller graph for this function:

MHD_gtls_rsa_params_t MHD_gtls_certificate_get_rsa_params ( MHD_gtls_rsa_params_t  rsa_params,
MHD_gnutls_params_function func,
MHD_gtls_session_t  session 
)

void MHD_gtls_gcert_deinit ( MHD_gnutls_cert cert  ) 

int MHD_gtls_raw_cert_to_gcert ( MHD_gnutls_cert gcert,
enum MHD_GNUTLS_CertificateType  type,
const MHD_gnutls_datum_t raw_cert,
int  flags 
)

int MHD_gtls_selected_cert_supported_kx ( MHD_gtls_session_t  session,
enum MHD_GNUTLS_KeyExchangeAlgorithm **  alg,
int *  alg_size 
)

int MHD_gtls_x509_crt_to_gcert ( MHD_gnutls_cert gcert,
MHD_gnutls_x509_crt_t  cert,
unsigned int  flags 
)

int MHD_gtls_x509_raw_cert_to_gcert ( MHD_gnutls_cert gcert,
const MHD_gnutls_datum_t derCert,
int  flags 
)

Definition at line 309 of file gnutls_cert.c.

References GNUTLS_X509_FMT_DER, MHD_gnutls_assert, MHD_gnutls_x509_crt_deinit(), MHD_gnutls_x509_crt_import(), MHD_gnutls_x509_crt_init(), and MHD_gtls_x509_crt_to_gcert().

Referenced by MHD_gtls_proc_x509_server_certificate(), MHD_gtls_raw_cert_to_gcert(), and parse_pem_cert_mem().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Fri Feb 27 18:19:29 2009 for GNU libmicrohttpd by  doxygen 1.5.8