Asterisk - The Open Source Telephony Project GIT-master-754dea3
|
#include "asterisk.h"
#include "asterisk/cli.h"
#include "asterisk/logger.h"
#include "stir_shaken.h"
Go to the source code of this file.
Macros | |
#define | _TRACE_PREFIX_ "vc",__LINE__, "" |
#define | CONFIG_TYPE "verification" |
#define | DEFAULT_ca_file NULL |
#define | DEFAULT_ca_path NULL |
#define | DEFAULT_crl_file NULL |
#define | DEFAULT_crl_path NULL |
#define | DEFAULT_curl_timeout 2 |
#define | DEFAULT_global_disable 0 |
#define | DEFAULT_load_system_certs load_system_certs_NO |
#define | DEFAULT_max_cache_entry_age 3600 |
#define | DEFAULT_max_cache_size 1000 |
#define | DEFAULT_max_date_header_age 15 |
#define | DEFAULT_max_iat_age 15 |
#define | DEFAULT_relax_x5u_path_restrictions relax_x5u_path_restrictions_NO |
#define | DEFAULT_relax_x5u_port_scheme_restrictions relax_x5u_port_scheme_restrictions_NO |
#define | DEFAULT_stir_shaken_failure_action stir_shaken_failure_action_CONTINUE |
#define | DEFAULT_untrusted_cert_file NULL |
#define | DEFAULT_untrusted_cert_path NULL |
#define | DEFAULT_use_rfc9410_responses use_rfc9410_responses_NO |
#define | STIR_SHAKEN_DIR_NAME "stir_shaken" |
Functions | |
static char * | cli_verification_show (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
generate_vcfg_common_sorcery_handlers (verification_cfg) | |
void | vcfg_cleanup (struct verification_cfg_common *vcfg_common) |
static void * | verification_alloc (const char *name) |
static int | verification_apply (const struct ast_sorcery *sorcery, void *obj) |
static void | verification_destructor (void *obj) |
int | vs_check_common_config (const char *id, struct verification_cfg_common *vcfg_common) |
int | vs_config_load (void) |
int | vs_config_reload (void) |
int | vs_config_unload (void) |
int | vs_copy_cfg_common (const char *id, struct verification_cfg_common *cfg_dst, struct verification_cfg_common *cfg_src) |
struct verification_cfg * | vs_get_cfg (void) |
int | vs_is_config_loaded (void) |
Variables | |
static char | DEFAULT_cert_cache_dir [PATH_MAX] |
static struct verification_cfg * | empty_cfg = NULL |
static char * | special_addresses [] |
static struct ast_cli_entry | verification_cli [] |
#define _TRACE_PREFIX_ "vc",__LINE__, "" |
Definition at line 19 of file verification_config.c.
#define CONFIG_TYPE "verification" |
Definition at line 27 of file verification_config.c.
#define DEFAULT_ca_file NULL |
Definition at line 31 of file verification_config.c.
#define DEFAULT_ca_path NULL |
Definition at line 32 of file verification_config.c.
#define DEFAULT_crl_file NULL |
Definition at line 33 of file verification_config.c.
#define DEFAULT_crl_path NULL |
Definition at line 34 of file verification_config.c.
#define DEFAULT_curl_timeout 2 |
Definition at line 39 of file verification_config.c.
#define DEFAULT_global_disable 0 |
Definition at line 29 of file verification_config.c.
#define DEFAULT_load_system_certs load_system_certs_NO |
Definition at line 48 of file verification_config.c.
#define DEFAULT_max_cache_entry_age 3600 |
Definition at line 42 of file verification_config.c.
#define DEFAULT_max_cache_size 1000 |
Definition at line 43 of file verification_config.c.
#define DEFAULT_max_date_header_age 15 |
Definition at line 41 of file verification_config.c.
#define DEFAULT_max_iat_age 15 |
Definition at line 40 of file verification_config.c.
#define DEFAULT_relax_x5u_path_restrictions relax_x5u_path_restrictions_NO |
Definition at line 47 of file verification_config.c.
#define DEFAULT_relax_x5u_port_scheme_restrictions relax_x5u_port_scheme_restrictions_NO |
Definition at line 46 of file verification_config.c.
#define DEFAULT_stir_shaken_failure_action stir_shaken_failure_action_CONTINUE |
Definition at line 44 of file verification_config.c.
#define DEFAULT_untrusted_cert_file NULL |
Definition at line 35 of file verification_config.c.
#define DEFAULT_untrusted_cert_path NULL |
Definition at line 36 of file verification_config.c.
#define DEFAULT_use_rfc9410_responses use_rfc9410_responses_NO |
Definition at line 45 of file verification_config.c.
#define STIR_SHAKEN_DIR_NAME "stir_shaken" |
Definition at line 52 of file verification_config.c.
|
static |
Definition at line 376 of file verification_config.c.
References a, ao2_cleanup, ast_log, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, config_object_cli_show(), config_object_type_verification, LOG_WARNING, NULL, config_object_cli_data::title, ast_cli_entry::usage, vs_get_cfg(), and vs_is_config_loaded().
generate_vcfg_common_sorcery_handlers | ( | verification_cfg | ) |
void vcfg_cleanup | ( | struct verification_cfg_common * | vcfg_common | ) |
Definition at line 76 of file verification_config.c.
References verification_cfg_common::acl, ast_free_acl_list(), ast_string_field_free_memory, crypto_free_cert_store, verification_cfg_common::tcs, and verification_cfg::vcfg_common.
Referenced by profile_destructor(), and verification_destructor().
|
static |
Definition at line 95 of file verification_config.c.
References ao2_ref, ast_sorcery_generic_alloc(), ast_string_field_init, NULL, verification_cfg::vcfg_common, and verification_destructor().
Referenced by vs_config_load(), and vs_config_reload().
|
static |
Definition at line 338 of file verification_config.c.
References verification_cfg_common::acl, ARRAY_LEN, ast_append_acl(), ast_free_acl_list(), ast_log, ast_sorcery_object_get_id(), error(), sip_to_pjsip::ignore(), LOG_ERROR, NULL, special_addresses, verification_cfg::vcfg_common, and vs_check_common_config().
Referenced by vs_config_load().
|
static |
Definition at line 88 of file verification_config.c.
References ast_string_field_free_memory, vcfg_cleanup(), and verification_cfg::vcfg_common.
Referenced by verification_alloc().
int vs_check_common_config | ( | const char * | id, |
struct verification_cfg_common * | vcfg_common | ||
) |
Definition at line 165 of file verification_config.c.
References ast_asprintf, ast_file_is_readable(), ast_free, ast_strlen_zero(), verification_cfg_common::ca_file, verification_cfg_common::ca_path, verification_cfg_common::cert_cache_dir, crypto_cert_store::certs, verification_cfg_common::crl_file, verification_cfg_common::crl_path, crypto_create_cert_store(), crypto_load_cert_store(), crypto_load_crl_store(), crypto_load_untrusted_cert_store(), ENUM_BOOL, verification_cfg_common::load_system_certs, LOG_ERROR, remove, SCOPE_ENTER, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, verification_cfg_common::tcs, verification_cfg_common::untrusted_cert_file, verification_cfg_common::untrusted_cert_path, and verification_cfg::vcfg_common.
Referenced by profile_apply(), and verification_apply().
int vs_config_load | ( | void | ) |
Definition at line 444 of file verification_config.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_config_AST_DATA_DIR, ast_log, ast_sorcery_apply_default, ast_sorcery_load_object(), ast_sorcery_object_field_register, ast_sorcery_object_field_register_nodoc, ast_sorcery_object_register, CONFIG_TYPE, DEFAULT_cert_cache_dir, DEFAULT_global_disable, empty_cfg, FLDSET, get_sorcery(), verification_cfg::global_disable, LOG_ERROR, LOG_WARNING, NULL, OPT_NOOP_T, OPT_YESNO_T, register_common_verification_fields, sorcery, STIR_SHAKEN_DIR_NAME, verification_alloc(), verification_apply(), verification_cli, and vs_is_config_loaded().
Referenced by vs_load().
int vs_config_reload | ( | void | ) |
Definition at line 416 of file verification_config.c.
References ast_log, ast_sorcery_force_reload_object(), CONFIG_TYPE, empty_cfg, get_sorcery(), verification_cfg::global_disable, LOG_WARNING, sorcery, verification_alloc(), and vs_is_config_loaded().
Referenced by vs_reload().
int vs_config_unload | ( | void | ) |
Definition at line 435 of file verification_config.c.
References ao2_cleanup, ARRAY_LEN, ast_cli_unregister_multiple(), empty_cfg, and verification_cli.
Referenced by vs_unload().
int vs_copy_cfg_common | ( | const char * | id, |
struct verification_cfg_common * | cfg_dst, | ||
struct verification_cfg_common * | cfg_src | ||
) |
Definition at line 123 of file verification_config.c.
References verification_cfg_common::acl, ao2_bump, ast_duplicate_acl_list(), ast_free_acl_list(), cfg_enum_copy, cfg_sf_copy_wrapper, cfg_uint_copy, and verification_cfg_common::tcs.
Referenced by create_effective_profile().
struct verification_cfg * vs_get_cfg | ( | void | ) |
Definition at line 54 of file verification_config.c.
References ao2_bump, ast_sorcery_retrieve_by_id(), CONFIG_TYPE, empty_cfg, get_sorcery(), and NULL.
Referenced by add_cert_expiration_to_astdb(), ast_stir_shaken_vs_ctx_create(), cli_verification_show(), cli_verify_cert(), and create_effective_profile().
int vs_is_config_loaded | ( | void | ) |
Definition at line 65 of file verification_config.c.
References ao2_cleanup, ast_sorcery_retrieve_by_id(), CONFIG_TYPE, and get_sorcery().
Referenced by cli_verification_show(), vs_config_load(), and vs_config_reload().
|
static |
Definition at line 37 of file verification_config.c.
Referenced by vs_config_load().
|
static |
Definition at line 50 of file verification_config.c.
Referenced by vs_config_load(), vs_config_reload(), vs_config_unload(), and vs_get_cfg().
|
static |
Definition at line 307 of file verification_config.c.
Referenced by verification_apply().
|
static |
Definition at line 412 of file verification_config.c.
Referenced by vs_config_load(), and vs_config_unload().