#include "MHD_config.h"#include "gnutls_int.h"#include "gnutls_extensions.h"#include "gnutls_errors.h"#include "ext_max_record.h"#include <ext_cert_type.h>#include <ext_server_name.h>#include <gnutls_num.h>

Go to the source code of this file.
Defines | |
| #define | GNUTLS_EXTENSION_ENTRY(type, parse_type, ext_func_recv, ext_func_send) { #type, type, parse_type, ext_func_recv, ext_func_send } |
| #define | MAX_EXT_SIZE 10 |
| #define | GNUTLS_EXTENSION_LOOP2(b) |
| #define | GNUTLS_EXTENSION_LOOP(a) GNUTLS_EXTENSION_LOOP2( if(p->type == type) { a; break; } ) |
Functions | |
| MHD_gtls_ext_recv_func | MHD_gtls_ext_func_recv (uint16_t type, MHD_gtls_ext_parse_type_t parse_type) |
| MHD_gtls_ext_send_func | MHD_gtls_ext_func_send (uint16_t type) |
| const char * | MHD_gtls_extension_get_name (uint16_t type) |
| static int | MHD__gnutls_extension_list_check (MHD_gtls_session_t session, uint16_t type) |
| int | MHD_gtls_parse_extensions (MHD_gtls_session_t session, MHD_gtls_ext_parse_type_t parse_type, const opaque *data, int data_size) |
| static void | MHD__gnutls_extension_list_add (MHD_gtls_session_t session, uint16_t type) |
| int | MHD_gtls_gen_extensions (MHD_gtls_session_t session, opaque *data, size_t data_size) |
Variables | |
| const int | MHD_gtls_extensions_size = MAX_EXT_SIZE |
| MHD_gtls_extension_entry | MHD_gtls_extensions [MAX_EXT_SIZE] |
| #define GNUTLS_EXTENSION_ENTRY | ( | type, | |||
| parse_type, | |||||
| ext_func_recv, | |||||
| ext_func_send | ) | { #type, type, parse_type, ext_func_recv, ext_func_send } |
Definition at line 40 of file gnutls_extensions.c.
| #define GNUTLS_EXTENSION_LOOP | ( | a | ) | GNUTLS_EXTENSION_LOOP2( if(p->type == type) { a; break; } ) |
Definition at line 67 of file gnutls_extensions.c.
Referenced by MHD_gtls_ext_func_recv(), MHD_gtls_ext_func_send(), and MHD_gtls_extension_get_name().
| #define GNUTLS_EXTENSION_LOOP2 | ( | b | ) |
Value:
MHD_gtls_extension_entry *p; \ for(p = MHD_gtls_extensions; p->name != NULL; p++) { b ; }
Definition at line 63 of file gnutls_extensions.c.
| #define MAX_EXT_SIZE 10 |
Definition at line 44 of file gnutls_extensions.c.
| static void MHD__gnutls_extension_list_add | ( | MHD_gtls_session_t | session, | |
| uint16_t | type | |||
| ) | [static] |
Definition at line 200 of file gnutls_extensions.c.
References MHD_gtls_security_param_st::entity, MHD_gtls_internals_st::extensions_sent, MHD_gtls_internals_st::extensions_sent_size, GNUTLS_CLIENT, MHD_gtls_session_int::internals, MAX_EXT_TYPES, MHD__gnutls_debug_log, and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_gen_extensions().

| static int MHD__gnutls_extension_list_check | ( | MHD_gtls_session_t | session, | |
| uint16_t | type | |||
| ) | [static] |
Definition at line 109 of file gnutls_extensions.c.
References MHD_gtls_security_param_st::entity, MHD_gtls_internals_st::extensions_sent, MHD_gtls_internals_st::extensions_sent_size, GNUTLS_CLIENT, GNUTLS_E_RECEIVED_ILLEGAL_EXTENSION, MHD_gtls_session_int::internals, and MHD_gtls_session_int::security_parameters.
Referenced by MHD_gtls_parse_extensions().

| MHD_gtls_ext_recv_func MHD_gtls_ext_func_recv | ( | uint16_t | type, | |
| MHD_gtls_ext_parse_type_t | parse_type | |||
| ) |
Definition at line 74 of file gnutls_extensions.c.
References EXTENSION_ANY, and GNUTLS_EXTENSION_LOOP.
Referenced by MHD_gtls_parse_extensions().

| MHD_gtls_ext_send_func MHD_gtls_ext_func_send | ( | uint16_t | type | ) |
Definition at line 86 of file gnutls_extensions.c.
References GNUTLS_EXTENSION_LOOP.
Referenced by MHD_gtls_gen_extensions().

| const char* MHD_gtls_extension_get_name | ( | uint16_t | type | ) |
Definition at line 95 of file gnutls_extensions.c.
References GNUTLS_EXTENSION_LOOP.
Referenced by MHD_gtls_gen_extensions(), and MHD_gtls_parse_extensions().

| int MHD_gtls_gen_extensions | ( | MHD_gtls_session_t | session, | |
| opaque * | data, | |||
| size_t | data_size | |||
| ) |
Definition at line 220 of file gnutls_extensions.c.
References GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_MEMORY_ERROR, MHD__gnutls_debug_log, MHD__gnutls_extension_list_add(), MHD_gnutls_assert, MHD_gnutls_free, MHD_gnutls_malloc, MHD_gtls_ext_func_send(), MHD_gtls_extension_get_name(), MHD_gtls_write_uint16(), MHD_gtls_extension_entry::name, and MHD_gtls_extension_entry::type.
Referenced by MHD__gnutls_send_server_hello().


| int MHD_gtls_parse_extensions | ( | MHD_gtls_session_t | session, | |
| MHD_gtls_ext_parse_type_t | parse_type, | |||
| const opaque * | data, | |||
| int | data_size | |||
| ) |
Definition at line 127 of file gnutls_extensions.c.
References DECR_LENGTH_RET, MHD_gtls_security_param_st::entity, MHD_gtls_internals_st::extensions_sent, MHD_gtls_internals_st::extensions_sent_size, GNUTLS_CLIENT, MHD_gtls_session_int::internals, MHD__gnutls_debug_log, MHD__gnutls_extension_list_check(), MHD_gnutls_assert, MHD_gtls_ext_func_recv(), MHD_gtls_extension_get_name(), MHD_gtls_read_uint16(), and MHD_gtls_session_int::security_parameters.
Referenced by MHD__gnutls_read_client_hello().


| MHD_gtls_extension_entry MHD_gtls_extensions[MAX_EXT_SIZE] |
Initial value:
{
GNUTLS_EXTENSION_ENTRY (GNUTLS_EXTENSION_MAX_RECORD_SIZE,
EXTENSION_TLS,
MHD_gtls_max_record_recv_params,
MHD_gtls_max_record_send_params),
GNUTLS_EXTENSION_ENTRY (GNUTLS_EXTENSION_CERT_TYPE,
EXTENSION_TLS,
MHD_gtls_cert_type_recv_params,
MHD_gtls_cert_type_send_params),
GNUTLS_EXTENSION_ENTRY (GNUTLS_EXTENSION_SERVER_NAME,
EXTENSION_APPLICATION,
MHD_gtls_server_name_recv_params,
MHD_gtls_server_name_send_params),
{0, 0, 0, 0}
}
Definition at line 47 of file gnutls_extensions.c.
| const int MHD_gtls_extensions_size = MAX_EXT_SIZE |
Definition at line 45 of file gnutls_extensions.c.
1.5.7.1