libsrtp icon indicating copy to clipboard operation
libsrtp copied to clipboard

libsrtp header validation fails when header extensions are present

Open tvsriram opened this issue 13 years ago • 3 comments

https://codereview.chromium.org/19678006/

This was a patch submit to chromium.

Index: srtp/srtp/srtp.c

--- srtp/srtp/srtp.c (revision 212142) +++ srtp/srtp/srtp.c (working copy) @@ -68,6 +68,7 @@ #define uint32s_in_rtp_header 3 #define octets_in_rtcp_header 8 #define uint32s_in_rtcp_header 2 +#define octets_in_rtp_extn_hdr 4

err_status_t @@ -733,6 +734,12 @@ if (*pkt_octet_len < octets_in_rtp_header) return err_status_bad_param;

  • /* Check RTP header length */
  • int rtp_header_len = octets_in_rtp_header + 4 * hdr->cc +
  •   (hdr->x == 1) ? octents_in_rtp_extn_hdr : 0;
    
  • if (*pkt_octet_len < rtp_header_len)
  • return err_status_bad_param;

/*

  • look up ssrc in srtp_stream list, and process the packet with
  • the appropriate stream. if we haven't seen this stream before, @@ -977,6 +984,12 @@ if (*pkt_octet_len < octets_in_rtp_header) return err_status_bad_param;
  • /* Check RTP header length */
  • int rtp_header_len = octets_in_rtp_header + 4 * hdr->cc +
  •  (hdr->x == 1) ? octents_in_rtp_extn_hdr : 0;
    
  • if (*pkt_octet_len < rtp_header_len)
  • return err_status_bad_param;

/*

  • look up ssrc in srtp_stream list, and process the packet with
  • the appropriate stream. if we haven't seen this stream before,

tvsriram avatar Aug 01 '13 20:08 tvsriram

I don't quite understand Chromium's system, but it looks like https://codereview.chromium.org/21094005/ is the actual final version of this patch?

On Aug 1, 2013, at 10:18 PM, tvsriram <[email protected]mailto:[email protected]> wrote:

https://codereview.chromium.org/19678006/

This was a patch submit to chromium.

Index: srtp/srtp/srtp.c

--- srtp/srtp/srtp.c (revision 212142) +++ srtp/srtp/srtp.c (working copy) @@ -68,6 +68,7 @@ #define uint32s_in_rtp_header 3 #define octets_in_rtcp_header 8 #define uint32s_in_rtcp_header 2 +#define octets_in_rtp_extn_hdr 4

err_status_t @@ -733,6 +734,12 @@ if (*pkt_octet_len < octets_in_rtp_header) return err_status_bad_param;

  • /* Check RTP header length */
  • int rtp_header_len = octets_in_rtp_header + 4 * hdr->cc +
  • (hdr->x == 1) ? octents_in_rtp_extn_hdr : 0;
  • if (*pkt_octet_len < rtp_header_len)
  • return err_status_bad_param;

/*

  • look up ssrc in srtp_stream list, and process the packet with
  • the appropriate stream. if we haven't seen this stream before, @@ -977,6 +984,12 @@ if (*pkt_octet_len < octets_in_rtp_header) return err_status_bad_param;
  • /* Check RTP header length */
  • int rtp_header_len = octets_in_rtp_header + 4 * hdr->cc +

(hdr->x == 1) ? octents_in_rtp_extn_hdr : 0;

  • if (*pkt_octet_len < rtp_header_len)
  • return err_status_bad_param;

/*

  • look up ssrc in srtp_stream list, and process the packet with
  • the appropriate stream. if we haven't seen this stream before,

— Reply to this email directly or view it on GitHubhttps://github.com/cisco/libsrtp/issues/32.

Jonathan Lennox [email protected]:[email protected]

JonathanLennox avatar Aug 01 '13 20:08 JonathanLennox

It was a miss on my part. There were two patches, so kind of got confused. Yes the later one is the final version of the patch

On Thu, Aug 1, 2013 at 1:33 PM, JonathanLennox [email protected]:

I don't quite understand Chromium's system, but it looks like https://codereview.chromium.org/21094005/ is the actual final version of this patch?

On Aug 1, 2013, at 10:18 PM, tvsriram <[email protected]<mailto: [email protected]>> wrote:

https://codereview.chromium.org/19678006/

This was a patch submit to chromium.

Index: srtp/srtp/srtp.c

--- srtp/srtp/srtp.c (revision 212142) +++ srtp/srtp/srtp.c (working copy) @@ -68,6 +68,7 @@ #define uint32s_in_rtp_header 3 #define octets_in_rtcp_header 8 #define uint32s_in_rtcp_header 2 +#define octets_in_rtp_extn_hdr 4

err_status_t @@ -733,6 +734,12 @@ if (*pkt_octet_len < octets_in_rtp_header) return err_status_bad_param;

  • /* Check RTP header length */
  • int rtp_header_len = octets_in_rtp_header + 4 * hdr->cc +
  • (hdr->x == 1) ? octents_in_rtp_extn_hdr : 0;
  • if (*pkt_octet_len < rtp_header_len)
  • return err_status_bad_param; + /*
  • look up ssrc in srtp_stream list, and process the packet with
  • the appropriate stream. if we haven't seen this stream before, @@ -977,6 +984,12 @@ if (*pkt_octet_len < octets_in_rtp_header) return err_status_bad_param;
  • /* Check RTP header length */
  • int rtp_header_len = octets_in_rtp_header + 4 * hdr->cc +

(hdr->x == 1) ? octents_in_rtp_extn_hdr : 0;

  • if (*pkt_octet_len < rtp_header_len)
  • return err_status_bad_param; + /*
  • look up ssrc in srtp_stream list, and process the packet with
  • the appropriate stream. if we haven't seen this stream before,

— Reply to this email directly or view it on GitHub< https://github.com/cisco/libsrtp/issues/32>.

Jonathan Lennox [email protected]:[email protected]

— Reply to this email directly or view it on GitHubhttps://github.com/cisco/libsrtp/issues/32#issuecomment-21967565 .

tvsriram avatar Aug 01 '13 22:08 tvsriram

This is resolved by 557a7876b35260817a584434f7bc842f72a106d6

jfigus avatar Jun 03 '15 17:06 jfigus