mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-05 14:17:21 +00:00
Merge pull request #3 in FSA/freeswitch-advantage from ~PIOTRGREGOR/freeswitch:feature/FS-10778-srtp-mki-support to v1.8-fsa
* commit 'c47d3ad6b7e3fbd752ec4c6a7d0af3186ca94a30': FS-10778: Evaluate rtp_secure_media_mki variable with switch_channel_var_true
This commit is contained in:
commit
15a5dc52a9
@ -1189,7 +1189,7 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh
|
||||
|
||||
if (index == SWITCH_NO_CRYPTO_TAG) index = ctype + 1;
|
||||
|
||||
if (switch_channel_get_variable(channel, "rtp_secure_media_mki")) {
|
||||
if (switch_channel_var_true(channel, "rtp_secure_media_mki")) {
|
||||
engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s|2^31|1:1", index, SUITES[ctype].name, b64_key);
|
||||
} else {
|
||||
engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s", index, SUITES[ctype].name, b64_key);
|
||||
@ -1665,7 +1665,7 @@ static void switch_core_session_apply_crypto(switch_core_session_t *session, swi
|
||||
|
||||
if (engine->ssec[engine->crypto_type].remote_crypto_key && switch_channel_test_flag(session->channel, CF_SECURE)) {
|
||||
|
||||
if (switch_channel_get_variable(session->channel, "rtp_secure_media_mki"))
|
||||
if (switch_channel_var_true(session->channel, "rtp_secure_media_mki"))
|
||||
switch_core_media_add_crypto(session, &engine->ssec[engine->crypto_type], SWITCH_RTP_CRYPTO_SEND);
|
||||
|
||||
switch_core_media_add_crypto(session, &engine->ssec[engine->crypto_type], SWITCH_RTP_CRYPTO_RECV);
|
||||
|
@ -3982,9 +3982,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
|
||||
if (key_material && (*key_material_n > 0)) {
|
||||
|
||||
if (direction == SWITCH_RTP_CRYPTO_RECV) {
|
||||
rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_MKI] = 1;
|
||||
rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_MKI] = 1; /* tell the rest of the environment MKI is used */
|
||||
} else {
|
||||
rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI] = 1;
|
||||
rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI] = 1; /* tell the rest of the environment MKI is used */
|
||||
}
|
||||
|
||||
/* key must be NULL for libsrtp to work correctly with MKI. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user