Commit Graph

482 Commits

Author SHA1 Message Date
62802a1b0e Fixing possible crash due to RefCountedChannel assignment operator.
We relied on the default destructor of RefCountedChannel to destroy its
members in reverse initialization order (deleting the DTLS wrapper
before the underlying ICE channel).

However, std::vector also may use the default assignment operator, which
performs a member-wise copy in initialization order. Which results in
deleting the ICE channel before the DTLS one. This CL fixes this by
using a vector of pointers instead of structures, and uses RefCountedObject
to handle ref-counting.

BUG=chromium:672951

Review-Url: https://codereview.webrtc.org/2571683004
Cr-Commit-Position: refs/heads/master@{#15583}
2016-12-14 00:38:46 +00:00
7af91ddd6b Removing "crypto_required" from MediaContentDescription.
"Crypto required" is a property of the PeerConnection of construction
time; it has nothing to do with SDP. So I'm moving it out of
MediaContentDescription and putting it in the BaseChannel constructor
instead. This is more intuitive, and provides the added assurance that
"secure_required_" can't be flipped from "true" to "false".

BUG=None

Review-Url: https://codereview.webrtc.org/2537343003
Cr-Commit-Position: refs/heads/master@{#15579}
2016-12-13 19:29:16 +00:00
b68cc75f19 ParseCandidate(): Refactor to fix memcheck false positive.
Also make supported protocols explicit in check.

Fix inconsistency where TLS_PROTOCOL_NAME was not exported.

BUG=webrtc:6885

Review-Url: https://codereview.webrtc.org/2570803003
Cr-Commit-Position: refs/heads/master@{#15577}
2016-12-13 18:33:47 +00:00
277b250936 Refactor "secure bool" into explicit PROTO_TLS.
BUG=none

Review-Url: https://codereview.webrtc.org/2568833002
Cr-Commit-Position: refs/heads/master@{#15572}
2016-12-13 13:17:31 +00:00
6de92f9255 Don't allow changing ICE pool size after SetLocalDescription.
This was the decision at IETF 97
(see: https://github.com/rtcweb-wg/jsep/issues/381). It's simpler to not
allow this (since there's no real need for it) rather than try to decide
complex rules for it.

BUG=webrtc:6864

Review-Url: https://codereview.webrtc.org/2566833002
Cr-Commit-Position: refs/heads/master@{#15559}
2016-12-13 02:49:40 +00:00
25ed435afe Implement parsing/serialization of a=bundle-only.
This CL doesn't start *using* a=bundle-only; it just adds support for
parsing it. We need to do this first, because otherwise old versions of
WebRTC will interpret a zero port value as a rejected m= section.

BUG=webrtc:4674

Review-Url: https://codereview.webrtc.org/2562183002
Cr-Commit-Position: refs/heads/master@{#15558}
2016-12-13 02:37:41 +00:00
d1a38b591d Implement the "needs-ice-restart" logic for SetConfiguration.
Changing the configuration will cause subsequently generated offers to change
the ufrag/pwd as necessary, so that a new round of gathering is started that
uses the new configuration.

This CL also makes some minor unrelated changes: changing the reference SDP in
the PC tests to more match what we generate, and relaxing the network thread
requirement for JsepTransport (since there's no reason the "needs-ice-restart"
flag can't be accessed from the signaling thread).

BUG=webrtc:6714

Review-Url: https://codereview.webrtc.org/2563153002
Cr-Commit-Position: refs/heads/master@{#15527}
2016-12-10 21:15:39 +00:00
49f34fdd23 Relanding: Refactoring that removes P2PTransport and DtlsTransport classes.
Their base class, Transport, still exists, but it now has a more specific
role: a helper class that applies TransportDescriptions. And is renamed
to JsepTransport as a result.

TransportController is now the entity primarily responsible for managing
TransportChannels. It also starts storing pointers to the DTLS and ICE
chanels separately, which will make it easier to remove
TransportChannel/TransportChannelImpl in a subsequent CL.

BUG=None

Review-Url: https://codereview.webrtc.org/2517883002
Cr-Commit-Position: refs/heads/master@{#15453}
2016-12-07 00:22:11 +00:00
57fd7263d1 Revert of Refactoring that removes P2PTransport and DtlsTransport classes. (patchset #9 id:150001 of https://codereview.webrtc.org/2517883002/ )
Reason for revert:
Deletion of transport.h broke downstream builds.

Going to reland with transport.h containing enums/etc.

Original issue's description:
> Refactoring that removes P2PTransport and DtlsTransport classes.
>
> Their base class, Transport, still exists, but it now has a more specific
> role: a helper class that applies TransportDescriptions. And is renamed
> to JsepTransport as a result.
>
> TransportController is now the entity primarily responsible for managing
> TransportChannels. It also starts storing pointers to the DTLS and ICE
> chanels separately, which will make it easier to remove
> TransportChannel/TransportChannelImpl in a subsequent CL.
>
> BUG=None
>
> Committed: https://crrev.com/bd28681d02dee8c185aeb39207e8154f0ad14a37
> Cr-Commit-Position: refs/heads/master@{#15450}

TBR=pthatcher@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=None

Review-Url: https://codereview.webrtc.org/2553043004
Cr-Commit-Position: refs/heads/master@{#15452}
2016-12-06 23:29:07 +00:00
bd28681d02 Refactoring that removes P2PTransport and DtlsTransport classes.
Their base class, Transport, still exists, but it now has a more specific
role: a helper class that applies TransportDescriptions. And is renamed
to JsepTransport as a result.

TransportController is now the entity primarily responsible for managing
TransportChannels. It also starts storing pointers to the DTLS and ICE
chanels separately, which will make it easier to remove
TransportChannel/TransportChannelImpl in a subsequent CL.

BUG=None

Review-Url: https://codereview.webrtc.org/2517883002
Cr-Commit-Position: refs/heads/master@{#15450}
2016-12-06 22:56:26 +00:00
b4af3d673a Remove all references to GYP
Remove all .gyp and .gypi files.
Remove entries from OWNERS files for *.isolate, *.gyp, *.gypi
Remove unused scripts in webrtc/build.

BUG=webrtc:6323
R=henrika@webrtc.org, phoglund@webrtc.org

Review URL: https://codereview.webrtc.org/2509703002 .

Cr-Commit-Position: refs/heads/master@{#15107}
2016-11-16 19:11:38 +00:00
a3095d001b Re-enable the P2PTransportChannelMultihomedTest.TestBasic
BUG=webrtc:2409

Review-Url: https://codereview.webrtc.org/2485963002
Cr-Commit-Position: refs/heads/master@{#15030}
2016-11-10 21:59:50 +00:00
6bedebfb7a First step in providing a UdpTransportChannel.
Some applications explicitly require RFC3550 style RTP without ICE.
Port number requirement of RFC3550 section 11 will be addressed in a follow-up CL.

BUG=webrtc:6436

Review-Url: https://codereview.webrtc.org/2377883003
Cr-Commit-Position: refs/heads/master@{#15005}
2016-11-09 21:44:13 +00:00
7252a00b9f Ping the premier connection on each network with higher priority.
When the selected connection becomes not receiving and there are many connections,
If we use a round-robin fashion to ping all connections, none of the connections will
be in receiving state for sufficient long time to ensure switching connections promptly.
Triggered check will help in this situation to some extent but it may still fail to switch promptly when there are a lot of connections.

With this CL, if the selected connection is weak, once we find a writable connection on a network we start to ping it with a higher priority to keep it in receiving state.
Plus, if the selected connection is weak, we choose a shorter ping interval (900ms) for all writable connections.

BUG=b/32022719

Review-Url: https://codereview.webrtc.org/2369963004
Cr-Commit-Position: refs/heads/master@{#14991}
2016-11-09 04:04:14 +00:00
aca3a249c3 Moving stun_prober target from webrtc/p2p to webrtc/examples
BUG=webrtc:6440
NOTRY=True

Review-Url: https://codereview.webrtc.org/2460343002
Cr-Commit-Position: refs/heads/master@{#14869}
2016-11-01 10:09:19 +00:00
15ca8f6aeb Let receiving() and SignalRecevingState be part of rtc::PacketTransportInterface.
Writable() and the related signal are already part of rtc::PacketTransportInterface. Sense of code symmetry aesthetics dictates that receiving() and the related signal should be declared in the same place.

BUG=webrtc:6531

Review-Url: https://codereview.webrtc.org/2444793003
Cr-Commit-Position: refs/heads/master@{#14865}
2016-11-01 08:47:48 +00:00
6ceab08322 GN: New conventions, default target and refactorings
Introduce a convention on categorizing GN targets:
1. Production code
2. Tests
3. Examples
4. Tools
The first two have targets spread out all over the tree,
while the latter are isolated to examples/ and tools/ directories.

Another new convention: Each directory's BUILD.gn file shall contain
a target named similar to the directory name. This target shall
contain the 'most common' production code, i.e. so that most
consumers of the directory can depend on only the directory
(which implicitly means that target in GN).

//webrtc:webrtc_tests is changed to depend on all WebRTC tests.
From now on, it's necessary to add new test targets to this dependency
tree in order to get them compiled.

Two new group targets are created:
//webrtc/modules/audio_coding:audio_coding_tests
//webrtc/modules/audio_processing:audio_processing_tests
to reduce the long list of tests in //webrtc:webrtc_tests.

Visibility on //webrtc:webrtc and  //webrtc:webrtc_tests is restricted
to the root target, to avoid circular dependencies due to the monolithic
property of these targets (a problem we've had in the past).

The 'root' target at the top level is renamed to 'default', which means GN will
build this target instead of _all_ generated targets
(see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default).
This target now depends on everything we want to build, meaning all targets now
explicitly needs to be wired up from the root target in order to get build.
Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build.

BUG=webrtc:6440
TESTED=git cl try --clobber
NOTRY=True

Review-Url: https://codereview.webrtc.org/2441383002
Cr-Commit-Position: refs/heads/master@{#14821}
2016-10-28 12:44:07 +00:00
9922016ee4 Fix "IsLoopbackIp" to cover all loopback addresses; not just 127.0.0.1.
The loopback range is 127.0.0.0/8, which is everything from 127.0.0.0 to
127.255.255.255.

BUG=chromium:649118

Review-Url: https://codereview.webrtc.org/2445933003
Cr-Commit-Position: refs/heads/master@{#14807}
2016-10-28 01:30:28 +00:00
a73df559d6 Do not rely on specific ordering on generated candidates in TestGetAllPortsPortRange
This fixes another WebRTC swarming tests.

BUG=webrtc:6500

Review-Url: https://codereview.webrtc.org/2450983002
Cr-Commit-Position: refs/heads/master@{#14804}
2016-10-27 18:44:24 +00:00
d89ab145cd Introduce rtc::PacketTransportInterface and let cricket::TransportChannel inherit.
Introduce rtc::PacketTransportInterface. Refactor cricket::TransportChannel.
Fix signal slots parameter types in all related code.

BUG=webrtc:6531

Review-Url: https://codereview.webrtc.org/2416023002
Cr-Commit-Position: refs/heads/master@{#14778}
2016-10-25 17:50:41 +00:00
57e13defc7 Minor cleanup of rtc::BasicPacketSocketFactory implementation.
Remove unnecessary rtc:: namespace prefixes. Add #include <string>.

BUG=None

Review-Url: https://codereview.webrtc.org/2427413004
Cr-Commit-Position: refs/heads/master@{#14777}
2016-10-25 17:15:14 +00:00
af1ae310ef Remove dead dependencies on xmllite and xmpp.
media/ and p2p/ doesn't actually depend on these anymore.

BUG=webrtc:5539
NOTRY=True

Review-Url: https://codereview.webrtc.org/2447533003
Cr-Commit-Position: refs/heads/master@{#14761}
2016-10-25 08:27:17 +00:00
e58d73d23e Fix more swarming test failures by using the fake clock or longer timeout.
In the swarming test, the machines sometimes were blocked for 1-2 seconds without processing anything.
This CL makes sure that 1 second timeout is only used with fake clock.

BUG=webrtc:6500

Review-Url: https://codereview.webrtc.org/2442813002
Cr-Commit-Position: refs/heads/master@{#14756}
2016-10-24 23:38:31 +00:00
fb70b45030 Preventing TURN redirects to loopback addresses.
This can be used for a certain security exploit, and doesn't have any
other practical applications we know of.

BUG=chromium:649118

Review-Url: https://codereview.webrtc.org/2440043004
Cr-Commit-Position: refs/heads/master@{#14751}
2016-10-24 20:16:07 +00:00
161a586b45 Fix some flaky tests by using longer timeout and/or fake clock.
Also use const variables for timeout values.

BUG=webrtc:6500
R=deadbeef@webrtc.org

Review URL: https://codereview.webrtc.org/2431473004 .

Cr-Commit-Position: refs/heads/master@{#14711}
2016-10-20 18:47:19 +00:00
a9c7cfac41 Prepare for introduction of rtc::PacketTransportInterface.
A rtc::PacketTransportInterface typedef is introduced to allow preparing
downstream projects for the upcoming refactoring of
cricket::Transport. This refactoring will introduce
rtc::PacketTransportInterface in https://codereview.webrtc.org/2416023002/ .

BUG=webrtc:6531

Review-Url: https://codereview.webrtc.org/2429803002
Cr-Commit-Position: refs/heads/master@{#14672}
2016-10-18 22:38:43 +00:00
1203066236 Compilerwarning possible loss of data in file port.h
BUG=webrtc:6179

Review-Url: https://codereview.webrtc.org/2224323002
Cr-Commit-Position: refs/heads/master@{#14671}
2016-10-18 21:00:06 +00:00
27c3d5b652 Restore thread name consistency for webrtc/p2p/ .
Thread variables were named worker_thread, while they actually
reference the network_thread introduced with the CLs below.

Original introduction of network_thread:
https://codereview.webrtc.org/1895813003
https://codereview.webrtc.org/1903393004

Renming of woker_thread_ to network_thread_ in P2PTransportChannel:
https://codereview.webrtc.org/2378573003

BUG=webrtc:6432

Review-Url: https://codereview.webrtc.org/2396513003
Cr-Commit-Position: refs/heads/master@{#14646}
2016-10-17 07:55:03 +00:00
e40a7ee007 GN: Exclude suppressions of Chromium Clang warnings for Chromium builds.
These suppressions are causing GN errors when Chromium targets are depending
directly on WebRTC targets (needed for https://codereview.chromium.org/2413103004)

BUG=webrtc:4256
NOTRY=True

Review-Url: https://codereview.webrtc.org/2408133008
Cr-Commit-Position: refs/heads/master@{#14644}
2016-10-17 06:56:20 +00:00
716978d075 Revert of Prune connections based on network name. (patchset #3 id:130001 of https://codereview.webrtc.org/2395243005/ )
Reason for revert:
Breaks upstream code.

Original issue's description:
> Prune connections based on network name.
> Previously we prune connections on the same network pointer.
> So if an IPv6 and an IPv4 network are on the same network interface, IPv4 connection won't be pruned even if an IPv6 connection with higher priority becomes writable.
>
> With this change, as long as one connection becomes writable, all connections  having lower priority with the same network name will be pruned.
>
> Also simplify the implementation.
>
> BUG=webrtc:6512
>
> Committed: https://crrev.com/aae2784c1fab9d1510393dec15d76caa574e2da8
> Cr-Commit-Position: refs/heads/master@{#14593}

TBR=skvlad@webrtc.org,honghaiz@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6512

Review-Url: https://codereview.webrtc.org/2412433003
Cr-Commit-Position: refs/heads/master@{#14601}
2016-10-11 13:43:36 +00:00
aae2784c1f Prune connections based on network name.
Previously we prune connections on the same network pointer.
So if an IPv6 and an IPv4 network are on the same network interface, IPv4 connection won't be pruned even if an IPv6 connection with higher priority becomes writable.

With this change, as long as one connection becomes writable, all connections  having lower priority with the same network name will be pruned.

Also simplify the implementation.

BUG=webrtc:6512

Review-Url: https://codereview.webrtc.org/2395243005
Cr-Commit-Position: refs/heads/master@{#14593}
2016-10-10 23:00:49 +00:00
d93f50cd57 Add UMA metrics for ICE regathering reasons.
BUG=webrtc:6462
R=deadbeef@webrtc.org

Review URL: https://codereview.webrtc.org/2386783002 .

Cr-Commit-Position: refs/heads/master@{#14531}
2016-10-05 18:47:39 +00:00
3d7901d1bd Delete httpportallocator.h.
BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2392913002
Cr-Commit-Position: refs/heads/master@{#14516}
2016-10-05 07:46:49 +00:00
dd7fb43f28 Emit SignalReadyToSend even for "presumed writable" connections.
The Connection class will now blindly forward SignalReadyToSend, and
P2PTransportChannel will decide whether to forward it further (which
it was already doing).

BUG=webrtc:6448

Review-Url: https://codereview.webrtc.org/2374183005
Cr-Commit-Position: refs/heads/master@{#14462}
2016-09-30 22:16:57 +00:00
89824f6fe0 Relanding: Allow the DTLS fingerprint verification to occur after the handshake.
This means the DTLS handshake can make progress while the SDP answer
containing the fingerprint is still in transit. If the signaling path
if significantly slower than the media path, this can have a moderate
impact on call setup time.

Of course, until the fingerprint is verified no media can be sent. Any
attempted write will result in SR_BLOCK.

This essentially fulfills the requirements of RFC 4572, Section 6.2:

   Note that when the offer/answer model is being used, it is possible
   for a media connection to outrace the answer back to the offerer.
   Thus, if the offerer has offered a 'setup:passive' or 'setup:actpass'
   role, it MUST (as specified in RFC 4145 [2]) begin listening for an
   incoming connection as soon as it sends its offer.  However, it MUST
   NOT assume that the data transmitted over the TLS connection is valid
   until it has received a matching fingerprint in an SDP answer.  If
   the fingerprint, once it arrives, does not match the client's
   certificate, the server endpoint MUST terminate the media connection
   with a bad_certificate error, as stated in the previous paragraph.

BUG=webrtc:6387

Review-Url: https://codereview.webrtc.org/2163683003
Cr-Commit-Position: refs/heads/master@{#14461}
2016-09-30 18:55:49 +00:00
b73d269707 Replace RelayPort with TurnPort in p2ptransportchannel tests.
Also remove the relay servers in the tests.
Most of the code and the downstream apps are using TurnPort, not RelayPort. Most of the tests in this file are not using RelayPort anyway.

BUG=None
R=deadbeef@webrtc.org

Review URL: https://codereview.webrtc.org/2380923002 .

Committed: https://crrev.com/c8d21712dde64c7d613d1ea56c840438505a909f
Cr-Original-Commit-Position: refs/heads/master@{#14441}
Cr-Commit-Position: refs/heads/master@{#14446}
2016-09-30 05:46:16 +00:00
75f6626718 Revert of Replace RelayPort with TurnPort in p2ptransportchannel tests. (patchset #2 id:40001 of https://codereview.webrtc.org/2380923002/ )
Reason for revert:
It caused some tests in p2ptransportchannel flaky.

Original issue's description:
> Replace RelayPort with TurnPort in p2ptransportchannel tests.
>
> Also remove the relay servers in the tests.
> Most of the code and the downstream apps are using TurnPort, not RelayPort. Most of the tests in this file are not using RelayPort anyway.
>
> BUG=None
> R=deadbeef@webrtc.org
>
> Committed: https://crrev.com/c8d21712dde64c7d613d1ea56c840438505a909f
> Cr-Commit-Position: refs/heads/master@{#14441}

TBR=deadbeef@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=None

Review-Url: https://codereview.webrtc.org/2385563002
Cr-Commit-Position: refs/heads/master@{#14443}
2016-09-30 01:17:36 +00:00
c8d21712dd Replace RelayPort with TurnPort in p2ptransportchannel tests.
Also remove the relay servers in the tests.
Most of the code and the downstream apps are using TurnPort, not RelayPort. Most of the tests in this file are not using RelayPort anyway.

BUG=None
R=deadbeef@webrtc.org

Review URL: https://codereview.webrtc.org/2380923002 .

Cr-Commit-Position: refs/heads/master@{#14441}
2016-09-29 21:51:36 +00:00
0fd22ef0ae Rename P2PTransportChannel worker_thread_ to network_thread_.
Restore consistency of thread names in ThreadController and P2PTransportChannel.
This is a follow-up for https://codereview.webrtc.org/1895813003 and https://codereview.webrtc.org/1903393004.

BUG=webrtc:6432

Review-Url: https://codereview.webrtc.org/2378573003
Cr-Commit-Position: refs/heads/master@{#14426}
2016-09-29 08:19:28 +00:00
de2920cb46 Delete unused file sessionid.h.
BUG=None.

Review-Url: https://codereview.webrtc.org/2370723002
Cr-Commit-Position: refs/heads/master@{#14387}
2016-09-27 06:28:51 +00:00
b62dbbe985 GN: Change rtc_source_set targets --> rtc_static_library
This changes most non-test related rtc_source_set targets to be
rtc_static_library instead. Targets without any .cc files are excluded.
This should bring back the build behavior we used to have with GYP
(i.e. same symbols exported in the libjingle_peerconnection.a file, which
are used by some downstream projects).

After doing an Android build with these changes:
$ nm --defined-only -g -C out/Release/lib.unstripped/libjingle_peerconnection_so.so | grep -i createpeerconnectionf
00077c51 T Java_org_webrtc_PeerConnectionFactory_nativeCreatePeerConnectionFactory
$ nm --defined-only -g -C out/Release/obj/webrtc/api/libjingle_peerconnection.a | grep -i createpeerconnectionf
00000001 T webrtc::CreatePeerConnectionFactory(rtc::Thread*, rtc::Thread*, rtc::Thread*, webrtc::AudioDeviceModule*, cricket::WebRtcVideoEncoderFactory*, cricket::WebRtcVideoDecoderFactory*)
00000001 T webrtc::CreatePeerConnectionFactory()

See https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/cookbook.md#Note-on-static-libraries
for more details on this.

NOTICE: This should be further cleaned up in the future, to reduce
binary bloat and unnecessary linking time. Right now it's more
important to restore the desired build output though.

BUG=webrtc:6410, chromium:630755

Review-Url: https://codereview.webrtc.org/2361623004
Cr-Commit-Position: refs/heads/master@{#14364}
2016-09-23 07:38:58 +00:00
3e02430587 Fix a stun attribute leak.
In https://cs.chromium.org/chromium/src/third_party/webrtc/p2p/base/stun.cc?rcl=1474384719&l=352,
if read returned false, the created attr would not be released.

BUG=chromium:648064
R=skvlad@webrtc.org

Review URL: https://codereview.webrtc.org/2357733002 .

Cr-Commit-Position: refs/heads/master@{#14357}
2016-09-22 16:52:30 +00:00
02bd5125e9 Remove dead code branches from P2PtransportChannel unittest.
BUG=None

Review-Url: https://codereview.webrtc.org/2318173002
Cr-Commit-Position: refs/heads/master@{#14299}
2016-09-20 07:23:33 +00:00
81f6f4fc56 Revert of Allow the DTLS fingerprint verification to occur after the handshake. (patchset #11 id:200001 of https://codereview.webrtc.org/2163683003/ )
Reason for revert:
Broke a downstream user of SSLStreamAdapter. Need to add the new interface (returning error code instead of bool) in a backwards compatible way.

Original issue's description:
> Allow the DTLS fingerprint verification to occur after the handshake.
>
> This means the DTLS handshake can make progress while the SDP answer
> containing the fingerprint is still in transit. If the signaling path
> if significantly slower than the media path, this can have a moderate
> impact on call setup time.
>
> Of course, until the fingerprint is verified no media can be sent. Any
> attempted write will result in SR_BLOCK.
>
> This essentially fulfills the requirements of RFC 4572, Section 6.2:
>
>    Note that when the offer/answer model is being used, it is possible
>    for a media connection to outrace the answer back to the offerer.
>    Thus, if the offerer has offered a 'setup:passive' or 'setup:actpass'
>    role, it MUST (as specified in RFC 4145 [2]) begin listening for an
>    incoming connection as soon as it sends its offer.  However, it MUST
>    NOT assume that the data transmitted over the TLS connection is valid
>    until it has received a matching fingerprint in an SDP answer.  If
>    the fingerprint, once it arrives, does not match the client's
>    certificate, the server endpoint MUST terminate the media connection
>    with a bad_certificate error, as stated in the previous paragraph.
>
> BUG=webrtc:6387
> R=mattdr@webrtc.org, pthatcher@webrtc.org
>
> Committed: https://crrev.com/042041bf9585f92e962387c59ca805f1218338f9
> Cr-Commit-Position: refs/heads/master@{#14296}

TBR=pthatcher@webrtc.org,mattdr@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6387

Review-Url: https://codereview.webrtc.org/2352863003
Cr-Commit-Position: refs/heads/master@{#14298}
2016-09-20 00:21:00 +00:00
c67e0f5753 Signal to remove remote candidates if ports are pruned.
Previously when a Turn port is pruned, if its candidate has been sent to the remote side, the remote side will keep the candidate and use that to create connections.
We now signal the remote side to remove the candidates so that at least no new connection will be created using the removed candidates.

Also updated the virtual socket server to better support our test cases.
1. Allow the virtual socket server to set transit delay for packets sent from a given IP address.
2. Ensure the ordered packet delivery for each socket (Previously the delivery order is enforced on the whole test case, so if a udp packet gets delayed based on its IP address, all TCP packets sent after the UDP packet will be delayed at least until the UDP packet is received).

BUG=webrtc:6380
R=deadbeef@webrtc.org, pthatcher@webrtc.org, skvlad@webrtc.org

Review URL: https://codereview.webrtc.org/2261523004 .

Cr-Commit-Position: refs/heads/master@{#14297}
2016-09-19 23:57:48 +00:00
042041bf95 Allow the DTLS fingerprint verification to occur after the handshake.
This means the DTLS handshake can make progress while the SDP answer
containing the fingerprint is still in transit. If the signaling path
if significantly slower than the media path, this can have a moderate
impact on call setup time.

Of course, until the fingerprint is verified no media can be sent. Any
attempted write will result in SR_BLOCK.

This essentially fulfills the requirements of RFC 4572, Section 6.2:

   Note that when the offer/answer model is being used, it is possible
   for a media connection to outrace the answer back to the offerer.
   Thus, if the offerer has offered a 'setup:passive' or 'setup:actpass'
   role, it MUST (as specified in RFC 4145 [2]) begin listening for an
   incoming connection as soon as it sends its offer.  However, it MUST
   NOT assume that the data transmitted over the TLS connection is valid
   until it has received a matching fingerprint in an SDP answer.  If
   the fingerprint, once it arrives, does not match the client's
   certificate, the server endpoint MUST terminate the media connection
   with a bad_certificate error, as stated in the previous paragraph.

BUG=webrtc:6387
R=mattdr@webrtc.org, pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/2163683003 .

Cr-Commit-Position: refs/heads/master@{#14296}
2016-09-19 23:02:35 +00:00
e5835f5d84 Adding an end-to-end connection time test.
The test uses a fake clock and simulates network and signaling delays in
order to get a repeatable measurement of the time to establish a
connection (including DTLS). This will help ensure that various
optimizations continue to work as expected, and no new delays are
introduced.

This CL depends on: https://codereview.webrtc.org/2140283002/

R=honghaiz@webrtc.org, pthatcher@webrtc.org, skvlad@webrtc.org

Review URL: https://codereview.webrtc.org/2141863003 .

Cr-Commit-Position: refs/heads/master@{#14270}
2016-09-16 22:07:58 +00:00
9ecb08576e Adding logs to track potential cause of not starting port allocation.
R=deadbeef@webrtc.org, pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/2324853002 .

Cr-Commit-Position: refs/heads/master@{#14244}
2016-09-15 23:41:12 +00:00
705ecc5dda GN: Change group deps to public_deps.
During GN vs GYP auditing it was discovered that some
GN targets that had public_configs were not exposing them
to dependents where the dependent depended on a group, which
in turn included that target as a dependency. Instead of
changing those public_configs to all_dependent_configs
(which would be a change from GYP), it's better to just change
those group targets to use public_deps instead.

BUG=webrtc:6323
NOTRY=True
TESTED=Generated GYP and GN project files on Mac and ran the
tools/gyp_flag_compare.py script before and after this patch was
applied. The file in question used for inspection was the
webrtc/api/webrtcsessiondescriptionfactory.cc
which is a part of the libjingle_peerconnection target.

Review-Url: https://codereview.webrtc.org/2344623002
Cr-Commit-Position: refs/heads/master@{#14222}
2016-09-15 07:53:34 +00:00
d5fff5040c Removing assert error when we fail to create a connection for a ping from an unknown address.
It may happen in some legitimate scenarios.
For example a turn port may have had a refresh request timeout, so it won't create a new connection for a ping from an unknown address.

R=deadbeef@webrtc.org

Review URL: https://codereview.webrtc.org/2327233002 .

Cr-Commit-Position: refs/heads/master@{#14173}
2016-09-10 03:48:08 +00:00