From 92ea2685ae6bb2ac9d44d89daf59ea6ef8e4518a Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 5 Oct 2020 13:06:49 -0400 Subject: [PATCH] TT#96200 fix SRTP multi-protocol re-offer Do not perform protocol negotiations in an offer closes #1086 Change-Id: I5fb7638aa71e80c08abcda2d8c341ae72725bace --- daemon/call.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 7a96b552f..a0e7c7309 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1348,15 +1348,18 @@ static void __generate_crypto(const struct sdp_ng_flags *flags, struct call_medi MEDIA_CLEAR(this, SETUP_PASSIVE); } - if (!MEDIA_ARESET2(this, DTLS, SDES) && flags->opmode == OP_OFFER) { - /* we offer both DTLS and SDES by default */ - /* unless this is overridden by flags */ - if (!flags->dtls_off) - MEDIA_SET(this, DTLS); - if (!flags->sdes_off) - MEDIA_SET(this, SDES); - else - goto skip_sdes; + if (flags->opmode == OP_OFFER) { + // if neither is enabled yet... + if (!MEDIA_ISSET2(this, DTLS, SDES)) { + /* we offer both DTLS and SDES by default */ + /* unless this is overridden by flags */ + if (!flags->dtls_off) + MEDIA_SET(this, DTLS); + if (!flags->sdes_off) + MEDIA_SET(this, SDES); + else + goto skip_sdes; + } } else { /* if both SDES and DTLS are supported, we may use the flags to select one