libsrtp header validation fails when header extensions are present
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,
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]
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 .
This is resolved by 557a7876b35260817a584434f7bc842f72a106d6