From d0fd6966f1989a04b39f4a414512f357af677b75 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 26 Jun 2024 12:55:12 -0400 Subject: [PATCH] MT#55283 honour offerer_pref for RTP<>SRTP Run the SDES reordering routine also when the opposite side is plain RTP. Add a matching test case. Ref: https://groups.google.com/g/rtpengine/c/pG6NB24G-BY Change-Id: I7844290e85e44c1bba2c7665202b6259aead1028 --- daemon/call.c | 2 ++ t/auto-daemon-tests.pl | 48 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/daemon/call.c b/daemon/call.c index 3fa19f715..75f5a9b7f 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1588,6 +1588,8 @@ static void __generate_crypto(const sdp_ng_flags *flags, struct call_media *this if (!this->protocol || !this->protocol->srtp || MEDIA_ISSET(this, PASSTHRU)) { crypto_params_sdes_queue_clear(cpq); + // reorder received SDES suites towards offerer based on preference + reorder_sdes_preferences(offered_cpq, offered_order); /* clear crypto for the this leg b/c we are in passthrough mode */ MEDIA_CLEAR(this, DTLS); MEDIA_CLEAR(this, SDES); diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index eed12bc89..0d7ee501c 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -17372,6 +17372,54 @@ SDP new_call; +offer('SDES offerer preferences <> RTP', { ICE => 'remove', SDES => [ 'offerer_pref:AES_256_CM_HMAC_SHA1_32;AES_256_CM_HMAC_SHA1_80' ], 'transport-protocol' => 'RTP/AVP' }, < RTP', { ICE => 'remove' }, < 'remove', DTLS => 'off', SDES => [ 'offerer_pref:AES_256_CM_HMAC_SHA1_32;AES_256_CM_HMAC_SHA1_80' ] }, <