#include "MHD_config.h"
#include "gnutls_int.h"
#include "gnutls_errors.h"
#include "gnutls_dh.h"
#include "debug.h"
#include "gnutls_algorithms.h"
#include "gnutls_cipher.h"
#include "gnutls_buffers.h"
#include "gnutls_kx.h"
#include "gnutls_handshake.h"
#include "gnutls_num.h"
#include "gnutls_hash_int.h"
#include "gnutls_extensions.h"
#include "gnutls_supplemental.h"
#include "gnutls_auth_int.h"
#include "auth_cert.h"
#include "gnutls_cert.h"
#include "gnutls_constate.h"
#include "gnutls_record.h"
#include "gnutls_state.h"
#include "gnutls_rsa_export.h"
#include "gc.h"
Go to the source code of this file.
#define CLIENT_MSG "client finished" |
Definition at line 185 of file gnutls_handshake.c.
Referenced by MHD__gnutls_finished().
#define ERR | ( | x, | |||
y | ) |
Definition at line 54 of file gnutls_handshake.c.
Referenced by MHD__gnutls_recv_finished(), MHD__gnutls_recv_handshake_final(), and MHD__gnutls_send_handshake_final().
#define FALSE 0 |
Definition at line 58 of file gnutls_handshake.c.
Referenced by MHD_gtls_handshake_common().
#define IMED_RET | ( | str, | |||
ret | ) |
do { \ if (ret < 0) { \ if (MHD_gtls_error_is_fatal(ret)==0) return ret; \ MHD_gnutls_assert(); \ ERR( str, ret); \ MHD__gnutls_handshake_hash_buffers_clear(session); \ return ret; \ } } while (0)
Definition at line 2173 of file gnutls_handshake.c.
Referenced by MHD_gtls_handshake_common(), and MHD_gtls_handshake_server().
#define MAX_EXT_DATA_LENGTH 1024 |
Definition at line 64 of file gnutls_handshake.c.
Referenced by MHD__gnutls_send_server_hello().
#define MHD__gnutls_handshake_header_buffer_clear | ( | session | ) | session->internals.handshake_header_buffer.header_size = 0 |
Definition at line 1034 of file gnutls_handshake.c.
Referenced by MHD_gtls_recv_handshake().
#define SERVER_MSG "server finished" |
Definition at line 184 of file gnutls_handshake.c.
Referenced by MHD__gnutls_finished().
#define SSL2_HEADERS 1 |
Definition at line 905 of file gnutls_handshake.c.
Referenced by MHD__gnutls_recv_handshake_header().
#define SSL3_CLIENT_MSG "CLNT" |
Definition at line 135 of file gnutls_handshake.c.
Referenced by MHD__gnutls_ssl3_finished().
#define SSL3_SERVER_MSG "SRVR" |
Definition at line 136 of file gnutls_handshake.c.
Referenced by MHD__gnutls_ssl3_finished().
#define SSL_MSG_LEN 4 |
Definition at line 137 of file gnutls_handshake.c.
Referenced by MHD__gnutls_ssl3_finished().
#define TLS_MSG_LEN 15 |
Definition at line 186 of file gnutls_handshake.c.
Referenced by MHD__gnutls_finished().
#define TRUE 1 |
Definition at line 57 of file gnutls_handshake.c.
Referenced by MHD__gnutls_recv_handshake_final(), MHD__gnutls_send_handshake_final(), and MHD_gtls_handshake_common().
static int check_server_params | ( | MHD_gtls_session_t | session, | |
enum MHD_GNUTLS_KeyExchangeAlgorithm | kx, | |||
enum MHD_GNUTLS_KeyExchangeAlgorithm * | alg, | |||
int | alg_size | |||
) | [inline, static] |
Definition at line 2596 of file gnutls_handshake.c.
References MHD_gtls_certificate_credentials_st::dh_params, MHD_gtls_session_int::key, MHD__gnutls_rsa_params_to_mpi(), MHD_gnutls_assert, MHD_GNUTLS_CRD_CERTIFICATE, MHD_gtls_certificate_get_rsa_params(), MHD_gtls_dh_params_to_mpi(), MHD_gtls_get_cred(), MHD_gtls_get_dh_params(), MHD_gtls_kx_needs_dh_params(), MHD_gtls_kx_needs_rsa_params(), MHD_gtls_map_kx_get_cred(), MHD_gtls_certificate_credentials_st::params_func, and MHD_gtls_certificate_credentials_st::rsa_params.
Referenced by MHD_gtls_remove_unwanted_ciphersuites().
static int MHD__gnutls_abort_handshake | ( | MHD_gtls_session_t | session, | |
int | ret | |||
) | [inline, static] |
Definition at line 1992 of file gnutls_handshake.c.
References GNUTLS_A_NO_RENEGOTIATION, GNUTLS_E_GOT_APPLICATION_DATA, GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_WARNING_ALERT_RECEIVED, and MHD_gnutls_alert_get().
Referenced by MHD__gnutls_handshake().
static int MHD__gnutls_finished | ( | MHD_gtls_session_t | session, | |
int | type, | |||
void * | ret | |||
) | [static] |
Definition at line 188 of file gnutls_handshake.c.
References CLIENT_MSG, GNUTLS_E_HASH_FAILED, GNUTLS_SERVER, MHD_gtls_internals_st::handshake_mac_handle_md5, MHD_gtls_internals_st::handshake_mac_handle_sha, MHD_gtls_session_int::internals, MHD_gtls_security_param_st::master_secret, MHD__gnutls_protocol_get_version(), MHD_gnutls_assert, MHD_gnutls_hash_copy(), MHD_gnutls_hash_deinit(), MHD_GNUTLS_PROTOCOL_TLS1_2, MHD_gtls_PRF(), MHD_gtls_session_int::security_parameters, SERVER_MSG, TLS_MASTER_SIZE, and TLS_MSG_LEN.
Referenced by MHD__gnutls_recv_finished(), and MHD__gnutls_send_finished().
int MHD__gnutls_handshake | ( | MHD_gtls_session_t | session | ) |
MHD__gnutls_handshake - This is the main function in the handshake protocol. : is a MHD_gtls_session_t structure.
This function does the handshake of the TLS/SSL protocol, and initializes the TLS connection.
This function will fail if any problem is encountered, and will return a negative error code. In case of a client, if the client has asked to resume a session, but the server couldn't, then a full handshake will be performed.
The non-fatal errors such as GNUTLS_E_AGAIN and GNUTLS_E_INTERRUPTED interrupt the handshake procedure, which should be later be resumed. Call this function again, until it returns 0; cf. MHD__gnutls_record_get_direction() and MHD_gtls_error_is_fatal().
If this function is called by a server after a rehandshake request then GNUTLS_E_GOT_APPLICATION_DATA or GNUTLS_E_WARNING_ALERT_RECEIVED may be returned. Note that these are non fatal errors, only in the specific case of a rehandshake. Their meaning is that the client rejected the rehandshake request.
Returns: GNUTLS_E_SUCCESS on success, otherwise an error.
Definition at line 2124 of file gnutls_handshake.c.
References MHD_gtls_security_param_st::entity, GNUTLS_CLIENT, MHD__gnutls_abort_handshake(), MHD__gnutls_handshake_hash_init(), MHD__gnutls_handshake_io_buffer_clear, MHD_gnutls_assert, MHD_gtls_handshake_common(), MHD_gtls_handshake_internal_state_clear(), MHD_gtls_handshake_server(), MHD_gtls_session_int::security_parameters, STATE, and STATE0.
Referenced by MHD_tls_connection_handle_read().
static int MHD__gnutls_handshake_hash_add_recvd | ( | MHD_gtls_session_t | session, | |
MHD_gnutls_handshake_description_t | recv_type, | |||
opaque * | header, | |||
uint16_t | header_size, | |||
opaque * | dataptr, | |||
uint32_t | datalen | |||
) | [static] |
Definition at line 1040 of file gnutls_handshake.c.
References GNUTLS_HANDSHAKE_HELLO_REQUEST, MHD__gnutls_handshake_hash_pending(), MHD_gnutls_assert, and MHD_gtls_handshake_buffer_put().
Referenced by MHD_gtls_recv_handshake().
static int MHD__gnutls_handshake_hash_add_sent | ( | MHD_gtls_session_t | session, | |
MHD_gnutls_handshake_description_t | type, | |||
opaque * | dataptr, | |||
uint32_t | datalen | |||
) | [static] |
Definition at line 801 of file gnutls_handshake.c.
References GNUTLS_HANDSHAKE_HELLO_REQUEST, MHD_gtls_internals_st::handshake_mac_handle_md5, MHD_gtls_internals_st::handshake_mac_handle_sha, MHD_gtls_session_int::internals, MHD__gnutls_handshake_hash_pending(), MHD_gnutls_assert, and MHD_gnutls_hash().
Referenced by MHD_gtls_send_handshake().
static void MHD__gnutls_handshake_hash_buffers_clear | ( | MHD_gtls_session_t | session | ) | [static] |
Definition at line 94 of file gnutls_handshake.c.
References MHD_gtls_internals_st::handshake_mac_handle_md5, MHD_gtls_internals_st::handshake_mac_handle_sha, MHD_gtls_session_int::internals, MHD_gnutls_hash_deinit(), and MHD_gtls_handshake_buffer_clear().
Referenced by MHD_gtls_handshake_common().
static int MHD__gnutls_handshake_hash_init | ( | MHD_gtls_session_t | session | ) | [inline, static] |
Definition at line 2007 of file gnutls_handshake.c.
References GNUTLS_E_MEMORY_ERROR, GNUTLS_HASH_FAILED, MHD_gtls_internals_st::handshake_mac_handle_md5, MHD_gtls_internals_st::handshake_mac_handle_sha, MHD_gtls_session_int::internals, MHD_gnutls_assert, MHD_GNUTLS_MAC_MD5, MHD_GNUTLS_MAC_SHA1, and MHD_gtls_hash_init().
Referenced by MHD__gnutls_handshake().
static int MHD__gnutls_handshake_hash_pending | ( | MHD_gtls_session_t | session | ) | [static] |
Definition at line 420 of file gnutls_handshake.c.
References GNUTLS_E_INTERNAL_ERROR, MHD_gtls_internals_st::handshake_mac_handle_md5, MHD_gtls_internals_st::handshake_mac_handle_sha, MHD_gtls_session_int::internals, MHD_gnutls_assert, MHD_gnutls_hash(), MHD_gtls_handshake_buffer_empty(), and MHD_gtls_handshake_buffer_get_ptr().
Referenced by MHD__gnutls_handshake_hash_add_recvd(), MHD__gnutls_handshake_hash_add_sent(), and MHD__gnutls_send_finished().
void MHD__gnutls_handshake_set_max_packet_length | ( | MHD_gtls_session_t | session, | |
size_t | max | |||
) |
gnutls_handshake_set_max_packet_length - This function will set the maximum length of a handshake message : is a gnutls_session_t structure. : is the maximum number.
This function will set the maximum size of a handshake message. Handshake messages over this size are rejected. The default value is 16kb which is large enough. Set this to 0 if you do not want to set an upper limit.
Definition at line 115 of file gnutls_handshake.c.
References MHD_gtls_session_int::internals, and MHD_gtls_internals_st::max_handshake_data_buffer_size.
Referenced by MHD__gnutls_init().
static int MHD__gnutls_read_client_hello | ( | MHD_gtls_session_t | session, | |
opaque * | data, | |||
int | datalen | |||
) | [static] |
Definition at line 300 of file gnutls_handshake.c.
References DECR_LEN, EXTENSION_APPLICATION, EXTENSION_TLS, GNUTLS_E_UNEXPECTED_PACKET_LENGTH, MHD_gtls_session_int::internals, MHD__gnutls_handshake_log, MHD__gnutls_server_select_comp_method(), MHD_gnutls_assert, MHD_GNUTLS_PROTOCOL_TLS1_0, MHD_gtls_generate_session_id(), MHD_gtls_negotiate_version(), MHD_gtls_parse_extensions(), MHD_gtls_read_uint16(), MHD_gtls_server_select_suite(), MHD_gtls_set_client_random(), MHD_gtls_set_server_random(), MHD_gtls_tls_create_random(), MHD_gtls_version_get(), RESUME_FALSE, MHD_gtls_internals_st::resumed, MHD_gtls_session_int::security_parameters, MHD_gtls_security_param_st::session_id, set_adv_version, MHD_gtls_security_param_st::timestamp, TLS_MAX_SESSION_ID_SIZE, and TLS_RANDOM_SIZE.
Referenced by MHD_gtls_recv_hello().
static int MHD__gnutls_recv_finished | ( | MHD_gtls_session_t | session | ) | [static] |
Definition at line 515 of file gnutls_handshake.c.
References MHD_gtls_security_param_st::entity, ERR, GNUTLS_E_ERROR_IN_FINISHED_PACKET, GNUTLS_HANDSHAKE_FINISHED, MANDATORY_PACKET, MHD__gnutls_finished(), MHD__gnutls_protocol_get_version(), MHD__gnutls_ssl3_finished(), MHD_gnutls_assert, MHD_gnutls_free, MHD_GNUTLS_PROTOCOL_SSL3, MHD_gtls_recv_handshake(), and MHD_gtls_session_int::security_parameters.
Referenced by MHD__gnutls_recv_handshake_final().
static int MHD__gnutls_recv_handshake_final | ( | MHD_gtls_session_t | session, | |
int | init | |||
) | [static] |
Definition at line 2356 of file gnutls_handshake.c.
References ERR, GNUTLS_CHANGE_CIPHER_SPEC, GNUTLS_E_UNEXPECTED_PACKET_LENGTH, MHD__gnutls_recv_finished(), MHD_gnutls_assert, MHD_gtls_connection_state_init(), MHD_gtls_read_connection_state_init(), MHD_gtls_recv_int(), STATE, STATE0, STATE30, STATE31, and TRUE.
Referenced by MHD_gtls_handshake_common().
static int MHD__gnutls_recv_handshake_header | ( | MHD_gtls_session_t | session, | |
MHD_gnutls_handshake_description_t | type, | |||
MHD_gnutls_handshake_description_t * | recv_type | |||
) | [static] |
Definition at line 907 of file gnutls_handshake.c.
References GNUTLS_E_UNEXPECTED_HANDSHAKE_PACKET, GNUTLS_E_UNEXPECTED_PACKET_LENGTH, GNUTLS_HANDSHAKE, GNUTLS_HANDSHAKE_CLIENT_HELLO, MHD_gtls_internals_st::handshake_header_buffer, HANDSHAKE_HEADER_SIZE, MHD_gtls_handshake_header_buffer_st::header, MHD_gtls_handshake_header_buffer_st::header_size, MHD_gtls_session_int::internals, MHD__gnutls_handshake2str(), MHD__gnutls_handshake_log, MHD_gnutls_assert, MHD_gtls_handshake_io_recv_int(), MHD_gtls_read_uint24(), MHD_gtls_handshake_header_buffer_st::packet_length, MHD_gtls_handshake_header_buffer_st::recv_type, SSL2_HEADERS, and MHD_gtls_internals_st::v2_hello.
Referenced by MHD_gtls_recv_handshake().
static int MHD__gnutls_recv_supplemental | ( | MHD_gtls_session_t | session | ) | [static] |
Definition at line 2067 of file gnutls_handshake.c.
References GNUTLS_HANDSHAKE_SUPPLEMENTAL, MHD__gnutls_debug_log, MHD__gnutls_parse_supplemental(), MHD_gnutls_assert, MHD_gnutls_free, MHD_gtls_recv_handshake(), and OPTIONAL_PACKET.
Referenced by MHD_gtls_handshake_server().
int MHD__gnutls_rehandshake | ( | MHD_gtls_session_t | session | ) |
MHD__gnutls_rehandshake - This function will renegotiate security parameters : is a MHD_gtls_session_t structure.
This function will renegotiate security parameters with the client. This should only be called in case of a server.
This message informs the peer that we want to renegotiate parameters (perform a handshake).
If this function succeeds (returns 0), you must call the MHD__gnutls_handshake() function in order to negotiate the new parameters.
If the client does not wish to renegotiate parameters he will should with an alert message, thus the return code will be GNUTLS_E_WARNING_ALERT_RECEIVED and the alert will be GNUTLS_A_NO_RENEGOTIATION. A client may also choose to ignore this message.
Returns: GNUTLS_E_SUCCESS on success, otherwise an error.
Definition at line 1972 of file gnutls_handshake.c.
References AGAIN, GNUTLS_HANDSHAKE_HELLO_REQUEST, MHD__gnutls_send_empty_handshake(), MHD_gnutls_assert, STATE, STATE0, and STATE50.
static int MHD__gnutls_send_empty_handshake | ( | MHD_gtls_session_t | session, | |
MHD_gnutls_handshake_description_t | type, | |||
int | again | |||
) | [static] |
Definition at line 783 of file gnutls_handshake.c.
References MHD_gtls_send_handshake().
Referenced by MHD__gnutls_rehandshake(), and MHD_gtls_handshake_server().
static int MHD__gnutls_send_finished | ( | MHD_gtls_session_t | session, | |
int | again | |||
) | [static] |
Definition at line 460 of file gnutls_handshake.c.
References MHD_gtls_security_param_st::entity, GNUTLS_HANDSHAKE_FINISHED, MHD__gnutls_finished(), MHD__gnutls_handshake_hash_pending(), MHD__gnutls_protocol_get_version(), MHD__gnutls_ssl3_finished(), MHD_gnutls_assert, MHD_GNUTLS_PROTOCOL_SSL3, MHD_gtls_send_handshake(), and MHD_gtls_session_int::security_parameters.
Referenced by MHD__gnutls_send_handshake_final().
static int MHD__gnutls_send_handshake_final | ( | MHD_gtls_session_t | session, | |
int | init | |||
) | [static] |
Definition at line 2294 of file gnutls_handshake.c.
References AGAIN, ERR, MHD__gnutls_send_finished(), MHD_gnutls_assert, MHD_gtls_connection_state_init(), MHD_gtls_send_change_cipher_spec(), MHD_gtls_write_connection_state_init(), STATE, STATE0, STATE20, STATE21, and TRUE.
Referenced by MHD_gtls_handshake_common().
static int MHD__gnutls_send_server_hello | ( | MHD_gtls_session_t | session, | |
int | again | |||
) | [static] |
Definition at line 1790 of file gnutls_handshake.c.
References MHD_gtls_security_param_st::current_cipher_suite, GNUTLS_E_MEMORY_ERROR, GNUTLS_HANDSHAKE_SERVER_HELLO, MAX_EXT_DATA_LENGTH, MHD__gnutls_handshake_log, MHD_gnutls_assert, MHD_gtls_bin2hex(), MHD_gtls_compression_get_num(), MHD_gtls_gen_extensions(), MHD_gtls_send_handshake(), MHD_gtls_version_get_major(), MHD_gtls_version_get_minor(), MHD_gtls_session_int::security_parameters, MHD_gtls_security_param_st::server_random, MHD_gtls_security_param_st::session_id, MHD_gtls_security_param_st::session_id_size, cipher_suite_st::suite, TLS_MAX_SESSION_ID_SIZE, TLS_RANDOM_SIZE, and MHD_gtls_security_param_st::version.
Referenced by MHD_gtls_send_hello().
static int MHD__gnutls_send_supplemental | ( | MHD_gtls_session_t | session, | |
int | again | |||
) | [static] |
Definition at line 2037 of file gnutls_handshake.c.
References MHD_gtls_string::data, GNUTLS_HANDSHAKE_SUPPLEMENTAL, MHD_gtls_string::length, MHD__gnutls_debug_log, MHD__gnutls_gen_supplemental(), MHD_gnutls_assert, MHD_gtls_buffer_clear, MHD_gtls_buffer_init, and MHD_gtls_send_handshake().
Referenced by MHD_gtls_handshake_server().
static int MHD__gnutls_server_find_pk_algos_in_ciphersuites | ( | const opaque * | data, | |
int | datalen | |||
) | [static] |
Definition at line 585 of file gnutls_handshake.c.
References GNUTLS_E_UNEXPECTED_PACKET_LENGTH, GNUTLS_PK_ANY, GNUTLS_PK_NONE, MHD_gnutls_assert, MHD_GNUTLS_CRD_CERTIFICATE, MHD_gtls_cipher_suite_get_kx_algo(), MHD_gtls_map_kx_get_cred(), MHD_gtls_map_pk_get_pk(), and cipher_suite_st::suite.
Referenced by MHD_gtls_server_select_suite().
static int MHD__gnutls_server_select_comp_method | ( | MHD_gtls_session_t | session, | |
opaque * | data, | |||
int | datalen | |||
) | [static] |
Definition at line 736 of file gnutls_handshake.c.
References MHD_gtls_internals_st::compression_method, GNUTLS_E_UNKNOWN_COMPRESSION_ALGORITHM, MHD_gtls_session_int::internals, MHD_gnutls_assert, MHD_gnutls_free, MHD_gtls_compression_get_id_from_int(), and MHD_gtls_supported_compression_methods().
Referenced by MHD__gnutls_read_client_hello().
static int MHD__gnutls_ssl3_finished | ( | MHD_gtls_session_t | session, | |
int | type, | |||
opaque * | ret | |||
) | [static] |
Definition at line 139 of file gnutls_handshake.c.
References GNUTLS_E_HASH_FAILED, GNUTLS_SERVER, MHD_gtls_internals_st::handshake_mac_handle_md5, MHD_gtls_internals_st::handshake_mac_handle_sha, MHD_gtls_session_int::internals, MHD_gnutls_assert, MHD_gnutls_hash(), MHD_gnutls_hash_copy(), MHD_gnutls_hash_deinit(), MHD_gnutls_mac_deinit_ssl3_handshake(), MHD_gtls_session_int::security_parameters, SSL3_CLIENT_MSG, SSL3_SERVER_MSG, SSL_MSG_LEN, and TLS_MASTER_SIZE.
Referenced by MHD__gnutls_recv_finished(), and MHD__gnutls_send_finished().
static int MHD_gtls_generate_session_id | ( | opaque * | session_id, | |
uint8_t * | len | |||
) | [static] |
Definition at line 2553 of file gnutls_handshake.c.
References GC_OK, GNUTLS_E_RANDOM_FAILED, MHD_gc_nonce(), MHD_gnutls_assert, and TLS_MAX_SESSION_ID_SIZE.
Referenced by MHD__gnutls_read_client_hello().
enum MHD_GNUTLS_Protocol MHD_gtls_get_adv_version | ( | MHD_gtls_session_t | session | ) |
Definition at line 2800 of file gnutls_handshake.c.
References MHD__gnutls_get_adv_version_major, MHD__gnutls_get_adv_version_minor, and MHD_gtls_version_get().
Referenced by MHD__gnutls_gen_rsa_client_kx().
static int MHD_gtls_handshake_common | ( | MHD_gtls_session_t | session | ) | [static] |
Definition at line 2518 of file gnutls_handshake.c.
References MHD_gtls_security_param_st::entity, FALSE, GNUTLS_CLIENT, GNUTLS_SERVER, IMED_RET, MHD_gtls_session_int::internals, MHD__gnutls_handshake_hash_buffers_clear(), MHD__gnutls_recv_handshake_final(), MHD__gnutls_send_handshake_final(), RESUME_FALSE, RESUME_TRUE, MHD_gtls_internals_st::resumed, MHD_gtls_session_int::security_parameters, and TRUE.
Referenced by MHD__gnutls_handshake().
static int MHD_gtls_handshake_server | ( | MHD_gtls_session_t | session | ) | [static] |
Definition at line 2417 of file gnutls_handshake.c.
References AGAIN, MHD_gtls_ext_st::do_recv_supplemental, MHD_gtls_ext_st::do_send_supplemental, MHD_gtls_security_param_st::extensions, GNUTLS_HANDSHAKE_CLIENT_HELLO, GNUTLS_HANDSHAKE_SERVER_HELLO_DONE, IMED_RET, MHD_gtls_session_int::internals, MANDATORY_PACKET, MHD__gnutls_recv_supplemental(), MHD__gnutls_send_empty_handshake(), MHD__gnutls_send_supplemental(), MHD_gtls_recv_client_certificate(), MHD_gtls_recv_client_certificate_verify_message(), MHD_gtls_recv_client_kx_message(), MHD_gtls_recv_handshake(), MHD_gtls_send_hello(), MHD_gtls_send_server_certificate(), MHD_gtls_send_server_certificate_request(), MHD_gtls_send_server_kx_message(), RESUME_FALSE, MHD_gtls_internals_st::resumed, MHD_gtls_session_int::security_parameters, STATE, STATE0, STATE1, STATE2, STATE3, STATE4, STATE5, STATE6, STATE7, STATE70, STATE71, STATE8, and STATE9.
Referenced by MHD__gnutls_handshake().
static int MHD_gtls_negotiate_version | ( | MHD_gtls_session_t | session, | |
enum MHD_GNUTLS_Protocol | adv_version | |||
) | [static] |
Definition at line 272 of file gnutls_handshake.c.
References MHD_gtls_set_current_version(), MHD_gtls_version_is_supported(), and MHD_gtls_version_max().
Referenced by MHD__gnutls_read_client_hello().
int MHD_gtls_recv_handshake | ( | MHD_gtls_session_t | session, | |
uint8_t ** | data, | |||
int * | datalen, | |||
MHD_gnutls_handshake_description_t | type, | |||
Optional | optional | |||
) |
Definition at line 1089 of file gnutls_handshake.c.
References GNUTLS_E_MEMORY_ERROR, GNUTLS_E_UNEXPECTED_HANDSHAKE_PACKET, GNUTLS_E_UNEXPECTED_PACKET_LENGTH, GNUTLS_HANDSHAKE, GNUTLS_HANDSHAKE_CERTIFICATE_PKT, GNUTLS_HANDSHAKE_CERTIFICATE_REQUEST, GNUTLS_HANDSHAKE_CERTIFICATE_VERIFY, GNUTLS_HANDSHAKE_CLIENT_HELLO, GNUTLS_HANDSHAKE_CLIENT_KEY_EXCHANGE, GNUTLS_HANDSHAKE_FINISHED, GNUTLS_HANDSHAKE_SERVER_HELLO, GNUTLS_HANDSHAKE_SERVER_HELLO_DONE, GNUTLS_HANDSHAKE_SERVER_KEY_EXCHANGE, GNUTLS_HANDSHAKE_SUPPLEMENTAL, MHD_gtls_session_int::internals, MHD_gtls_internals_st::last_handshake_in, MHD__gnutls_handshake_hash_add_recvd(), MHD__gnutls_handshake_header_buffer_clear, MHD__gnutls_recv_handshake_header(), MHD_gnutls_assert, MHD_gnutls_free, MHD_gnutls_malloc, MHD_gtls_handshake_io_recv_int(), MHD_gtls_recv_hello(), and OPTIONAL_PACKET.
Referenced by MHD__gnutls_recv_finished(), MHD__gnutls_recv_supplemental(), MHD_gtls_handshake_server(), MHD_gtls_recv_client_certificate(), MHD_gtls_recv_client_certificate_verify_message(), MHD_gtls_recv_client_kx_message(), MHD_gtls_recv_server_certificate(), MHD_gtls_recv_server_certificate_request(), and MHD_gtls_recv_server_kx_message().
int MHD_gtls_recv_hello | ( | MHD_gtls_session_t | session, | |
opaque * | data, | |||
int | datalen | |||
) |
Definition at line 1897 of file gnutls_handshake.c.
References MHD_gtls_security_param_st::entity, GNUTLS_CLIENT, MHD__gnutls_read_client_hello(), MHD_gnutls_assert, and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_recv_handshake().
int MHD_gtls_recv_hello_request | ( | MHD_gtls_session_t | session, | |
void * | data, | |||
uint32_t | data_size | |||
) |
Definition at line 2567 of file gnutls_handshake.c.
References MHD_gtls_security_param_st::entity, GNUTLS_E_REHANDSHAKE, GNUTLS_E_UNEXPECTED_PACKET, GNUTLS_E_UNEXPECTED_PACKET_LENGTH, GNUTLS_HANDSHAKE_HELLO_REQUEST, GNUTLS_SERVER, MHD_gnutls_assert, and MHD_gtls_session_int::security_parameters.
Referenced by record_check_type().
static int MHD_gtls_remove_unwanted_ciphersuites | ( | MHD_gtls_session_t | session, | |
cipher_suite_st ** | cipherSuites, | |||
int | numCipherSuites, | |||
enum MHD_GNUTLS_PublicKeyAlgorithm | requested_pk_algo | |||
) | [static] |
Definition at line 2682 of file gnutls_handshake.c.
References check_server_params(), MHD_gtls_security_param_st::entity, GNUTLS_E_MEMORY_ERROR, GNUTLS_SERVER, MHD_gtls_session_int::key, MHD__gnutls_handshake_log, MHD__gnutls_x509_log, MHD_gnutls_assert, MHD_GNUTLS_CRD_CERTIFICATE, MHD_gnutls_free, MHD_gnutls_malloc, MHD_gtls_cipher_suite_get_kx_algo(), MHD_gtls_cipher_suite_get_name(), MHD_gtls_get_cred(), MHD_gtls_get_kx_cred(), MHD_gtls_selected_cert_supported_kx(), MHD_gtls_server_select_cert(), MHD_gtls_strerror(), MHD_gtls_session_int::security_parameters, and cipher_suite_st::suite.
Referenced by MHD_gtls_server_select_suite().
int MHD_gtls_send_handshake | ( | MHD_gtls_session_t | session, | |
void * | i_data, | |||
uint32_t | i_datasize, | |||
MHD_gnutls_handshake_description_t | type | |||
) |
Definition at line 831 of file gnutls_handshake.c.
References GNUTLS_E_INVALID_REQUEST, GNUTLS_E_MEMORY_ERROR, GNUTLS_HANDSHAKE, GNUTLS_HANDSHAKE_HELLO_REQUEST, HANDSHAKE_HEADER_SIZE, MHD_gtls_session_int::internals, MHD_gtls_internals_st::last_handshake_out, MHD__gnutls_handshake2str(), MHD__gnutls_handshake_hash_add_sent(), MHD__gnutls_handshake_log, MHD_gnutls_assert, MHD_gtls_handshake_io_send_int(), MHD_gtls_handshake_io_write_flush(), and MHD_gtls_write_uint24().
Referenced by MHD__gnutls_send_empty_handshake(), MHD__gnutls_send_finished(), MHD__gnutls_send_server_hello(), MHD__gnutls_send_supplemental(), MHD_gtls_send_client_certificate(), MHD_gtls_send_client_certificate_verify(), MHD_gtls_send_client_kx_message(), MHD_gtls_send_server_certificate(), MHD_gtls_send_server_certificate_request(), and MHD_gtls_send_server_kx_message().
int MHD_gtls_send_hello | ( | MHD_gtls_session_t | session, | |
int | again | |||
) |
Definition at line 1874 of file gnutls_handshake.c.
References MHD_gtls_security_param_st::entity, GNUTLS_CLIENT, MHD__gnutls_send_server_hello(), and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_handshake_server().
static int MHD_gtls_server_select_suite | ( | MHD_gtls_session_t | session, | |
opaque * | data, | |||
int | datalen | |||
) | [static] |
Definition at line 622 of file gnutls_handshake.c.
References MHD_gtls_internals_st::auth_struct, MHD_gtls_security_param_st::current_cipher_suite, GNUTLS_E_INSUFFICIENT_CREDENTIALS, GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_UNEXPECTED_PACKET_LENGTH, GNUTLS_E_UNKNOWN_CIPHER_SUITE, MHD_gtls_session_int::internals, MHD__gnutls_handshake_log, MHD__gnutls_server_find_pk_algos_in_ciphersuites(), MHD_gnutls_assert, MHD_gnutls_free, MHD_gtls_cipher_suite_get_kx_algo(), MHD_gtls_cipher_suite_get_name(), MHD_gtls_get_kx_cred(), MHD_gtls_kx_auth_struct(), MHD_gtls_remove_unwanted_ciphersuites(), MHD_gtls_supported_ciphersuites(), MHD_gtls_session_int::security_parameters, and cipher_suite_st::suite.
Referenced by MHD__gnutls_read_client_hello().
static void MHD_gtls_set_client_random | ( | MHD_gtls_session_t | session, | |
uint8_t * | rnd | |||
) | [static] |
Definition at line 129 of file gnutls_handshake.c.
References MHD_gtls_security_param_st::client_random, MHD_gtls_session_int::security_parameters, and TLS_RANDOM_SIZE.
Referenced by MHD__gnutls_read_client_hello().
static void MHD_gtls_set_server_random | ( | MHD_gtls_session_t | session, | |
uint8_t * | rnd | |||
) | [static] |
Definition at line 123 of file gnutls_handshake.c.
References MHD_gtls_session_int::security_parameters, MHD_gtls_security_param_st::server_random, and TLS_RANDOM_SIZE.
Referenced by MHD__gnutls_read_client_hello().
static int MHD_gtls_tls_create_random | ( | opaque * | dst | ) | [static] |
Definition at line 247 of file gnutls_handshake.c.
References GC_OK, GNUTLS_E_RANDOM_FAILED, MHD_gc_nonce(), MHD_gnutls_assert, MHD_gtls_write_uint32(), and TLS_RANDOM_SIZE.
Referenced by MHD__gnutls_read_client_hello().