#include "MHD_config.h"
#include <gnutls_int.h>
#include <gnutls_constate.h>
#include <gnutls_errors.h>
#include <gnutls_kx.h>
#include <gnutls_algorithms.h>
#include <gnutls_num.h>
#include <gnutls_datum.h>
#include <gnutls_state.h>
Go to the source code of this file.
#define CPY_COMMON |
dst->entity = src->entity; \ dst->kx_algorithm = src->kx_algorithm; \ memcpy( &dst->current_cipher_suite, &src->current_cipher_suite, sizeof(cipher_suite_st)); \ memcpy( dst->master_secret, src->master_secret, TLS_MASTER_SIZE); \ memcpy( dst->client_random, src->client_random, TLS_RANDOM_SIZE); \ memcpy( dst->server_random, src->server_random, TLS_RANDOM_SIZE); \ memcpy( dst->session_id, src->session_id, TLS_MAX_SESSION_ID_SIZE); \ dst->session_id_size = src->session_id_size; \ dst->cert_type = src->cert_type; \ dst->timestamp = src->timestamp; \ dst->max_record_recv_size = src->max_record_recv_size; \ dst->max_record_send_size = src->max_record_send_size; \ dst->version = src->version; \ memcpy( &dst->extensions, &src->extensions, sizeof(MHD_gtls_ext_st)); \ memcpy( &dst->inner_secret, &src->inner_secret, TLS_MASTER_SIZE);
Definition at line 428 of file gnutls_constate.c.
Referenced by MHD__gnutls_cpy_read_security_parameters(), and MHD__gnutls_cpy_write_security_parameters().
#define EXPORT_FINAL_KEY_SIZE 16 |
Definition at line 51 of file gnutls_constate.c.
Referenced by MHD__gnutls_set_keys().
static void MHD__gnutls_cpy_read_security_parameters | ( | MHD_gtls_security_param_st * | dst, | |
MHD_gtls_security_param_st * | src | |||
) | [static] |
Definition at line 445 of file gnutls_constate.c.
References CPY_COMMON, MHD_gtls_security_param_st::read_bulk_cipher_algorithm, MHD_gtls_security_param_st::read_compression_algorithm, and MHD_gtls_security_param_st::read_mac_algorithm.
Referenced by MHD_gtls_read_connection_state_init().
static void MHD__gnutls_cpy_write_security_parameters | ( | MHD_gtls_security_param_st * | dst, | |
MHD_gtls_security_param_st * | src | |||
) | [static] |
Definition at line 457 of file gnutls_constate.c.
References CPY_COMMON, MHD_gtls_security_param_st::write_bulk_cipher_algorithm, MHD_gtls_security_param_st::write_compression_algorithm, and MHD_gtls_security_param_st::write_mac_algorithm.
Referenced by MHD_gtls_write_connection_state_init().
int MHD__gnutls_set_keys | ( | MHD_gtls_session_t | session, | |
int | hash_size, | |||
int | IV_size, | |||
int | key_size, | |||
int | export_flag | |||
) |
Definition at line 59 of file gnutls_constate.c.
References MHD_gtls_session_int::cipher_specs, MHD_gtls_security_param_st::client_random, MHD_gtls_cipher_specs_st::client_write_IV, MHD_gtls_cipher_specs_st::client_write_key, MHD_gtls_cipher_specs_st::client_write_mac_secret, cliwrite, cliwrite_length, EXPORT_FINAL_KEY_SIZE, MHD_gtls_cipher_specs_st::generated_keys, GNUTLS_E_MEMORY_ERROR, ivblock, ivblock_length, keyexp, keyexp_length, MHD_gtls_security_param_st::master_secret, MHD__gnutls_hard_log, MHD__gnutls_sset_datum, MHD_gnutls_assert, MHD_gnutls_free, MHD_GNUTLS_PROTOCOL_SSL3, MHD_gnutls_secure_malloc, MHD_gnutls_ssl3_generate_random(), MHD_gnutls_ssl3_hash_md5(), MHD_gtls_bin2hex(), MHD_gtls_PRF(), MHD_gtls_session_int::security_parameters, MHD_gtls_security_param_st::server_random, MHD_gtls_cipher_specs_st::server_write_IV, MHD_gtls_cipher_specs_st::server_write_key, MHD_gtls_cipher_specs_st::server_write_mac_secret, servwrite, servwrite_length, TLS_MASTER_SIZE, TLS_RANDOM_SIZE, and MHD_gtls_security_param_st::version.
Referenced by MHD__gnutls_set_read_keys(), and MHD__gnutls_set_write_keys().
int MHD__gnutls_set_read_keys | ( | MHD_gtls_session_t | session | ) |
Definition at line 387 of file gnutls_constate.c.
References MHD__gnutls_cipher_get_key_size(), MHD__gnutls_set_keys(), MHD_gnutls_hash_get_algo_len(), MHD_gtls_cipher_get_export_flag(), MHD_gtls_cipher_get_iv_size(), MHD_gtls_security_param_st::read_bulk_cipher_algorithm, MHD_gtls_security_param_st::read_mac_algorithm, and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_read_connection_state_init().
int MHD__gnutls_set_write_keys | ( | MHD_gtls_session_t | session | ) |
Definition at line 408 of file gnutls_constate.c.
References MHD__gnutls_cipher_get_key_size(), MHD__gnutls_set_keys(), MHD_gnutls_hash_get_algo_len(), MHD_gtls_cipher_get_export_flag(), MHD_gtls_cipher_get_iv_size(), MHD_gtls_session_int::security_parameters, MHD_gtls_security_param_st::write_bulk_cipher_algorithm, and MHD_gtls_security_param_st::write_mac_algorithm.
Referenced by MHD_gtls_write_connection_state_init().
int MHD_gtls_connection_state_init | ( | MHD_gtls_session_t | session | ) |
Definition at line 475 of file gnutls_constate.c.
References MHD_gnutls_assert, and MHD_gtls_generate_master().
Referenced by MHD__gnutls_recv_handshake_final(), and MHD__gnutls_send_handshake_final().
int MHD_gtls_read_connection_state_init | ( | MHD_gtls_session_t | session | ) |
Definition at line 496 of file gnutls_constate.c.
References MHD_gtls_session_int::cipher_specs, MHD_gtls_cipher_specs_st::client_write_IV, MHD_gtls_cipher_specs_st::client_write_key, MHD_gtls_cipher_specs_st::client_write_mac_secret, MHD_gtls_session_int::connection_state, MHD_gnutls_datum_t::data, MHD_gtls_security_param_st::entity, GNUTLS_CIPHER_FAILED, GNUTLS_CLIENT, GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_MEMORY_ERROR, GNUTLS_E_UNKNOWN_COMPRESSION_ALGORITHM, GNUTLS_SERVER, MHD_gtls_session_int::internals, MHD__gnutls_cpy_read_security_parameters(), MHD__gnutls_free_datum, MHD__gnutls_handshake_log, MHD__gnutls_set_read_keys(), MHD__gnutls_sset_datum, MHD__gnutls_uint64zero, MHD_gnutls_assert, MHD_gnutls_cipher_deinit(), MHD_GNUTLS_CIPHER_NULL, MHD_gnutls_hash_get_algo_len(), MHD_gnutls_mac_is_ok(), MHD_gtls_cipher_init(), MHD_gtls_cipher_suite_get_cipher_algo(), MHD_gtls_cipher_suite_get_kx_algo(), MHD_gtls_cipher_suite_get_mac_algo(), MHD_gtls_cipher_suite_get_name(), MHD_gtls_compression_is_ok(), MHD_gtls_set_kx(), MHD_gtls_set_read_cipher(), MHD_gtls_set_read_compression(), MHD_gtls_set_read_mac(), MHD_gtls_security_param_st::read_bulk_cipher_algorithm, MHD_gtls_conn_stat_st::read_cipher_state, MHD_gtls_security_param_st::read_compression_algorithm, MHD_gtls_security_param_st::read_mac_algorithm, MHD_gtls_conn_stat_st::read_mac_secret, MHD_gtls_conn_stat_st::read_sequence_number, RESUME_FALSE, MHD_gtls_internals_st::resumed, MHD_gtls_session_int::security_parameters, MHD_gtls_cipher_specs_st::server_write_IV, MHD_gtls_cipher_specs_st::server_write_key, MHD_gtls_cipher_specs_st::server_write_mac_secret, and MHD_gnutls_datum_t::size.
Referenced by MHD__gnutls_recv_handshake_final().
int MHD_gtls_set_kx | ( | MHD_gtls_session_t | session, | |
enum MHD_GNUTLS_KeyExchangeAlgorithm | algo | |||
) |
Definition at line 926 of file gnutls_constate.c.
References GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_UNWANTED_ALGORITHM, MHD_gtls_security_param_st::kx_algorithm, MHD_gnutls_assert, MHD_gtls_kx_is_ok(), MHD_gtls_kx_priority(), and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_read_connection_state_init(), and MHD_gtls_write_connection_state_init().
int MHD_gtls_set_read_cipher | ( | MHD_gtls_session_t | session, | |
enum MHD_GNUTLS_CipherAlgorithm | algo | |||
) |
Definition at line 833 of file gnutls_constate.c.
References GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_UNWANTED_ALGORITHM, MHD_gnutls_assert, MHD_gtls_cipher_is_ok(), MHD_gtls_cipher_priority(), MHD_gtls_security_param_st::read_bulk_cipher_algorithm, and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_read_connection_state_init().
int MHD_gtls_set_read_compression | ( | MHD_gtls_session_t | session, | |
enum MHD_GNUTLS_CompressionMethod | algo | |||
) |
Definition at line 888 of file gnutls_constate.c.
References GNUTLS_E_UNKNOWN_COMPRESSION_ALGORITHM, MHD_gnutls_assert, MHD_gtls_compression_is_ok(), MHD_gtls_security_param_st::read_compression_algorithm, and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_read_connection_state_init().
int MHD_gtls_set_read_mac | ( | MHD_gtls_session_t | session, | |
enum MHD_GNUTLS_HashAlgorithm | algo | |||
) |
Definition at line 952 of file gnutls_constate.c.
References GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_UNWANTED_ALGORITHM, MHD_gnutls_assert, MHD_gnutls_mac_is_ok(), MHD_gtls_mac_priority(), MHD_gtls_security_param_st::read_mac_algorithm, and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_read_connection_state_init().
int MHD_gtls_set_write_cipher | ( | MHD_gtls_session_t | session, | |
enum MHD_GNUTLS_CipherAlgorithm | algo | |||
) |
Definition at line 859 of file gnutls_constate.c.
References GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_UNWANTED_ALGORITHM, MHD_gnutls_assert, MHD_gtls_cipher_is_ok(), MHD_gtls_cipher_priority(), MHD_gtls_session_int::security_parameters, and MHD_gtls_security_param_st::write_bulk_cipher_algorithm.
Referenced by MHD_gtls_write_connection_state_init().
int MHD_gtls_set_write_compression | ( | MHD_gtls_session_t | session, | |
enum MHD_GNUTLS_CompressionMethod | algo | |||
) |
Definition at line 906 of file gnutls_constate.c.
References GNUTLS_E_UNKNOWN_COMPRESSION_ALGORITHM, MHD_gnutls_assert, MHD_gtls_compression_is_ok(), MHD_gtls_session_int::security_parameters, and MHD_gtls_security_param_st::write_compression_algorithm.
Referenced by MHD_gtls_write_connection_state_init().
int MHD_gtls_set_write_mac | ( | MHD_gtls_session_t | session, | |
enum MHD_GNUTLS_HashAlgorithm | algo | |||
) |
Definition at line 977 of file gnutls_constate.c.
References GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_UNWANTED_ALGORITHM, MHD_gnutls_assert, MHD_gnutls_mac_is_ok(), MHD_gtls_mac_priority(), MHD_gtls_session_int::security_parameters, and MHD_gtls_security_param_st::write_mac_algorithm.
Referenced by MHD_gtls_write_connection_state_init().
int MHD_gtls_write_connection_state_init | ( | MHD_gtls_session_t | session | ) |
Definition at line 664 of file gnutls_constate.c.
References MHD_gtls_session_int::cipher_specs, MHD_gtls_cipher_specs_st::client_write_IV, MHD_gtls_cipher_specs_st::client_write_key, MHD_gtls_cipher_specs_st::client_write_mac_secret, MHD_gtls_session_int::connection_state, MHD_gnutls_datum_t::data, MHD_gtls_security_param_st::entity, GNUTLS_CIPHER_FAILED, GNUTLS_CLIENT, GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_MEMORY_ERROR, GNUTLS_E_UNKNOWN_COMPRESSION_ALGORITHM, GNUTLS_SERVER, MHD_gtls_session_int::internals, MHD__gnutls_cpy_write_security_parameters(), MHD__gnutls_free_datum, MHD__gnutls_handshake_log, MHD__gnutls_set_write_keys(), MHD__gnutls_sset_datum, MHD__gnutls_uint64zero, MHD_gnutls_assert, MHD_gnutls_cipher_deinit(), MHD_GNUTLS_CIPHER_NULL, MHD_gnutls_hash_get_algo_len(), MHD_gnutls_mac_is_ok(), MHD_gtls_cipher_init(), MHD_gtls_cipher_suite_get_cipher_algo(), MHD_gtls_cipher_suite_get_kx_algo(), MHD_gtls_cipher_suite_get_mac_algo(), MHD_gtls_cipher_suite_get_name(), MHD_gtls_compression_is_ok(), MHD_gtls_set_kx(), MHD_gtls_set_write_cipher(), MHD_gtls_set_write_compression(), MHD_gtls_set_write_mac(), RESUME_FALSE, MHD_gtls_internals_st::resumed, MHD_gtls_internals_st::resumed_security_parameters, MHD_gtls_session_int::security_parameters, MHD_gtls_cipher_specs_st::server_write_IV, MHD_gtls_cipher_specs_st::server_write_key, MHD_gtls_cipher_specs_st::server_write_mac_secret, MHD_gnutls_datum_t::size, MHD_gtls_security_param_st::write_bulk_cipher_algorithm, MHD_gtls_conn_stat_st::write_cipher_state, MHD_gtls_security_param_st::write_compression_algorithm, MHD_gtls_security_param_st::write_mac_algorithm, MHD_gtls_conn_stat_st::write_mac_secret, and MHD_gtls_conn_stat_st::write_sequence_number.
Referenced by MHD__gnutls_send_handshake_final().
const char cliwrite[] = "client write key" [static] |
Definition at line 45 of file gnutls_constate.c.
Referenced by MHD__gnutls_set_keys().
const int cliwrite_length = sizeof (cliwrite) - 1 [static] |
Definition at line 46 of file gnutls_constate.c.
Referenced by MHD__gnutls_set_keys().
const char ivblock[] = "IV block" [static] |
Definition at line 42 of file gnutls_constate.c.
Referenced by MHD__gnutls_set_keys().
const int ivblock_length = sizeof (ivblock) - 1 [static] |
Definition at line 43 of file gnutls_constate.c.
Referenced by MHD__gnutls_set_keys().
const char keyexp[] = "key expansion" [static] |
Definition at line 39 of file gnutls_constate.c.
Referenced by MHD__gnutls_set_keys().
const int keyexp_length = sizeof (keyexp) - 1 [static] |
Definition at line 40 of file gnutls_constate.c.
Referenced by MHD__gnutls_set_keys().
const char servwrite[] = "server write key" [static] |
Definition at line 48 of file gnutls_constate.c.
Referenced by MHD__gnutls_set_keys().
const int servwrite_length = sizeof (servwrite) - 1 [static] |
Definition at line 49 of file gnutls_constate.c.
Referenced by MHD__gnutls_set_keys().