Secure RTP (SRTP) More...
#include "asterisk.h"
#include <srtp/srtp.h>
#include <srtp/crypto_kernel.h>
#include "asterisk/lock.h"
#include "asterisk/sched.h"
#include "asterisk/module.h"
#include "asterisk/options.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/astobj2.h"
Go to the source code of this file.
Data Structures | |
struct | ast_srtp |
struct | ast_srtp_policy |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | ast_srtp_add_stream (struct ast_srtp *srtp, struct ast_srtp_policy *policy) |
static int | ast_srtp_change_source (struct ast_srtp *srtp, unsigned int from_ssrc, unsigned int to_ssrc) |
static int | ast_srtp_create (struct ast_srtp **srtp, struct ast_rtp_instance *rtp, struct ast_srtp_policy *policy) |
static void | ast_srtp_destroy (struct ast_srtp *srtp) |
static int | ast_srtp_get_random (unsigned char *key, size_t len) |
static struct ast_srtp_policy * | ast_srtp_policy_alloc (void) |
static void | ast_srtp_policy_destroy (struct ast_srtp_policy *policy) |
static int | ast_srtp_policy_set_master_key (struct ast_srtp_policy *policy, const unsigned char *key, size_t key_len, const unsigned char *salt, size_t salt_len) |
static void | ast_srtp_policy_set_ssrc (struct ast_srtp_policy *policy, unsigned long ssrc, int inbound) |
static int | ast_srtp_policy_set_suite (struct ast_srtp_policy *policy, enum ast_srtp_suite suite) |
static int | ast_srtp_protect (struct ast_srtp *srtp, void **buf, int *len, int rtcp) |
static int | ast_srtp_replace (struct ast_srtp **srtp, struct ast_rtp_instance *rtp, struct ast_srtp_policy *policy) |
static void | ast_srtp_set_cb (struct ast_srtp *srtp, const struct ast_srtp_cb *cb, void *data) |
static int | ast_srtp_unprotect (struct ast_srtp *srtp, void *buf, int *len, int rtcp) |
static struct ast_srtp_policy * | find_policy (struct ast_srtp *srtp, const srtp_policy_t *policy, int flags) |
static int | load_module (void) |
static int | policy_cmp_fn (void *obj, void *arg, int flags) |
static void | policy_destructor (void *obj) |
static int | policy_hash_fn (const void *obj, const int flags) |
static int | policy_set_suite (crypto_policy_t *p, enum ast_srtp_suite suite) |
static int | res_srtp_init (void) |
static struct ast_srtp * | res_srtp_new (void) |
static void | res_srtp_shutdown (void) |
static const char * | srtp_errstr (int err) |
static void | srtp_event_cb (srtp_event_data_t *data) |
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 = "Secure RTP (SRTP)" , .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 = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND, } |
static struct ast_module_info * | ast_module_info = &__mod_info |
static int | g_initialized = 0 |
static struct ast_srtp_policy_res | policy_res |
static struct ast_srtp_res | srtp_res |
|
static |
Definition at line 598 of file res_srtp.c.
|
static |
Definition at line 598 of file res_srtp.c.
|
static |
Definition at line 487 of file res_srtp.c.
References ao2_t_link, ao2_t_ref, ao2_t_unlink, ast_debug, ast_log(), AST_LOG_WARNING, find_policy(), match(), OBJ_POINTER, ast_srtp::policies, ast_srtp::session, and ast_srtp_policy::sp.
Referenced by ast_srtp_change_source().
|
static |
Definition at line 521 of file res_srtp.c.
References ao2_t_ref, ast_debug, ast_log(), ast_srtp_add_stream(), find_policy(), LOG_WARNING, match(), OBJ_POINTER, OBJ_UNLINK, ast_srtp::session, ast_srtp_policy::sp, and status.
|
static |
Definition at line 441 of file res_srtp.c.
References ao2_t_link, ast_module_ref(), ast_srtp_destroy(), res_srtp_new(), ast_srtp::rtp, ast_module_info::self, ast_srtp::session, and ast_srtp_policy::sp.
Referenced by ast_srtp_replace().
|
static |
Definition at line 474 of file res_srtp.c.
References ao2_t_callback, ao2_t_ref, ast_free, ast_module_unref(), OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, ast_srtp::policies, ast_module_info::self, and ast_srtp::session.
Referenced by ast_srtp_create(), and ast_srtp_replace().
|
static |
Definition at line 306 of file res_srtp.c.
|
static |
Definition at line 236 of file res_srtp.c.
References ao2_t_alloc, ast_log(), LOG_ERROR, and policy_destructor().
|
static |
Definition at line 247 of file res_srtp.c.
References ao2_t_ref.
|
static |
Definition at line 284 of file res_srtp.c.
References ast_calloc, ast_free, and ast_srtp_policy::sp.
|
static |
|
static |
Definition at line 279 of file res_srtp.c.
References policy_set_suite(), and ast_srtp_policy::sp.
|
static |
Definition at line 419 of file res_srtp.c.
References ast_log(), ast_srtp::buf, len(), LOG_WARNING, ast_srtp::rtcpbuf, ast_srtp::session, and srtp_errstr().
|
static |
Definition at line 466 of file res_srtp.c.
References ast_srtp_create(), and ast_srtp_destroy().
|
static |
|
static |
Definition at line 322 of file res_srtp.c.
References ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_t_ref, ast_debug, ast_log(), AST_LOG_NOTICE, AST_LOG_WARNING, ast_rtp_instance_get_stats(), AST_RTP_INSTANCE_STAT_REMOTE_SSRC, ast_srtp::cb, ast_srtp::data, errno, len(), LOG_ERROR, ast_srtp_cb::no_ctx, ast_srtp::policies, ast_rtp_instance_stats::remote_ssrc, ast_srtp::rtp, ast_srtp::session, ast_srtp_policy::sp, srtp_errstr(), and ast_srtp::warned.
|
static |
Definition at line 163 of file res_srtp.c.
References ao2_t_find, ast_srtp::policies, and ast_srtp_policy::sp.
Referenced by ast_srtp_add_stream(), and ast_srtp_change_source().
|
static |
|
static |
Definition at line 156 of file res_srtp.c.
References ast_srtp_policy::sp.
Referenced by res_srtp_new().
|
static |
Definition at line 226 of file res_srtp.c.
References ast_free, and ast_srtp_policy::sp.
Referenced by ast_srtp_policy_alloc().
|
static |
Definition at line 149 of file res_srtp.c.
References ast_srtp_policy::sp.
Referenced by res_srtp_new().
|
static |
Definition at line 252 of file res_srtp.c.
References AST_AES_CM_128_HMAC_SHA1_32, AST_AES_CM_128_HMAC_SHA1_80, ast_log(), and LOG_ERROR.
Referenced by ast_srtp_policy_set_suite().
|
static |
Definition at line 556 of file res_srtp.c.
References ast_log(), AST_LOG_WARNING, ast_rtp_engine_register_srtp(), res_srtp_shutdown(), and srtp_event_cb().
Referenced by load_module().
|
static |
Definition at line 175 of file res_srtp.c.
References ao2_t_container_alloc, ast_calloc, ast_free, ast_log(), LOG_ERROR, ast_srtp::policies, policy_cmp_fn(), policy_hash_fn(), and ast_srtp::warned.
Referenced by ast_srtp_create().
|
static |
Definition at line 546 of file res_srtp.c.
References ast_rtp_engine_unregister_srtp().
Referenced by res_srtp_init(), and unload_module().
|
static |
Definition at line 109 of file res_srtp.c.
Referenced by ast_srtp_protect(), and ast_srtp_unprotect().
|
static |
|
static |
|
static |
Definition at line 598 of file res_srtp.c.
|
static |
Definition at line 598 of file res_srtp.c.
|
static |
Tracks whether or not we've initialized the libsrtp library
Definition at line 68 of file res_srtp.c.
|
static |
Definition at line 101 of file res_srtp.c.
Referenced by ast_rtp_engine_register_srtp().
|
static |
Definition at line 89 of file res_srtp.c.
Referenced by ast_rtp_engine_register_srtp().