Asterisk - The Open Source Telephony Project GIT-master-3dee037
|
#include <openssl/evp.h>
#include "asterisk.h"
#include "asterisk/paths.h"
#include "asterisk/sorcery.h"
#include "asterisk/stringfields.h"
Go to the source code of this file.
Data Structures | |
struct | attestation_cfg |
struct | attestation_cfg_common |
Attestation Service configuration for stir/shaken. More... | |
struct | config_object_cli_data |
struct | profile_cfg |
Profile configuration for stir/shaken. More... | |
struct | tn_cfg |
TN configuration for stir/shaken. More... | |
struct | verification_cfg |
struct | verification_cfg_common |
Verification Service configuration for stir/shaken. More... | |
Macros | |
#define | cfg_enum_copy(__cfg_dst, __cfg_src, __field) cfg_enum_copy_ex(__cfg_dst, __cfg_src, __field, __field ## _NOT_SET, __field ## _UNKNOWN) |
#define | cfg_enum_copy_ex(__cfg_dst, __cfg_src, __field, __not_set, __unknown) |
cfg_enum_copy More... | |
#define | cfg_sf_copy_wrapper(id, __cfg_dst, __cfg_src, __field) |
cfg_copy_wrapper More... | |
#define | cfg_stringfield_copy(__cfg_dst, __cfg_src, __field) |
Common config copy utilities. More... | |
#define | cfg_uint_copy(__cfg_dst, __cfg_src, __field) |
cfg_uint_copy More... | |
#define | EFFECTIVE_ENUM(__enum1, __enum2, __field, __default) |
#define | EFFECTIVE_ENUM_BOOL(__enum1, __enum2, __field, __default) |
#define | ENUM_BOOL(__enum1, __field) (__enum1 == ( __field ## _ ## YES )) |
#define | enum_option_register(sorcery, CONFIG_TYPE, name, nodoc) enum_option_register_ex(sorcery, CONFIG_TYPE, name, name, name, nodoc) |
#define | enum_option_register_ex(sorcery, CONFIG_TYPE, name, field, function_prefix, nodoc) |
#define | generate_acfg_common_sorcery_handlers(object) |
#define | generate_bool_string_prototypes(param_name) |
Boolean field to/from string prototype generator. More... | |
#define | generate_enum_string_prototypes(param_name, ...) |
Enum field to/from string prototype generator. More... | |
#define | generate_sorcery_acl_from_str(__struct, __lc_param, __unknown) |
#define | generate_sorcery_acl_to_str(__struct, __lc_param) |
#define | generate_sorcery_enum_from_str(__struct, __substruct, __lc_param, __unknown) generate_sorcery_enum_from_str_ex(__struct, __substruct, __lc_param, __lc_param, __unknown) \ |
#define | generate_sorcery_enum_from_str_ex(__struct, __substruct, __lc_param, __base_enum, __unknown) |
#define | generate_sorcery_enum_to_str(__struct, __substruct, __lc_param) generate_sorcery_enum_to_str_ex(__struct, __substruct, __lc_param, __lc_param) |
#define | generate_sorcery_enum_to_str_ex(__struct, __substruct, __lc_param, __base_enum) |
Enum sorcery handler generator. More... | |
#define | generate_vcfg_common_sorcery_handlers(object) |
#define | PROFILE_ALLOW_ATTEST(__profile) |
#define | PROFILE_ALLOW_VERIFY(__profile) |
#define | register_common_attestation_fields(sorcery, object, CONFIG_TYPE, nodoc) |
#define | register_common_verification_fields(sorcery, object, CONFIG_TYPE, nodoc) |
#define | stringfield_option_register(sorcery, CONFIG_TYPE, object, name, field, nodoc) |
Sorcery fields register helpers. More... | |
#define | uint_option_register(sorcery, CONFIG_TYPE, object, name, field, nodoc) |
Enumerations | |
enum | config_object_type { config_object_type_attestation = 0 , config_object_type_verification , config_object_type_profile , config_object_type_tn } |
Functions | |
void | acfg_cleanup (struct attestation_cfg_common *cfg) |
int | as_check_common_config (const char *id, struct attestation_cfg_common *acfg_common) |
int | as_config_load (void) |
int | as_config_reload (void) |
int | as_config_unload (void) |
int | as_copy_cfg_common (const char *id, struct attestation_cfg_common *cfg_dst, struct attestation_cfg_common *cfg_src) |
struct attestation_cfg * | as_get_cfg (void) |
int | as_is_config_loaded (void) |
char * | canonicalize_tn (const char *tn, char *dest_tn) |
Canonicalize a TN. More... | |
char * | canonicalize_tn_alloc (const char *tn) |
Canonicalize a TN into nre buffer. More... | |
int | common_config_load (void) |
int | common_config_reload (void) |
int | common_config_unload (void) |
int | config_object_cli_show (void *obj, void *arg, void *data, int flags) |
Output configuration settings to the Asterisk CLI. More... | |
char * | config_object_tab_complete_name (const char *word, struct ao2_container *container) |
Tab completion for name matching with STIR/SHAKEN CLI commands. More... | |
struct ao2_container * | eprofile_get_all (void) |
struct profile_cfg * | eprofile_get_cfg (const char *id) |
generate_bool_string_prototypes (check_tn_cert_public_url) | |
generate_bool_string_prototypes (load_system_certs) | |
generate_bool_string_prototypes (relax_x5u_path_restrictions) | |
generate_bool_string_prototypes (relax_x5u_port_scheme_restrictions) | |
generate_bool_string_prototypes (send_mky) | |
generate_bool_string_prototypes (use_rfc9410_responses) | |
generate_enum_string_prototypes (attest_level, attest_level_UNKNOWN=-1, attest_level_NOT_SET=0, attest_level_A, attest_level_B, attest_level_C,) | |
generate_enum_string_prototypes (endpoint_behavior, endpoint_behavior_UNKNOWN=-1, endpoint_behavior_OFF=0, endpoint_behavior_ATTEST, endpoint_behavior_VERIFY, endpoint_behavior_ON, endpoint_behavior_NOT_SET) | |
struct ast_acl_list * | get_default_acl_list (void) |
struct ao2_container * | profile_get_all (void) |
struct profile_cfg * | profile_get_cfg (const char *id) |
int | profile_load (void) |
int | profile_reload (void) |
int | profile_unload (void) |
enum stir_shaken_failure_action_enum | stir_shaken_failure_action_from_str (const char *action_str) |
const char * | stir_shaken_failure_action_to_str (enum stir_shaken_failure_action_enum action) |
int | tn_config_load (void) |
int | tn_config_reload (void) |
int | tn_config_unload (void) |
struct tn_cfg * | tn_get_cfg (const char *tn) |
struct tn_cfg * | tn_get_etn (const char *tn, struct profile_cfg *eprofile) |
enum attest_level_enum | unknown_tn_attest_level_from_str (const char *value) |
const char * | unknown_tn_attest_level_to_str (enum attest_level_enum value) |
void | vcfg_cleanup (struct verification_cfg_common *cfg) |
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) |
#define cfg_enum_copy | ( | __cfg_dst, | |
__cfg_src, | |||
__field | |||
) | cfg_enum_copy_ex(__cfg_dst, __cfg_src, __field, __field ## _NOT_SET, __field ## _UNKNOWN) |
Definition at line 283 of file common_config.h.
#define cfg_enum_copy_ex | ( | __cfg_dst, | |
__cfg_src, | |||
__field, | |||
__not_set, | |||
__unknown | |||
) |
cfg_enum_copy
Copy an enum from the source to the dest only if the source is neither NOT_SET nor UNKNOWN
Definition at line 275 of file common_config.h.
#define cfg_sf_copy_wrapper | ( | id, | |
__cfg_dst, | |||
__cfg_src, | |||
__field | |||
) |
cfg_copy_wrapper
Invoke cfg_stringfield_copy and cause the calling runction to return a -1 of the copy fails.
Definition at line 246 of file common_config.h.
#define cfg_stringfield_copy | ( | __cfg_dst, | |
__cfg_src, | |||
__field | |||
) |
Common config copy utilities.
These macros are designed to be called from as_copy_cfg_common and vs_copy_cfg_common only. They'll only copy a field if the field contains a vaild value. Thus a NOT_SET value in the source won't override a pre-existing good value in the dest. A good value in the source WILL overwrite a good value in the dest.
Definition at line 231 of file common_config.h.
#define cfg_uint_copy | ( | __cfg_dst, | |
__cfg_src, | |||
__field | |||
) |
cfg_uint_copy
Copy a uint from the source to the dest only if the source > 0. For stir-shaken, 0 isn't a valid value for any uint fields.
Definition at line 262 of file common_config.h.
#define EFFECTIVE_ENUM | ( | __enum1, | |
__enum2, | |||
__field, | |||
__default | |||
) |
Definition at line 208 of file common_config.h.
#define EFFECTIVE_ENUM_BOOL | ( | __enum1, | |
__enum2, | |||
__field, | |||
__default | |||
) |
#define ENUM_BOOL | ( | __enum1, | |
__field | |||
) | (__enum1 == ( __field ## _ ## YES )) |
Definition at line 218 of file common_config.h.
#define enum_option_register | ( | sorcery, | |
CONFIG_TYPE, | |||
name, | |||
nodoc | |||
) | enum_option_register_ex(sorcery, CONFIG_TYPE, name, name, name, nodoc) |
Definition at line 509 of file common_config.h.
#define enum_option_register_ex | ( | sorcery, | |
CONFIG_TYPE, | |||
name, | |||
field, | |||
function_prefix, | |||
nodoc | |||
) |
Definition at line 504 of file common_config.h.
#define generate_acfg_common_sorcery_handlers | ( | object | ) |
Definition at line 304 of file common_config.h.
#define generate_bool_string_prototypes | ( | param_name | ) |
Boolean field to/from string prototype generator.
Most of the boolean fields that appear in the verification and attestation objects can be ovrridden in the profile object; "use_rfc9410_responses" for instance. If they were registered as normal YESNO types, we couldn't tell if a "0" value in the profile object meant the user set it to "no" to override a value of "yes" in the verification object, or it just defaulted to "0". By making the _NOT_SET enum a non-0/1 and making it the default value, we can tell the difference. The _UNKNOWN enum gets set if the string value provided to the _from_str function wasn't recognized as one of the values acceptable to ast_true() or ast_false().
The result of calling the generator for a field will look like:
Most of the macros that follow depend on enum values formatted as <param_name>SOMETHING and their defaults as DEFAULT<param_name>.
Definition at line 60 of file common_config.h.
#define generate_enum_string_prototypes | ( | param_name, | |
... | |||
) |
Enum field to/from string prototype generator.
This operates like the bool generator except you supply a list of the enum values. The first one MUST be param_name_UNKNOWN with a value of -1 and the rest running sequentially with the last being param_name_NOT_SET.
Definition at line 94 of file common_config.h.
#define generate_sorcery_acl_from_str | ( | __struct, | |
__lc_param, | |||
__unknown | |||
) |
Definition at line 192 of file common_config.h.
#define generate_sorcery_acl_to_str | ( | __struct, | |
__lc_param | |||
) |
Definition at line 173 of file common_config.h.
#define generate_sorcery_enum_from_str | ( | __struct, | |
__substruct, | |||
__lc_param, | |||
__unknown | |||
) | generate_sorcery_enum_from_str_ex(__struct, __substruct, __lc_param, __lc_param, __unknown) \ |
Definition at line 169 of file common_config.h.
#define generate_sorcery_enum_from_str_ex | ( | __struct, | |
__substruct, | |||
__lc_param, | |||
__base_enum, | |||
__unknown | |||
) |
Definition at line 156 of file common_config.h.
#define generate_sorcery_enum_to_str | ( | __struct, | |
__substruct, | |||
__lc_param | |||
) | generate_sorcery_enum_to_str_ex(__struct, __substruct, __lc_param, __lc_param) |
Definition at line 153 of file common_config.h.
#define generate_sorcery_enum_to_str_ex | ( | __struct, | |
__substruct, | |||
__lc_param, | |||
__base_enum | |||
) |
Enum sorcery handler generator.
These macros can create the two functions needed to register an enum field with sorcery as long as there are _to_str and _from_str functions defined elsewhere.
Definition at line 145 of file common_config.h.
#define generate_vcfg_common_sorcery_handlers | ( | object | ) |
Definition at line 373 of file common_config.h.
#define PROFILE_ALLOW_ATTEST | ( | __profile | ) |
Definition at line 441 of file common_config.h.
#define PROFILE_ALLOW_VERIFY | ( | __profile | ) |
Definition at line 445 of file common_config.h.
#define register_common_attestation_fields | ( | sorcery, | |
object, | |||
CONFIG_TYPE, | |||
nodoc | |||
) |
Definition at line 542 of file common_config.h.
#define register_common_verification_fields | ( | sorcery, | |
object, | |||
CONFIG_TYPE, | |||
nodoc | |||
) |
Definition at line 512 of file common_config.h.
#define stringfield_option_register | ( | sorcery, | |
CONFIG_TYPE, | |||
object, | |||
name, | |||
field, | |||
nodoc | |||
) |
Sorcery fields register helpers.
Most of the fields on attestation_cfg and verification_cfg are also in profile_cfg. To prevent having to maintain duplicate sets of sorcery register statements, we can do this once here and call register_common_verification_fields() from both profile_config and verification_config and call register_common_attestation_fields() from profile_cfg and attestation_config.
Most of the fields in question are in sub-structures like verification_cfg.vcfg_common which is why there are separate name and field parameters. For verification_cfg.vcfg_common.ca_file for instance, name would be ca_file and field would be vcfg_common.ca_file.
Definition at line 494 of file common_config.h.
#define uint_option_register | ( | sorcery, | |
CONFIG_TYPE, | |||
object, | |||
name, | |||
field, | |||
nodoc | |||
) |
Definition at line 499 of file common_config.h.
enum config_object_type |
Enumerator | |
---|---|
config_object_type_attestation | |
config_object_type_verification | |
config_object_type_profile | |
config_object_type_tn |
Definition at line 555 of file common_config.h.
void acfg_cleanup | ( | struct attestation_cfg_common * | cfg | ) |
Definition at line 68 of file attestation_config.c.
References attestation_cfg::acfg_common, ao2_cleanup, ast_string_field_free_memory, and attestation_cfg_common::raw_key.
Referenced by attestation_destructor(), profile_destructor(), and tn_destructor().
int as_check_common_config | ( | const char * | id, |
struct attestation_cfg_common * | acfg_common | ||
) |
Definition at line 139 of file attestation_config.c.
References attestation_cfg::acfg_common, ao2_alloc, ast_file_is_readable(), ast_free, ast_std_free(), ast_strlen_zero(), attestation_cfg_common::check_tn_cert_public_url, crypto_extract_raw_privkey(), crypto_has_private_key_from_memory(), crypto_is_cert_time_valid(), crypto_load_cert_from_memory(), crypto_load_privkey_from_file(), curl_download_to_memory(), ENUM_BOOL, LOG_ERROR, NULL, attestation_cfg_common::private_key_file, attestation_cfg_common::public_cert_url, RAII_VAR, attestation_cfg_common::raw_key, attestation_cfg_common::raw_key_length, SCOPE_ENTER, SCOPE_EXIT, SCOPE_EXIT_LOG_RTN_VALUE, and SCOPE_EXIT_RTN_VALUE.
Referenced by attestation_apply(), profile_apply(), and tn_apply().
int as_config_load | ( | void | ) |
Definition at line 300 of file attestation_config.c.
References ARRAY_LEN, as_is_config_loaded(), ast_cli_register_multiple, 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, attestation_alloc(), attestation_apply(), attestation_cli, CONFIG_TYPE, DEFAULT_global_disable, empty_cfg, enum_option_register_ex, FLDSET, get_sorcery(), attestation_cfg::global_disable, LOG_ERROR, LOG_WARNING, NULL, OPT_NOOP_T, OPT_YESNO_T, register_common_attestation_fields, and sorcery.
Referenced by as_load().
int as_config_reload | ( | void | ) |
Definition at line 272 of file attestation_config.c.
References as_is_config_loaded(), ast_log, ast_sorcery_force_reload_object(), attestation_alloc(), CONFIG_TYPE, empty_cfg, get_sorcery(), attestation_cfg::global_disable, LOG_WARNING, and sorcery.
Referenced by as_reload().
int as_config_unload | ( | void | ) |
Definition at line 291 of file attestation_config.c.
References ao2_cleanup, ARRAY_LEN, ast_cli_unregister_multiple(), attestation_cli, and empty_cfg.
Referenced by as_unload().
int as_copy_cfg_common | ( | const char * | id, |
struct attestation_cfg_common * | cfg_dst, | ||
struct attestation_cfg_common * | cfg_src | ||
) |
Definition at line 113 of file attestation_config.c.
References ao2_bump, ao2_cleanup, cfg_enum_copy, cfg_sf_copy_wrapper, attestation_cfg_common::raw_key, and attestation_cfg_common::raw_key_length.
Referenced by create_effective_profile(), and tn_get_etn().
struct attestation_cfg * as_get_cfg | ( | void | ) |
Definition at line 43 of file attestation_config.c.
References ao2_bump, ast_sorcery_retrieve_by_id(), CONFIG_TYPE, empty_cfg, get_sorcery(), and NULL.
Referenced by ast_stir_shaken_as_ctx_create(), attestation_show(), and create_effective_profile().
int as_is_config_loaded | ( | void | ) |
Definition at line 54 of file attestation_config.c.
References ao2_cleanup, ast_sorcery_retrieve_by_id(), CONFIG_TYPE, and get_sorcery().
Referenced by as_config_load(), as_config_reload(), and attestation_show().
char * canonicalize_tn | ( | const char * | tn, |
char * | dest_tn | ||
) |
Canonicalize a TN.
tn | TN to canonicalize |
dest_tn | Pointer to destination buffer to receive the new TN |
dest_tn | or NULL on failure |
Definition at line 266 of file common_config.c.
References ast_strlen_zero(), len(), NULL, S_OR, SCOPE_ENTER, and SCOPE_EXIT_RTN_VALUE.
Referenced by canonicalize_tn_alloc().
char * canonicalize_tn_alloc | ( | const char * | tn | ) |
Canonicalize a TN into nre buffer.
tn | TN to canonicalize |
dest_tn | (which must be freed with ast_free) or NULL on failure |
Definition at line 293 of file common_config.c.
References ast_malloc, ast_strlen_zero(), canonicalize_tn(), and NULL.
Referenced by ast_stir_shaken_as_ctx_create(), and ast_stir_shaken_vs_ctx_create().
int common_config_load | ( | void | ) |
Definition at line 420 of file common_config.c.
References ARRAY_LEN, as_load(), ast_cli_register_multiple, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_named_acl_change_type(), ast_security_topic(), ast_sorcery_open, cli_commands, common_config_unload(), named_acl_changed_cb(), named_acl_changed_sub, NULL, profile_load(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, sorcery, stasis_subscribe, stasis_subscription_accept_message_type(), tn_config_load(), and vs_load().
Referenced by load_module().
int common_config_reload | ( | void | ) |
Definition at line 369 of file common_config.c.
References as_reload(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, profile_reload(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, tn_config_reload(), and vs_reload().
Referenced by named_acl_changed_cb(), and reload_module().
int common_config_unload | ( | void | ) |
Definition at line 391 of file common_config.c.
References ARRAY_LEN, as_unload(), ast_cli_unregister_multiple(), ast_sorcery_unref, cli_commands, named_acl_changed_sub, NULL, profile_unload(), sorcery, stasis_unsubscribe(), tn_config_unload(), and vs_unload().
Referenced by common_config_load(), and unload_module().
int config_object_cli_show | ( | void * | obj, |
void * | arg, | ||
void * | data, | ||
int | flags | ||
) |
Output configuration settings to the Asterisk CLI.
obj | A sorcery object containing configuration data |
arg | Asterisk CLI argument object |
flags | ao2 container flags |
0 |
Definition at line 172 of file common_config.c.
References a, ast_cli(), AST_HANDLER_ONLY_STRING, ast_sorcery_object_get_id(), ast_sorcery_object_get_type(), ast_sorcery_objectset_create2(), ast_strings_equal(), ast_strlen_zero(), ast_variable_list_sort(), ast_variables_destroy(), config_object_type_profile, config_object_type_tn, config_object_type_verification, get_sorcery(), ast_variable::name, ast_variable::next, NULL, config_object_cli_data::object_type, options, print_acl_cert_store, config_object_cli_data::title, translate_value(), and ast_variable::value.
Referenced by attestation_show(), cli_eprofile_show(), cli_eprofile_show_all(), cli_profile_show(), cli_profile_show_all(), cli_tn_show(), cli_tn_show_all(), and cli_verification_show().
char * config_object_tab_complete_name | ( | const char * | word, |
struct ao2_container * | container | ||
) |
Tab completion for name matching with STIR/SHAKEN CLI commands.
word | The word to tab complete on |
container | The sorcery container to iterate through |
The | tab completion options |
Definition at line 240 of file common_config.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_cli_completion_add(), ast_sorcery_object_get_id(), ast_strdup, container, and NULL.
Referenced by cli_eprofile_show(), cli_profile_show(), cli_tn_show(), and cli_verify_cert().
struct ao2_container * eprofile_get_all | ( | void | ) |
Definition at line 120 of file profile_config.c.
References AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_retrieve_by_fields(), get_sorcery(), and NULL.
Referenced by cli_eprofile_show(), and cli_eprofile_show_all().
struct profile_cfg * eprofile_get_cfg | ( | const char * | id | ) |
Definition at line 126 of file profile_config.c.
References ast_sorcery_retrieve_by_id(), ast_strlen_zero(), get_sorcery(), and NULL.
Referenced by ast_stir_shaken_as_ctx_create(), ast_stir_shaken_vs_ctx_create(), and cli_eprofile_show().
generate_bool_string_prototypes | ( | check_tn_cert_public_url | ) |
generate_bool_string_prototypes | ( | load_system_certs | ) |
generate_bool_string_prototypes | ( | relax_x5u_path_restrictions | ) |
generate_bool_string_prototypes | ( | relax_x5u_port_scheme_restrictions | ) |
generate_bool_string_prototypes | ( | send_mky | ) |
generate_bool_string_prototypes | ( | use_rfc9410_responses | ) |
generate_enum_string_prototypes | ( | attest_level | , |
attest_level_UNKNOWN | = -1 , |
||
attest_level_NOT_SET | = 0 , |
||
attest_level_A | , | ||
attest_level_B | , | ||
attest_level_C | |||
) |
generate_enum_string_prototypes | ( | endpoint_behavior | , |
endpoint_behavior_UNKNOWN | = -1 , |
||
endpoint_behavior_OFF | = 0 , |
||
endpoint_behavior_ATTEST | , | ||
endpoint_behavior_VERIFY | , | ||
endpoint_behavior_ON | , | ||
endpoint_behavior_NOT_SET | |||
) |
struct ast_acl_list * get_default_acl_list | ( | void | ) |
struct ao2_container * profile_get_all | ( | void | ) |
Definition at line 106 of file profile_config.c.
References AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_retrieve_by_fields(), CONFIG_TYPE, get_sorcery(), and NULL.
Referenced by cli_profile_show(), cli_profile_show_all(), and cli_verify_cert().
struct profile_cfg * profile_get_cfg | ( | const char * | id | ) |
Definition at line 112 of file profile_config.c.
References ast_sorcery_retrieve_by_id(), ast_strlen_zero(), CONFIG_TYPE, get_sorcery(), and NULL.
Referenced by cli_profile_show(), and cli_verify_cert().
int profile_load | ( | void | ) |
Definition at line 439 of file profile_config.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_log, ast_sorcery_apply_default, AST_SORCERY_APPLY_SUCCESS, ast_sorcery_internal_object_register, ast_sorcery_load_object(), ast_sorcery_object_field_register, ast_sorcery_object_field_register_nodoc, ast_sorcery_object_register, CONFIG_TYPE, enum_option_register, enum_option_register_ex, eprofile_apply(), get_sorcery(), LOG_ERROR, NULL, OPT_NOOP_T, profile_alloc(), profile_apply(), register_common_attestation_fields, register_common_verification_fields, sorcery, and stir_shaken_profile_cli.
Referenced by common_config_load().
int profile_reload | ( | void | ) |
Definition at line 423 of file profile_config.c.
References ast_sorcery_force_reload_object(), CONFIG_TYPE, get_sorcery(), and sorcery.
Referenced by common_config_reload().
int profile_unload | ( | void | ) |
Definition at line 431 of file profile_config.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), and stir_shaken_profile_cli.
Referenced by common_config_unload().
enum stir_shaken_failure_action_enum stir_shaken_failure_action_from_str | ( | const char * | action_str | ) |
const char * stir_shaken_failure_action_to_str | ( | enum stir_shaken_failure_action_enum | action | ) |
int tn_config_load | ( | void | ) |
Definition at line 268 of file tn_config.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_sorcery_apply_default, ast_sorcery_load_object(), ast_sorcery_object_field_register, ast_sorcery_object_register, CONFIG_TYPE, get_sorcery(), LOG_ERROR, NULL, OPT_NOOP_T, register_common_attestation_fields, sorcery, stir_shaken_certificate_cli, tn_alloc(), and tn_apply().
Referenced by common_config_load().
int tn_config_reload | ( | void | ) |
Definition at line 253 of file tn_config.c.
References AST_MODULE_LOAD_SUCCESS, ast_sorcery_force_reload_object(), CONFIG_TYPE, get_sorcery(), and sorcery.
Referenced by common_config_reload().
int tn_config_unload | ( | void | ) |
Definition at line 260 of file tn_config.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), and stir_shaken_certificate_cli.
Referenced by common_config_unload().
struct tn_cfg * tn_get_cfg | ( | const char * | tn | ) |
Definition at line 39 of file tn_config.c.
References ast_sorcery_retrieve_by_id(), CONFIG_TYPE, and get_sorcery().
Referenced by cli_tn_show().
struct tn_cfg * tn_get_etn | ( | const char * | tn, |
struct profile_cfg * | eprofile | ||
) |
Definition at line 111 of file tn_config.c.
References profile_cfg::acfg_common, ao2_bump, ao2_cleanup, as_copy_cfg_common(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_id(), ast_strlen_zero(), ast_trace, CONFIG_TYPE, etn_alloc(), get_sorcery(), NULL, RAII_VAR, S_OR, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, and profile_cfg::unknown_tn_attest_level.
Referenced by ast_stir_shaken_as_ctx_create().
enum attest_level_enum unknown_tn_attest_level_from_str | ( | const char * | value | ) |
const char * unknown_tn_attest_level_to_str | ( | enum attest_level_enum | value | ) |
void vcfg_cleanup | ( | struct verification_cfg_common * | cfg | ) |
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().
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().