Commit graph

15 commits

Author SHA1 Message Date
Karl Wiberg
918f50c5d1 Use absl::make_unique and absl::WrapUnique directly
Instead of going through our wrappers in ptr_util.h.

This CL was generated by the following script:

  git grep -l ptr_util | xargs perl -pi -e 's,#include "rtc_base/ptr_util.h",#include "absl/memory/memory.h",'
  git grep -l MakeUnique | xargs perl -pi -e 's,\b(rtc::)?MakeUnique\b,absl::make_unique,g'
  git grep -l WrapUnique | xargs perl -pi -e 's,\b(rtc::)?WrapUnique\b,absl::WrapUnique,g'
  git checkout -- rtc_base/ptr_util{.h,_unittest.cc}
  git cl format

Followed by manually adding dependencies on
//third_party/abseil-cpp/absl/memory until `gn check` stopped
complaining.

Bug: webrtc:9473
Change-Id: I89ccd363f070479b8c431eb2c3d404a46eaacc1c
Reviewed-on: https://webrtc-review.googlesource.com/86600
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23850}
2018-07-05 10:59:49 +00:00
Zhi Huang
b57e169f3c Add a flag to actively reset the SRTP parameters
Add a new flag to RtcConfiguration. By setting that flag to true, the
SRTP parameters will be reset whenever the DTLS transports are reset
after every offer/answer negotiation.

The flag is added to Android and Objc wrapper as well.

This should only be used as a workaround for the linked bug, if the
application knows that the other party is affected (for instance,
using a version number).

TBR=sakal@webrtc.org, denicija@webrtc.org

Bug: chromium:835958
Change-Id: I6db025e1c69bf83e1b1908f7df4627430db9920c
Reviewed-on: https://webrtc-review.googlesource.com/83101
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23587}
2018-06-12 20:32:00 +00:00
Zhi Huang
6c789e08d5 Revert "Add a flag to actively reset the SRTP parameters"
This reverts commit bae103126c.

Reason for revert: Merge native code change with Android and Objc wrapper.

Original change's description:
> Add a flag to actively reset the SRTP parameters
> 
> Add a new flag to RtcConfiguration. By setting that flag to true, the
> SRTP parameters will be reset whenever the DTLS transports are reset
> after every offer/answer negotiation.
> 
> This should only be used as a workaround for the linked bug, if the
> application knows that the other party is affected (for instance,
> using a version number).
> 
> Bug: chromium:835958
> Change-Id: Ifb4b99f68dc272507728ab59c07627f0d1b9c605
> Reviewed-on: https://webrtc-review.googlesource.com/81642
> Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23570}

TBR=deadbeef@webrtc.org,zhihuang@webrtc.org

Change-Id: Ibd7a3b8f45ff8df4af33d758f8fd3e2d5158e8e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:835958
Reviewed-on: https://webrtc-review.googlesource.com/83080
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23571}
2018-06-12 00:56:07 +00:00
Zhi Huang
bae103126c Add a flag to actively reset the SRTP parameters
Add a new flag to RtcConfiguration. By setting that flag to true, the
SRTP parameters will be reset whenever the DTLS transports are reset
after every offer/answer negotiation.

This should only be used as a workaround for the linked bug, if the
application knows that the other party is affected (for instance,
using a version number).

Bug: chromium:835958
Change-Id: Ifb4b99f68dc272507728ab59c07627f0d1b9c605
Reviewed-on: https://webrtc-review.googlesource.com/81642
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23570}
2018-06-11 23:06:26 +00:00
Taylor Brandstetter
53e43b3060 Fix bug that reset SRTP context on every applied answer.
This causes the SRTCP index and SRTP ROC to be reset, which will cause replay
detection errors in decrypting SRTCP packets, and errors in decrypting SRTP
packets if the ROC was nonzero.

Bug: webrtc:8996
Change-Id: I3bf6c136d928f39b19de05616d5cd2833f42223c
Reviewed-on: https://webrtc-review.googlesource.com/71300
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22965}
2018-04-20 21:08:53 +00:00
Zhi Huang
365381fdf1 Replace BundleFilter with RtpDemuxer in RtpTransport.
BundleFilter is replaced by RtpDemuxer in RtpTransport for payload
type-based demuxing. RtpTransport will support MID-based demuxing later.

Each BaseChannel has its own RTP demuxing criteria and when connecting
to the RtpTransport, BaseChannel will register itself as a demuxer sink.

The inheritance model is changed. New inheritance chain:
DtlsSrtpTransport->SrtpTransport->RtpTranpsort

The JsepTransport2 is renamed to JsepTransport.

NOTE:
When RTCP packets are received, Call::DeliverRtcp will be called for
multiple times (webrtc:9035) which is an existing issue. With this CL,
it will become more of a problem and should be fixed.

Bug: webrtc:8587
Change-Id: Ibd880e7b744bd912336a691309950bc18e42cf62
Reviewed-on: https://webrtc-review.googlesource.com/65786
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22867}
2018-04-14 00:57:11 +00:00
Zhi Huang
e830e683c4 Use new TransportController implementation in PeerConnection.
The TransportController will be replaced by the JsepTransportController
and JsepTransport will be replace be JsepTransport2.

The JsepTransportController will take the entire SessionDescription
and handle the RtcpMux, Sdes and BUNDLE internally.

The ownership model is also changed. The P2P layer transports are not
ref-counted and will be owned by the JsepTransport2.

In ORTC aspect, RtpTransportAdapter is now a wrapper over RtpTransport
or SrtpTransport and it implements the public and internal interface
by calling the transport underneath.

Bug: webrtc:8587
Change-Id: Ia7fa61288a566f211f8560072ea0eecaf19e48df
Reviewed-on: https://webrtc-review.googlesource.com/59586
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22693}
2018-03-30 18:41:19 +00:00
Zhi Huang
95e7dbb7c7 Revert "Reland "Replace BundleFilter with RtpDemuxer in RtpTransport.""
This reverts commit 27f3bf5128.

Reason for revert: Broken internal project.

Original change's description:
> Reland "Replace BundleFilter with RtpDemuxer in RtpTransport."
> 
> This reverts commit 97d5e5b32c.
> 
> Reason for revert: <INSERT REASONING HERE>
> 
> Original change's description:
> > Revert "Replace BundleFilter with RtpDemuxer in RtpTransport."
> > 
> > This reverts commit ea8b62a3e7.
> > 
> > Reason for revert: Broke chromium tests.
> > Original change's description:
> > > Replace BundleFilter with RtpDemuxer in RtpTransport.
> > > 
> > > BundleFilter is replaced by RtpDemuxer in RtpTransport for payload
> > > type-based demuxing. RtpTransport will support MID-based demuxing later.
> > > 
> > > Each BaseChannel has its own RTP demuxing criteria and when connecting
> > > to the RtpTransport, BaseChannel will register itself as a demuxer sink.
> > > 
> > > The inheritance model is changed. New inheritance chain:
> > > DtlsSrtpTransport->SrtpTransport->RtpTranpsort
> > > 
> > > NOTE:
> > > When RTCP packets are received, Call::DeliverRtcp will be called for
> > > multiple times (webrtc:9035) which is an existing issue. With this CL,
> > > it will become more of a problem and should be fixed.
> > > 
> > > Bug: webrtc:8587
> > > Change-Id: I1d8a00443bd4bcbacc56e5e19b7294205cdc38f0
> > > Reviewed-on: https://webrtc-review.googlesource.com/61360
> > > Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> > > Reviewed-by: Steve Anton <steveanton@webrtc.org>
> > > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#22613}
> > 
> > TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org
> > 
> > Change-Id: If245da9d1ce970ac8dab7f45015e9b268a5dbcbd
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: webrtc:8587
> > Reviewed-on: https://webrtc-review.googlesource.com/64860
> > Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
> > Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22614}
> 
> TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org
> 
> Change-Id: I3c272588ab4388ecadc4edc6786d5195c701855f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8587
> Reviewed-on: https://webrtc-review.googlesource.com/64862
> Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22615}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:8587
Change-Id: I694ce9a039ed52c5961cdc0cba57587bed4cbde4
Reviewed-on: https://webrtc-review.googlesource.com/65381
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22665}
2018-03-29 02:45:17 +00:00
Zhi Huang
27f3bf5128 Reland "Replace BundleFilter with RtpDemuxer in RtpTransport."
This reverts commit 97d5e5b32c.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Replace BundleFilter with RtpDemuxer in RtpTransport."
> 
> This reverts commit ea8b62a3e7.
> 
> Reason for revert: Broke chromium tests.
> Original change's description:
> > Replace BundleFilter with RtpDemuxer in RtpTransport.
> > 
> > BundleFilter is replaced by RtpDemuxer in RtpTransport for payload
> > type-based demuxing. RtpTransport will support MID-based demuxing later.
> > 
> > Each BaseChannel has its own RTP demuxing criteria and when connecting
> > to the RtpTransport, BaseChannel will register itself as a demuxer sink.
> > 
> > The inheritance model is changed. New inheritance chain:
> > DtlsSrtpTransport->SrtpTransport->RtpTranpsort
> > 
> > NOTE:
> > When RTCP packets are received, Call::DeliverRtcp will be called for
> > multiple times (webrtc:9035) which is an existing issue. With this CL,
> > it will become more of a problem and should be fixed.
> > 
> > Bug: webrtc:8587
> > Change-Id: I1d8a00443bd4bcbacc56e5e19b7294205cdc38f0
> > Reviewed-on: https://webrtc-review.googlesource.com/61360
> > Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> > Reviewed-by: Steve Anton <steveanton@webrtc.org>
> > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22613}
> 
> TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org
> 
> Change-Id: If245da9d1ce970ac8dab7f45015e9b268a5dbcbd
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8587
> Reviewed-on: https://webrtc-review.googlesource.com/64860
> Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
> Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22614}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org

Change-Id: I3c272588ab4388ecadc4edc6786d5195c701855f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8587
Reviewed-on: https://webrtc-review.googlesource.com/64862
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22615}
2018-03-27 04:39:12 +00:00
Zhi Huang
97d5e5b32c Revert "Replace BundleFilter with RtpDemuxer in RtpTransport."
This reverts commit ea8b62a3e7.

Reason for revert: Broke chromium tests.
Original change's description:
> Replace BundleFilter with RtpDemuxer in RtpTransport.
> 
> BundleFilter is replaced by RtpDemuxer in RtpTransport for payload
> type-based demuxing. RtpTransport will support MID-based demuxing later.
> 
> Each BaseChannel has its own RTP demuxing criteria and when connecting
> to the RtpTransport, BaseChannel will register itself as a demuxer sink.
> 
> The inheritance model is changed. New inheritance chain:
> DtlsSrtpTransport->SrtpTransport->RtpTranpsort
> 
> NOTE:
> When RTCP packets are received, Call::DeliverRtcp will be called for
> multiple times (webrtc:9035) which is an existing issue. With this CL,
> it will become more of a problem and should be fixed.
> 
> Bug: webrtc:8587
> Change-Id: I1d8a00443bd4bcbacc56e5e19b7294205cdc38f0
> Reviewed-on: https://webrtc-review.googlesource.com/61360
> Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22613}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,zhihuang@webrtc.org

Change-Id: If245da9d1ce970ac8dab7f45015e9b268a5dbcbd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8587
Reviewed-on: https://webrtc-review.googlesource.com/64860
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22614}
2018-03-27 00:09:12 +00:00
Zhi Huang
ea8b62a3e7 Replace BundleFilter with RtpDemuxer in RtpTransport.
BundleFilter is replaced by RtpDemuxer in RtpTransport for payload
type-based demuxing. RtpTransport will support MID-based demuxing later.

Each BaseChannel has its own RTP demuxing criteria and when connecting
to the RtpTransport, BaseChannel will register itself as a demuxer sink.

The inheritance model is changed. New inheritance chain:
DtlsSrtpTransport->SrtpTransport->RtpTranpsort

NOTE:
When RTCP packets are received, Call::DeliverRtcp will be called for
multiple times (webrtc:9035) which is an existing issue. With this CL,
it will become more of a problem and should be fixed.

Bug: webrtc:8587
Change-Id: I1d8a00443bd4bcbacc56e5e19b7294205cdc38f0
Reviewed-on: https://webrtc-review.googlesource.com/61360
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22613}
2018-03-26 22:40:05 +00:00
Zhi Huang
2dfc42d7b6 Prepare to make BaseChannel depend on RtpTransportInternal only.
Eventually we want BaseChannel to depend on the RtpTransportInternal
instead of DtlsTransportInternal and share RtpTransport when bundling.
This CL is the first step.

Add SetRtpTransport and Init_w(RtptransportInternal*) to BaseChannel.
These two methods would replace the existing SetTransports and Init_w
methods.

Add new CreateVoice/VideoChannel methods to the ChannelManager which
 take RtpTransportInternal instead of Dtls/PacketTransportInternal.

|cotnent_name| is removed from the SrtpTransport to simplify to code
since it is only used for debugging.

InitNetwork_n is removed from BaseChannel in CL as well.

Bug: webrtc:7013
Change-Id: I35b1565958548bd4896854c49e61d3ee160b7634
Reviewed-on: https://webrtc-review.googlesource.com/27840
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21057}
2017-12-04 22:27:39 +00:00
Zhi Huang
cd3fc5d90c Use the DtlsSrtpTransport in BaseChannel.
The DtlsSrtpTransport takes the reponsiblity of setting up DTLS-SRTP from
the BaseChannel.

The BaseChannel doesn't handle the signals from the P2P layer transport anymore.
The RtpTransport handles the signals from the PacketTransportInternal and the
DtlsSrtpTransport handles the DTLS-specific signals and determines when to extract
the keys and setting the parameters.

In channel_unittests.cc, call from DTLS to SDES is expected to fail since the
fallback from DTLS to SDES is not supported.

Bug: webrtc:7013
Change-Id: I0a54e017986f5a8ae9710e79643a4651bef3c38f
Reviewed-on: https://webrtc-review.googlesource.com/24702
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20941}
2017-11-29 19:38:39 +00:00
Zhi Huang
03fdc1042f Remove an unused debug message.
TBR=zhihuang@webrtc.org

Bug: None
Change-Id: If4cbffbba1e25a839a89c2b5956138481cb00edd
Reviewed-on: https://webrtc-review.googlesource.com/24740
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20805}
2017-11-21 00:18:12 +00:00
Zhi Huang
f2d7beb1d4 Created the DtlsSrtpTransport.
The DtlsSrtpTransport is designed to take DTLS responsibilities from BaseChannel.
DtlsSrtpTransport is responsible for exporting keys from DtlsTransport
and setting up the wrapped SrtpTransport.

The DtlsSrtpTransport is not hooked up to BaseChannel yet in this CL.

Bug: webrtc:7013
Change-Id: I318c00dadf9b1e033ec842de6e1536e9227ab713
Reviewed-on: https://webrtc-review.googlesource.com/6700
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20804}
2017-11-20 23:18:22 +00:00