SDP Security descriptions. More...
#include "asterisk.h"
#include "asterisk/options.h"
#include "asterisk/utils.h"
#include "include/sdp_crypto.h"
Go to the source code of this file.
Data Structures | |
struct | sdp_crypto |
Macros | |
#define | SRTP_MASTER_LEN 30 |
#define | SRTP_MASTER_LEN64 (((SRTP_MASTER_LEN) * 8 + 5) / 6 + 1) |
#define | SRTP_MASTERKEY_LEN 16 |
#define | SRTP_MASTERSALT_LEN ((SRTP_MASTER_LEN) - (SRTP_MASTERKEY_LEN)) |
Functions | |
static int | sdp_crypto_activate (struct sdp_crypto *p, int suite_val, unsigned char *remote_key, struct ast_rtp_instance *rtp) |
static struct sdp_crypto * | sdp_crypto_alloc (void) |
const char * | sdp_crypto_attrib (struct sdp_crypto *p) |
void | sdp_crypto_destroy (struct sdp_crypto *crypto) |
int | sdp_crypto_offer (struct sdp_crypto *p) |
int | sdp_crypto_process (struct sdp_crypto *p, const char *attr, struct ast_rtp_instance *rtp) |
struct sdp_crypto * | sdp_crypto_setup (void) |
static int | set_crypto_policy (struct ast_srtp_policy *policy, int suite_val, const unsigned char *master_key, unsigned long ssrc, int inbound) |
Variables | |
struct ast_srtp_res * | res_srtp |
struct ast_srtp_policy_res * | res_srtp_policy |
#define SRTP_MASTER_LEN 30 |
Definition at line 40 of file sdp_crypto.c.
Referenced by sdp_crypto_process(), and sdp_crypto_setup().
#define SRTP_MASTER_LEN64 (((SRTP_MASTER_LEN) * 8 + 5) / 6 + 1) |
Definition at line 43 of file sdp_crypto.c.
#define SRTP_MASTERKEY_LEN 16 |
Definition at line 41 of file sdp_crypto.c.
Referenced by set_crypto_policy().
#define SRTP_MASTERSALT_LEN ((SRTP_MASTER_LEN) - (SRTP_MASTERKEY_LEN)) |
Definition at line 42 of file sdp_crypto.c.
Referenced by set_crypto_policy().
|
static |
Definition at line 136 of file sdp_crypto.c.
References ast_srtp_policy_res::alloc, ast_debug, ast_log(), ast_rtp_engine_srtp_is_registered(), ast_rtp_instance_add_srtp_policy(), ast_rtp_instance_get_stats(), AST_RTP_INSTANCE_STAT_LOCAL_SSRC, ast_srtp_policy_res::destroy, sdp_crypto::local_key, ast_rtp_instance_stats::local_ssrc, LOG_WARNING, and set_crypto_policy().
Referenced by sdp_crypto_process().
|
static |
Definition at line 59 of file sdp_crypto.c.
References ast_calloc.
Referenced by sdp_crypto_setup().
const char* sdp_crypto_attrib | ( | struct sdp_crypto * | p | ) |
Definition at line 318 of file sdp_crypto.c.
References sdp_crypto::a_crypto.
Referenced by get_crypto_attrib().
void sdp_crypto_destroy | ( | struct sdp_crypto * | crypto | ) |
Definition at line 64 of file sdp_crypto.c.
References sdp_crypto::a_crypto, ast_free, and sdp_crypto::tag.
Referenced by sdp_crypto_setup(), and sip_srtp_destroy().
int sdp_crypto_offer | ( | struct sdp_crypto * | p | ) |
Definition at line 295 of file sdp_crypto.c.
References sdp_crypto::a_crypto, ast_asprintf, ast_debug, ast_free, ast_log(), ast_strlen_zero(), sdp_crypto::local_key64, LOG_ERROR, sdp_crypto::suite, and sdp_crypto::tag.
Referenced by get_crypto_attrib(), and sdp_crypto_process().
int sdp_crypto_process | ( | struct sdp_crypto * | p, |
const char * | attr, | ||
struct ast_rtp_instance * | rtp | ||
) |
Definition at line 192 of file sdp_crypto.c.
References AST_AES_CM_128_HMAC_SHA1_32, AST_AES_CM_128_HMAC_SHA1_80, ast_base64decode(), ast_copy_string(), ast_debug, ast_log(), ast_rtp_engine_srtp_is_registered(), ast_strdup, ast_strdupa, LOG_ERROR, LOG_NOTICE, LOG_WARNING, sdp_crypto::remote_key, sdp_crypto_activate(), sdp_crypto_offer(), SRTP_MASTER_LEN, str, strsep(), sdp_crypto::suite, and sdp_crypto::tag.
Referenced by process_crypto().
struct sdp_crypto* sdp_crypto_setup | ( | void | ) |
Definition at line 73 of file sdp_crypto.c.
References ast_base64decode(), ast_base64encode(), ast_debug, ast_free, ast_log(), ast_rtp_engine_srtp_is_registered(), ast_srtp_res::get_random, sdp_crypto::local_key, sdp_crypto::local_key64, LOG_ERROR, sdp_crypto::remote_key, sdp_crypto_alloc(), sdp_crypto_destroy(), and SRTP_MASTER_LEN.
Referenced by get_crypto_attrib(), and process_crypto().
|
static |
Definition at line 113 of file sdp_crypto.c.
References ast_log(), ast_rtp_engine_srtp_is_registered(), LOG_WARNING, ast_srtp_policy_res::set_master_key, ast_srtp_policy_res::set_ssrc, ast_srtp_policy_res::set_suite, SRTP_MASTERKEY_LEN, and SRTP_MASTERSALT_LEN.
Referenced by sdp_crypto_activate().
struct ast_srtp_res* res_srtp |
Definition at line 48 of file rtp_engine.c.
struct ast_srtp_policy_res* res_srtp_policy |
Definition at line 49 of file rtp_engine.c.
Referenced by ast_rtp_engine_srtp_is_registered().