Bug 1449732 Do not expose the local IP address via WebRTC when Resist fingerprinting is enabled r?jesup draft
authorTom Ritter <tom@mozilla.com>
Fri, 30 Mar 2018 19:58:27 -0500
changeset 775420 938371b9fc73add4b360a04877e1aaea9c04bc8d
parent 775324 34f13a87fb1bf62f52dea305384c6c7471454d2f
child 775421 6303f8a6ae3fed49c0b9206c69fdacd1f4556c56
child 775422 3978a418fd5cc1f159cab0737fa3e4e3026cf2de
push id104716
push userbmo:tom@mozilla.com
push dateSat, 31 Mar 2018 00:59:26 +0000
reviewersjesup
bugs1449732
milestone61.0a1
Bug 1449732 Do not expose the local IP address via WebRTC when Resist fingerprinting is enabled r?jesup MozReview-Commit-ID: AuN2hwwcHpj
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -445,17 +445,18 @@ PeerConnectionConfiguration::Init(const 
       MOZ_CRASH();
   }
 
   switch (aSrc.mIceTransportPolicy) {
     case dom::RTCIceTransportPolicy::Relay:
       setIceTransportPolicy(NrIceCtx::ICE_POLICY_RELAY);
       break;
     case dom::RTCIceTransportPolicy::All:
-      if (Preferences::GetBool("media.peerconnection.ice.no_host", false)) {
+      if (Preferences::GetBool("media.peerconnection.ice.no_host", false) ||
+          nsContentUtils::ShouldResistFingerprinting()) {
         setIceTransportPolicy(NrIceCtx::ICE_POLICY_NO_HOST);
       } else {
         setIceTransportPolicy(NrIceCtx::ICE_POLICY_ALL);
       }
       break;
     default:
       MOZ_CRASH();
   }