gnutls_auth.c File Reference

#include "gnutls_int.h"
#include "gnutls_errors.h"
#include "gnutls_auth.h"
#include "gnutls_auth_int.h"
#include "gnutls_algorithms.h"
#include "auth_cert.h"
#include <gnutls_datum.h>

Include dependency graph for gnutls_auth.c:

Go to the source code of this file.

Functions

void MHD__gnutls_credentials_clear (MHD_gtls_session_t session)
int MHD__gnutls_credentials_set (MHD_gtls_session_t session, enum MHD_GNUTLS_CredentialsType type, void *cred)
enum MHD_GNUTLS_CredentialsType MHD_gtls_auth_get_type (MHD_gtls_session_t session)
const void * MHD_gtls_get_kx_cred (MHD_gtls_session_t session, enum MHD_GNUTLS_KeyExchangeAlgorithm algo, int *err)
const void * MHD_gtls_get_cred (MHD_gtls_key_st key, enum MHD_GNUTLS_CredentialsType type, int *err)
void * MHD_gtls_get_auth_info (MHD_gtls_session_t session)
void MHD_gtls_free_auth_info (MHD_gtls_session_t session)
int MHD_gtls_auth_info_set (MHD_gtls_session_t session, enum MHD_GNUTLS_CredentialsType type, int size, int allow_change)


Function Documentation

void MHD__gnutls_credentials_clear ( MHD_gtls_session_t  session  ) 

MHD__gnutls_credentials_clear - Clears all the credentials previously set : is a MHD_gtls_session_t structure.

Clears all the credentials previously set in this session.

Definition at line 46 of file gnutls_auth.c.

References MHD_gtls_key::cred, MHD_gtls_session_int::key, MHD_gnutls_free, and MHD_gtls_auth_cred_st::next.

Referenced by MHD__gnutls_deinit().

Here is the caller graph for this function:

int MHD__gnutls_credentials_set ( MHD_gtls_session_t  session,
enum MHD_GNUTLS_CredentialsType  type,
void *  cred 
)

MHD__gnutls_credentials_set - Sets the needed credentials for the specified authentication algorithm. : is a MHD_gtls_session_t structure. : is the type of the credentials : is a pointer to a structure.

Sets the needed credentials for the specified type. Eg username, password - or public and private keys etc. The (void* cred) parameter is a structure that depends on the specified type and on the current session (client or server). [ In order to minimize memory usage, and share credentials between several threads gnutls keeps a pointer to cred, and not the whole cred structure. Thus you will have to keep the structure allocated until you call MHD__gnutls_deinit(). ]

For GNUTLS_CRD_SRP cred should be MHD_gnutls_srp_client_credentials_t in case of a client, and MHD_gnutls_srp_server_credentials_t, in case of a server.

For GNUTLS_CRD_CERTIFICATE cred should be MHD_gtls_cert_credentials_t.

Definition at line 89 of file gnutls_auth.c.

References MHD_gtls_auth_cred_st::algorithm, MHD_gtls_key::cred, MHD_gtls_auth_cred_st::credentials, GNUTLS_E_MEMORY_ERROR, MHD_gtls_session_int::key, MHD_gnutls_free, MHD_gnutls_malloc, and MHD_gtls_auth_cred_st::next.

Referenced by MHD_accept_connection().

Here is the caller graph for this function:

enum MHD_GNUTLS_CredentialsType MHD_gtls_auth_get_type ( MHD_gtls_session_t  session  ) 

MHD_gtls_auth_get_type - Returns the type of credentials for the current authentication schema. : is a MHD_gtls_session_t structure.

Returns type of credentials for the current authentication schema. The returned information is to be used to distinguish the function used to access authentication data.

Eg. for CERTIFICATE ciphersuites (key exchange algorithms: KX_RSA, KX_DHE_RSA), the same function are to be used to access the authentication data.

Definition at line 160 of file gnutls_auth.c.

References MHD_gtls_security_param_st::entity, GNUTLS_SERVER, MHD_gtls_cipher_suite_get_kx_algo(), MHD_gtls_map_kx_get_cred(), and MHD_gtls_session_int::security_parameters.

Referenced by MHD_gtls_auth_info_set(), MHD_gtls_dh_set_group(), MHD_gtls_dh_set_peer_public(), and MHD_gtls_dh_set_secret_bits().

Here is the call graph for this function:

Here is the caller graph for this function:

int MHD_gtls_auth_info_set ( MHD_gtls_session_t  session,
enum MHD_GNUTLS_CredentialsType  type,
int  size,
int  allow_change 
)

void MHD_gtls_free_auth_info ( MHD_gtls_session_t  session  ) 

void* MHD_gtls_get_auth_info ( MHD_gtls_session_t  session  ) 

const void* MHD_gtls_get_cred ( MHD_gtls_key_st  key,
enum MHD_GNUTLS_CredentialsType  type,
int *  err 
)

const void* MHD_gtls_get_kx_cred ( MHD_gtls_session_t  session,
enum MHD_GNUTLS_KeyExchangeAlgorithm  algo,
int *  err 
)

Definition at line 178 of file gnutls_auth.c.

References MHD_gtls_security_param_st::entity, GNUTLS_SERVER, MHD_gtls_session_int::key, MHD_gtls_get_cred(), MHD_gtls_map_kx_get_cred(), and MHD_gtls_session_int::security_parameters.

Referenced by MHD_gtls_remove_unwanted_ciphersuites(), and MHD_gtls_server_select_suite().

Here is the call graph for this function:

Here is the caller graph for this function:


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