#include <gnutls_int.h>
#include <gnutls_auth_int.h>
Go to the source code of this file.
#define CHECK_AUTH | ( | auth, | |||
ret | ) |
if (MHD_gtls_auth_get_type(session) != auth) { \ MHD_gnutls_assert(); \ return ret; \ }
Definition at line 41 of file gnutls_state.h.
#define DEFAULT_CERT_TYPE MHD_GNUTLS_CRT_X509 |
Definition at line 77 of file gnutls_state.h.
Referenced by MHD__gnutls_init(), MHD_gtls_cert_type_send_params(), and MHD_gtls_session_cert_type_supported().
int MHD__gnutls_init | ( | MHD_gtls_session_t * | session, | |
MHD_gnutls_connection_end_t | con_end | |||
) |
MHD__gnutls_init - This function initializes the session to null (null encryption etc...). : indicate if this session is to be used for server or client. : is a pointer to a MHD_gtls_session_t structure.
This function initializes the current session to null. Every session must be initialized before use, so internal structures can be allocated. This function allocates structures which can only be free'd by calling MHD__gnutls_deinit(). Returns zero on success.
can be one of GNUTLS_CLIENT and GNUTLS_SERVER.
Returns: GNUTLS_E_SUCCESS on success, or an error code.
Definition at line 213 of file gnutls_state.c.
References DEFAULT_CERT_TYPE, DEFAULT_EXPIRE_TIME, DEFAULT_LOWAT, DEFAULT_MAX_RECORD_SIZE, GNUTLS_E_MEMORY_ERROR, INITIAL_RECV_BUFFER_SIZE, MAX_HANDSHAKE_PACKET_SIZE, MHD__gnutls_dh_set_prime_bits(), MHD__gnutls_handshake_set_max_packet_length(), MHD__gnutls_transport_set_lowat(), MHD_gnutls_calloc, MHD_GNUTLS_CIPHER_NULL, MHD_gnutls_free, MHD_GNUTLS_MAC_NULL, MHD_gnutls_malloc, MHD_gtls_buffer_init, MHD_gtls_handshake_internal_state_clear(), and MIN_DH_BITS.
void MHD__gnutls_session_cert_type_set | ( | MHD_gtls_session_t | session, | |
enum | MHD_GNUTLS_CertificateType | |||
) |
Definition at line 45 of file gnutls_state.c.
References MHD_gtls_security_param_st::cert_type, and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_cert_type_recv_params().
enum MHD_GNUTLS_CertificateType MHD_gnutls_certificate_type_get | ( | MHD_gtls_session_t | session | ) |
MHD_gnutls_certificate_type_get - Returns the currently used certificate type. : is a MHD_gtls_session_t structure.
The certificate type is by default X.509, unless it is negotiated as a TLS extension.
Returns: the currently used enum MHD_GNUTLS_CertificateType certificate type.
Definition at line 74 of file gnutls_state.c.
References MHD_gtls_security_param_st::cert_type, and MHD_gtls_session_int::security_parameters.
Referenced by call_get_cert_callback(), and get_issuers().
enum MHD_GNUTLS_CipherAlgorithm MHD_gnutls_cipher_get | ( | MHD_gtls_session_t | session | ) |
MHD_gnutls_cipher_get - Returns the currently used cipher. : is a MHD_gtls_session_t structure.
Returns: the currently used cipher.
Definition at line 58 of file gnutls_state.c.
References MHD_gtls_security_param_st::read_bulk_cipher_algorithm, and MHD_gtls_session_int::security_parameters.
enum MHD_GNUTLS_KeyExchangeAlgorithm MHD_gnutls_kx_get | ( | MHD_gtls_session_t | session | ) |
MHD_gnutls_kx_get - Returns the key exchange algorithm. : is a MHD_gtls_session_t structure.
Returns: the key exchange algorithm used in the last handshake.
Definition at line 86 of file gnutls_state.c.
References MHD_gtls_security_param_st::kx_algorithm, and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_proc_x509_server_certificate().
int MHD_gtls_dh_get_allowed_prime_bits | ( | MHD_gtls_session_t | session | ) |
Definition at line 372 of file gnutls_state.c.
References MHD_gtls_internals_st::dh_prime_bits, and MHD_gtls_session_int::internals.
Referenced by MHD_gtls_proc_dh_common_server_kx().
int MHD_gtls_dh_set_group | ( | MHD_gtls_session_t | session, | |
mpi_t | gen, | |||
mpi_t | prime | |||
) |
Definition at line 470 of file gnutls_state.c.
References MHD_gtls_cert_auth_info_st::dh, MHD_gtls_dh_info_st::generator, GNUTLS_E_INTERNAL_ERROR, MHD__gnutls_free_datum, MHD_gnutls_assert, MHD_GNUTLS_CRD_CERTIFICATE, MHD_gtls_auth_get_type(), MHD_gtls_get_auth_info(), MHD_gtls_mpi_dprint_lz(), and MHD_gtls_dh_info_st::prime.
Referenced by gen_dhe_server_kx(), and MHD_gtls_proc_dh_common_server_kx().
int MHD_gtls_dh_set_peer_public | ( | MHD_gtls_session_t | session, | |
mpi_t | public | |||
) |
Definition at line 378 of file gnutls_state.c.
References MHD_gtls_cert_auth_info_st::dh, GNUTLS_E_INTERNAL_ERROR, MHD_gnutls_assert, MHD_GNUTLS_CRD_CERTIFICATE, MHD_gtls_auth_get_type(), MHD_gtls_get_auth_info(), MHD_gtls_mpi_dprint_lz(), and MHD_gtls_dh_info_st::public_key.
Referenced by MHD_gtls_proc_dh_common_client_kx(), and MHD_gtls_proc_dh_common_server_kx().
int MHD_gtls_dh_set_secret_bits | ( | MHD_gtls_session_t | session, | |
unsigned | bits | |||
) |
Definition at line 412 of file gnutls_state.c.
References MHD_gtls_cert_auth_info_st::dh, GNUTLS_E_INTERNAL_ERROR, MHD_gnutls_assert, MHD_GNUTLS_CRD_CERTIFICATE, MHD_gtls_auth_get_type(), MHD_gtls_get_auth_info(), and MHD_gtls_dh_info_st::secret_bits.
Referenced by MHD_gtls_dh_common_print_server_kx(), and MHD_gtls_gen_dh_common_client_kx().
void MHD_gtls_handshake_internal_state_clear | ( | MHD_gtls_session_t | ) |
Definition at line 167 of file gnutls_state.c.
References MHD_gtls_internals_st::adv_version_major, MHD_gtls_internals_st::adv_version_minor, DEFAULT_MAX_RECORD_SIZE, deinit_internal_params(), MHD_gtls_internals_st::direction, MHD_gtls_internals_st::extensions_sent_size, MHD_gtls_internals_st::handshake_header_buffer, MHD_gtls_session_int::internals, MHD_gtls_internals_st::last_handshake_in, MHD_gtls_internals_st::last_handshake_out, MHD__gnutls_free_datum, MHD_gtls_internals_st::proposed_record_size, MHD_gtls_internals_st::recv_buffer, MHD_gtls_internals_st::resumable, RESUME_TRUE, and MHD_gtls_internals_st::v2_hello.
Referenced by MHD__gnutls_deinit(), MHD__gnutls_handshake(), and MHD__gnutls_init().
int MHD_gtls_openpgp_send_fingerprint | ( | MHD_gtls_session_t | session | ) |
int MHD_gtls_PRF | ( | MHD_gtls_session_t | session, | |
const opaque * | secret, | |||
int | secret_size, | |||
const char * | label, | |||
int | label_size, | |||
const opaque * | seed, | |||
int | seed_size, | |||
int | total_bytes, | |||
void * | ret | |||
) |
Definition at line 679 of file gnutls_state.c.
References GNUTLS_E_INTERNAL_ERROR, MAX_PRF_BYTES, MAX_SEED_SIZE, MHD__gnutls_P_hash(), MHD__gnutls_protocol_get_version(), MHD__gnutls_xor(), MHD_gnutls_assert, MHD_GNUTLS_MAC_MD5, MHD_GNUTLS_MAC_SHA1, and MHD_GNUTLS_PROTOCOL_TLS1_2.
Referenced by generate_normal_master(), MHD__gnutls_finished(), and MHD__gnutls_set_keys().
int MHD_gtls_rsa_export_set_pubkey | ( | MHD_gtls_session_t | session, | |
mpi_t | exponent, | |||
mpi_t | modulus | |||
) |
Definition at line 439 of file gnutls_state.c.
References MHD_gtls_rsa_info_st::exponent, GNUTLS_E_INTERNAL_ERROR, MHD__gnutls_free_datum, MHD_gnutls_assert, MHD_gtls_get_auth_info(), MHD_gtls_mpi_dprint_lz(), MHD_gtls_rsa_info_st::modulus, and MHD_gtls_cert_auth_info_st::rsa_export.
Referenced by gen_rsa_export_server_kx(), and proc_rsa_export_server_kx().
int MHD_gtls_session_cert_type_supported | ( | MHD_gtls_session_t | , | |
enum | MHD_GNUTLS_CertificateType | |||
) |
Definition at line 96 of file gnutls_state.c.
References MHD_gtls_certificate_credentials_st::cert_list, MHD_gtls_priority_st::cert_type, MHD_gnutls_cert::cert_type, DEFAULT_CERT_TYPE, MHD_gtls_security_param_st::entity, GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE, GNUTLS_SERVER, MHD_gtls_session_int::internals, MHD_gtls_session_int::key, MHD_GNUTLS_CRD_CERTIFICATE, MHD_gtls_get_cred(), MHD_gtls_certificate_credentials_st::ncerts, MHD_gtls_priority_st::num_algorithms, MHD_gtls_internals_st::priorities, MHD_gtls_priority_st::priority, MHD_gtls_session_int::security_parameters, and MHD_gtls_certificate_credentials_st::server_get_cert_callback.
Referenced by MHD_gtls_cert_type_recv_params().
int MHD_gtls_session_is_export | ( | MHD_gtls_session_t | session | ) |
Definition at line 769 of file gnutls_state.c.
References MHD_gtls_cipher_get_export_flag(), MHD_gtls_cipher_suite_get_cipher_algo(), and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_recv_server_kx_message().
int MHD_gtls_session_is_resumable | ( | MHD_gtls_session_t | session | ) |