Browse Source

MT#55283 fix padding/SRTP order

The packet must be decrypted first before RTP padding can be considered,
as the padding count is part of the encrypted payload as well.

Change-Id: I6aecff636efd420401856bb8110b3d784f989179
pull/1546/head
Richard Fuchs 3 years ago
parent
commit
9e09cf3c40
2 changed files with 4 additions and 2 deletions
  1. +2
    -2
      daemon/media_socket.c
  2. +2
    -0
      lib/rtplib.c

+ 2
- 2
daemon/media_socket.c View File

@ -1897,8 +1897,6 @@ static void media_packet_rtp_in(struct packet_handler_ctx *phc)
bool unkern = false;
if (G_LIKELY(!phc->rtcp && !rtp_payload(&phc->mp.rtp, &phc->mp.payload, &phc->s))) {
rtp_padding(phc->mp.rtp, &phc->mp.payload);
unkern = __stream_ssrc_in(phc->in_srtp, phc->mp.rtp->ssrc, &phc->mp.ssrc_in,
phc->mp.media->monologue->ssrc_hash);
@ -2437,6 +2435,8 @@ static int stream_packet(struct packet_handler_ctx *phc) {
if (handler_ret < 0)
goto out; // receive error
rtp_padding(phc->mp.rtp, &phc->mp.payload);
// If recording pcap dumper is set, then we record the call.
if (phc->mp.call->recording)
dump_packet(&phc->mp, &phc->s);


+ 2
- 0
lib/rtplib.c View File

@ -107,6 +107,8 @@ error:
int rtp_padding(const struct rtp_header *header, str *payload) {
if (!header || payload->s)
return 0;
if (!(header->v_p_x_cc & 0x20))
return 0; // no padding
if (payload->len == 0)


Loading…
Cancel
Save