|
Asterisk - The Open Source Telephony Project GIT-master-27fb039
|
#include "asterisk.h"#include "asterisk/app.h"#include "asterisk/cli.h"#include "asterisk/conversions.h"#include "asterisk/module.h"#include "asterisk/global_datastores.h"#include "asterisk/pbx.h"#include "asterisk/vector.h"#include "res_stir_shaken/stir_shaken.h"
Go to the source code of this file.
Data Structures | |
| struct | verification_vector |
Macros | |
| #define | _TRACE_PREFIX_ "rss",__LINE__, "" |
| #define | TN_AUTH_LIST_LONG "TNAuthorizationList" |
| #define | TN_AUTH_LIST_OID "1.3.6.1.5.5.7.1.26" |
| #define | TN_AUTH_LIST_SHORT "TNAuthList" |
Functions | |
| static void | __reg_module (void) |
| static void | __unreg_module (void) |
| struct ast_module * | AST_MODULE_SELF_SYM (void) |
| int | ast_stir_shaken_add_result_to_channel (struct ast_stir_shaken_vs_ctx *ctx) |
| Add a STIR/SHAKEN verification result to a channel. | |
| struct stir_shaken_attestation_ds * | ast_stir_shaken_get_attestation_datastore (struct ast_channel *chan) |
| static void | attestation_ds_destroy (void *data) |
| static int | check_for_old_config (void) |
| static int | func_read_verification (struct ast_channel *chan, const char *function, char *data, char *buf, size_t len) |
| Retrieves STIR/SHAKEN verification information for the channel via dialplan. Examples: | |
| static int | func_write_attestation (struct ast_channel *chan, const char *function, char *data, const char *value) |
| int | get_tn_auth_nid (void) |
| Retrieves the OpenSSL NID for the TN Auth list extension. | |
| static int | load_module (void) |
| static int | reload_module (void) |
| static int | unload_module (void) |
| static void | verification_ds_destroy_cb (void *data) |
| The callback to destroy a stir_shaken_datastore. | |
| static void | verification_ds_free (struct stir_shaken_verification_ds *datastore) |
| Frees a stir_shaken_datastore structure. | |
Variables | |
| static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "STIR/SHAKEN Module for Asterisk" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND - 1, .requires = "res_curl", } |
| static const struct ast_module_info * | ast_module_info = &__mod_info |
| static const struct ast_datastore_info | attestation_ds_info |
| static struct ast_custom_function | stir_shaken_attestation |
| static struct ast_custom_function | stir_shaken_verification |
| static int | tn_auth_list_nid |
| static const struct ast_datastore_info | verification_ds_info |
| #define _TRACE_PREFIX_ "rss",__LINE__, "" |
Definition at line 26 of file res_stir_shaken.c.
| #define TN_AUTH_LIST_LONG "TNAuthorizationList" |
Definition at line 429 of file res_stir_shaken.c.
| #define TN_AUTH_LIST_OID "1.3.6.1.5.5.7.1.26" |
Definition at line 427 of file res_stir_shaken.c.
| #define TN_AUTH_LIST_SHORT "TNAuthList" |
Definition at line 428 of file res_stir_shaken.c.
|
static |
Definition at line 525 of file res_stir_shaken.c.
|
static |
Definition at line 525 of file res_stir_shaken.c.
| struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 525 of file res_stir_shaken.c.
| int ast_stir_shaken_add_result_to_channel | ( | struct ast_stir_shaken_vs_ctx * | ctx | ) |
Add a STIR/SHAKEN verification result to a channel.
| ctx | VS context |
| -1 | on failure |
| 0 | on success |
Definition at line 83 of file res_stir_shaken.c.
References ast_calloc, ast_channel_datastore_add(), ast_channel_datastore_find(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_datastore_alloc, ast_datastore_free(), ast_free, ast_log, ast_strdup, AST_VECTOR_APPEND, AST_VECTOR_INIT, stir_shaken_verification_ds::attestation, ast_stir_shaken_vs_ctx::attestation, ast_stir_shaken_vs_ctx::chan, ast_datastore::data, ast_stir_shaken_vs_ctx::failure_reason, stir_shaken_verification_ds::identity, ast_stir_shaken_vs_ctx::identity_hdr, ast_datastore::inheritance, LOG_ERROR, NULL, verification_ds_free(), verification_ds_info, and stir_shaken_verification_ds::verify_result.
Referenced by process_failure(), and stir_shaken_incoming_request().
| struct stir_shaken_attestation_ds * ast_stir_shaken_get_attestation_datastore | ( | struct ast_channel * | chan | ) |
Definition at line 314 of file res_stir_shaken.c.
References ast_channel_datastore_find(), attestation_ds_info, ast_datastore::data, and NULL.
Referenced by stir_shaken_outgoing_request().
|
static |
Definition at line 304 of file res_stir_shaken.c.
References ast_free.
Referenced by func_write_attestation().
|
static |
Definition at line 431 of file res_stir_shaken.c.
References ast_category_browse(), ast_config_destroy(), ast_config_load, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_variable_retrieve(), CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEMISSING, CONFIG_STATUS_FILEUNCHANGED, LOG_ERROR, NULL, and RAII_VAR.
Referenced by load_module().
|
static |
Retrieves STIR/SHAKEN verification information for the channel via dialplan. Examples:
STIR_SHAKEN(count) STIR_SHAKEN(0, identity) STIR_SHAKEN(1, attestation) STIR_SHAKEN(27, verify_result)
| -1 | on failure |
| 0 | on success |
Definition at line 186 of file res_stir_shaken.c.
References args, AST_APP_ARG, ast_channel_datastore_find(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_copy_string(), AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_str_to_uint(), ast_strdupa, ast_strip(), ast_strlen_zero(), AST_VECTOR_GET, AST_VECTOR_SIZE, stir_shaken_verification_ds::attestation, buf, ast_datastore::data, first, stir_shaken_verification_ds::identity, len(), LOG_ERROR, LOG_WARNING, NULL, verification_ds_info, stir_shaken_verification_ds::verify_result, and vs_response_code_to_str().
|
static |
Definition at line 329 of file res_stir_shaken.c.
References args, AST_APP_ARG, ast_calloc, ast_channel_datastore_add(), ast_channel_datastore_find(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_datastore_alloc, ast_datastore_free(), AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strings_equal(), ast_strip(), ast_strlen_zero(), ast_true(), attestation_ds_destroy(), attestation_ds_info, ast_datastore::data, ast_datastore::inheritance, LOG_ERROR, LOG_WARNING, NULL, stir_shaken_attestation_ds::suppress, and value.
| int get_tn_auth_nid | ( | void | ) |
Retrieves the OpenSSL NID for the TN Auth list extension.
| The | NID |
Definition at line 44 of file res_stir_shaken.c.
References tn_auth_list_nid.
Referenced by check_tn_auth_list().
|
static |
Definition at line 476 of file res_stir_shaken.c.
References ast_custom_function_register, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, check_for_old_config(), common_config_load(), crypto_load(), crypto_register_x509_extension(), stir_shaken_attestation, stir_shaken_verification, TN_AUTH_LIST_LONG, tn_auth_list_nid, TN_AUTH_LIST_OID, TN_AUTH_LIST_SHORT, and unload_module().
|
static |
|
static |
Definition at line 416 of file res_stir_shaken.c.
References ast_custom_function_unregister(), common_config_unload(), crypto_unload(), stir_shaken_attestation, and stir_shaken_verification.
Referenced by load_module().
|
static |
The callback to destroy a stir_shaken_datastore.
| data | The stir_shaken_datastore |
Definition at line 70 of file res_stir_shaken.c.
References ast_free, AST_VECTOR_RESET, and verification_ds_free().
|
static |
Frees a stir_shaken_datastore structure.
| datastore | The datastore to free |
Definition at line 54 of file res_stir_shaken.c.
References ast_free, stir_shaken_verification_ds::attestation, and stir_shaken_verification_ds::identity.
Referenced by ast_stir_shaken_add_result_to_channel(), and verification_ds_destroy_cb().
|
static |
Definition at line 525 of file res_stir_shaken.c.
|
static |
Definition at line 525 of file res_stir_shaken.c.
|
static |
Definition at line 309 of file res_stir_shaken.c.
Referenced by ast_stir_shaken_get_attestation_datastore(), and func_write_attestation().
|
static |
Definition at line 406 of file res_stir_shaken.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 401 of file res_stir_shaken.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 42 of file res_stir_shaken.c.
Referenced by get_tn_auth_nid(), and load_module().
|
static |
Definition at line 78 of file res_stir_shaken.c.
Referenced by ast_stir_shaken_add_result_to_channel(), and func_read_verification().