Skip to content

Commit efc4be2

Browse files
committed
MT#62735 pull up SRTP decryption
Decrypt SRTP (and possibly discard packet) first, before doing source address checking/learning. Change-Id: I2a2cdd94768e93d58e0cdd4614b8ac53ea680724 (cherry picked from commit 88cb8ab) (cherry picked from commit 1f195b7)
1 parent 4436f4e commit efc4be2

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

daemon/media_socket.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2816,6 +2816,17 @@ static int stream_packet(struct packet_handler_ctx *phc) {
28162816
// this sets rtcp, in_srtp, and sinks
28172817
media_packet_rtcp_demux(phc);
28182818

2819+
// this set payload_type, ssrc_in, and mp payloads
2820+
media_packet_rtp_in(phc);
2821+
2822+
// decrypt in place
2823+
// XXX check handler_ret along the paths
2824+
handler_ret = media_packet_decrypt(phc);
2825+
if (handler_ret < 0)
2826+
goto out; // receive error
2827+
2828+
rtp_padding(phc->mp.rtp, &phc->mp.payload);
2829+
28192830
if (media_packet_address_check(phc))
28202831
goto drop;
28212832

@@ -2826,9 +2837,6 @@ static int stream_packet(struct packet_handler_ctx *phc) {
28262837
if (!is_blackhole)
28272838
is_blackhole = !phc->rtcp && !MEDIA_ISSET(phc->mp.media, RECV);
28282839

2829-
// this set payload_type, ssrc_in, and mp payloads
2830-
media_packet_rtp_in(phc);
2831-
28322840
if (phc->mp.rtp)
28332841
ilog(LOG_DEBUG, "Handling packet: remote %s%s%s (expected: %s%s%s) -> local %s "
28342842
"(RTP seq %u TS %u SSRC %s%x%s)",
@@ -2863,14 +2871,6 @@ static int stream_packet(struct packet_handler_ctx *phc) {
28632871
}
28642872
}
28652873

2866-
// decrypt in place
2867-
// XXX check handler_ret along the paths
2868-
handler_ret = media_packet_decrypt(phc);
2869-
if (handler_ret < 0)
2870-
goto out; // receive error
2871-
2872-
rtp_padding(phc->mp.rtp, &phc->mp.payload);
2873-
28742874
// If recording pcap dumper is set, then we record the call.
28752875
if (phc->mp.call->recording && !rtpe_config.rec_egress)
28762876
dump_packet(&phc->mp, &phc->s);

0 commit comments

Comments
 (0)