Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#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 "res_stir_shaken/stir_shaken.h"
Go to the source code of this file.
Data Structures | |
struct | stir_datastore |
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. More... | |
static int | check_for_old_config (void) |
static int | func_read (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: More... | |
int | get_tn_auth_nid (void) |
Retrieves the OpenSSL NID for the TN Auth list extension. More... | |
static int | load_module (void) |
static int | reload_module (void) |
static void | stir_datastore_destroy_cb (void *data) |
The callback to destroy a stir_shaken_datastore. More... | |
static void | stir_datastore_free (struct stir_datastore *datastore) |
Frees a stir_shaken_datastore structure. More... | |
static int | unload_module (void) |
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 = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .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 | stir_shaken_datastore_info |
static struct ast_custom_function | stir_shaken_function |
static int | tn_auth_list_nid |
#define _TRACE_PREFIX_ "rss",__LINE__, "" |
Definition at line 26 of file res_stir_shaken.c.
#define TN_AUTH_LIST_LONG "TNAuthorizationList" |
Definition at line 300 of file res_stir_shaken.c.
#define TN_AUTH_LIST_OID "1.3.6.1.5.5.7.1.26" |
Definition at line 298 of file res_stir_shaken.c.
#define TN_AUTH_LIST_SHORT "TNAuthList" |
Definition at line 299 of file res_stir_shaken.c.
|
static |
Definition at line 390 of file res_stir_shaken.c.
|
static |
Definition at line 390 of file res_stir_shaken.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 390 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 89 of file res_stir_shaken.c.
References ast_calloc, ast_channel_datastore_add(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_datastore_alloc, ast_log, ast_strdup, stir_datastore::attestation, ast_stir_shaken_vs_ctx::attestation, ast_stir_shaken_vs_ctx::chan, ast_datastore::data, ast_stir_shaken_vs_ctx::failure_reason, stir_datastore::identity, ast_stir_shaken_vs_ctx::identity_hdr, LOG_ERROR, NULL, stir_datastore_free(), stir_shaken_datastore_info, and stir_datastore::verify_result.
Referenced by process_failure(), and stir_shaken_incoming_request().
|
static |
Definition at line 302 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 169 of file res_stir_shaken.c.
References args, AST_APP_ARG, ast_channel_datastores(), ast_channel_lock, ast_channel_unlock, ast_copy_string(), AST_DECLARE_APP_ARGS, AST_LIST_TRAVERSE, ast_log, AST_STANDARD_APP_ARGS, ast_str_to_uint(), ast_strdupa, ast_strip(), ast_strlen_zero(), stir_datastore::attestation, buf, ast_datastore::data, first, stir_datastore::identity, ast_datastore::info, len(), LOG_ERROR, LOG_WARNING, stir_shaken_datastore_info, stir_datastore::verify_result, and vs_response_code_to_str().
int get_tn_auth_nid | ( | void | ) |
Retrieves the OpenSSL NID for the TN Auth list extension.
The | NID |
Definition at line 41 of file res_stir_shaken.c.
References tn_auth_list_nid.
Referenced by check_tn_auth_list().
|
static |
Definition at line 347 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_function, TN_AUTH_LIST_LONG, tn_auth_list_nid, TN_AUTH_LIST_OID, TN_AUTH_LIST_SHORT, and unload_module().
|
static |
|
static |
The callback to destroy a stir_shaken_datastore.
data | The stir_shaken_datastore |
Definition at line 77 of file res_stir_shaken.c.
References stir_datastore_free().
|
static |
Frees a stir_shaken_datastore structure.
datastore | The datastore to free |
Definition at line 61 of file res_stir_shaken.c.
References ast_free, stir_datastore::attestation, and stir_datastore::identity.
Referenced by ast_stir_shaken_add_result_to_channel(), and stir_datastore_destroy_cb().
|
static |
Definition at line 286 of file res_stir_shaken.c.
References ast_custom_function_unregister(), common_config_unload(), crypto_unload(), and stir_shaken_function.
Referenced by load_module().
|
static |
Definition at line 390 of file res_stir_shaken.c.
|
static |
Definition at line 390 of file res_stir_shaken.c.
|
static |
Definition at line 84 of file res_stir_shaken.c.
Referenced by ast_stir_shaken_add_result_to_channel(), and func_read().
|
static |
Definition at line 276 of file res_stir_shaken.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 39 of file res_stir_shaken.c.
Referenced by get_tn_auth_nid(), and load_module().