rtp_secure_media=mandatory
rtp_secure_media=optional
rtp_secure_media=mandatory:AES_CM_256_HMAC_SHA1_80,AES_CM_256_HMAC_SHA1_32
rtp_secure_media=optional:AES_CM_256_HMAC_SHA1_80
rtp_secure_media=forbidden

true implies mandatory
false implies forbidden
not set implies optional

rtp_secure_media_inbound or rtp_secure_media_outbound take precedence and are treated the same way based on leg direction
This commit is contained in:
Anthony Minessale
2014-03-06 07:33:05 +05:00
parent eba0cb5f0f
commit e5b291514c
5 changed files with 438 additions and 376 deletions

View File

@@ -3092,6 +3092,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
switch_channel_set_variable(channel, "rtp_has_crypto", "AES_CM_256_HMAC_SHA1_80");
}
break;
case AES_CM_128_NULL_AUTH:
crypto_policy_set_aes_cm_128_null_auth(&policy->rtp);
crypto_policy_set_aes_cm_128_null_auth(&policy->rtcp);
@@ -3355,9 +3356,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session
int initiator = 0;
const char *zrtp_enabled = switch_channel_get_variable(channel, "zrtp_secure_media");
const char *srtp_enabled = switch_channel_get_variable(channel, "rtp_secure_media");
int srtp_enabled = switch_channel_test_flag(channel, CF_SECURE);
if (switch_true(srtp_enabled) && switch_true(zrtp_enabled)) {
if (srtp_enabled && switch_true(zrtp_enabled)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING,
"You can not have ZRTP and SRTP enabled simultaneously, ZRTP will be disabled for this call!\n");
switch_channel_set_variable(channel, "zrtp_secure_media", NULL);