commit 2c50abdbdd215f7a84211ce70d8c75a0a6f97187 Author: Arthur Edelstein arthuredelstein@gmail.com Date: Thu May 11 13:58:24 2017 -0700
Bug 22165: Block DoListAddresses when resisting fingerprinting --- netwerk/base/NetworkInfoServiceCocoa.cpp | 6 ++++++ netwerk/base/NetworkInfoServiceLinux.cpp | 6 ++++++ netwerk/base/NetworkInfoServiceWindows.cpp | 6 ++++++ 3 files changed, 18 insertions(+)
diff --git a/netwerk/base/NetworkInfoServiceCocoa.cpp b/netwerk/base/NetworkInfoServiceCocoa.cpp index 937c726..c2d8e2c 100644 --- a/netwerk/base/NetworkInfoServiceCocoa.cpp +++ b/netwerk/base/NetworkInfoServiceCocoa.cpp @@ -17,6 +17,8 @@
#include "NetworkInfoServiceImpl.h"
+#include "nsContentUtils.h" + namespace mozilla { namespace net {
@@ -26,6 +28,10 @@ ListInterfaceAddresses(int aFd, const char* aIface, AddrMapType& aAddrMap); nsresult DoListAddresses(AddrMapType& aAddrMap) { + if (nsContentUtils::ShouldResistFingerprinting()) { + return NS_ERROR_FAILURE; + } + int fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd < 0) { return NS_ERROR_FAILURE; diff --git a/netwerk/base/NetworkInfoServiceLinux.cpp b/netwerk/base/NetworkInfoServiceLinux.cpp index 96627cf..6f72e9c 100644 --- a/netwerk/base/NetworkInfoServiceLinux.cpp +++ b/netwerk/base/NetworkInfoServiceLinux.cpp @@ -17,6 +17,8 @@
#include "NetworkInfoServiceImpl.h"
+#include "nsContentUtils.h" + namespace mozilla { namespace net {
@@ -26,6 +28,10 @@ ListInterfaceAddresses(int aFd, const char* aIface, AddrMapType& aAddrMap); nsresult DoListAddresses(AddrMapType& aAddrMap) { + if (nsContentUtils::ShouldResistFingerprinting()) { + return NS_ERROR_FAILURE; + } + int fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd < 0) { return NS_ERROR_FAILURE; diff --git a/netwerk/base/NetworkInfoServiceWindows.cpp b/netwerk/base/NetworkInfoServiceWindows.cpp index 2a9448e..9e01d81 100644 --- a/netwerk/base/NetworkInfoServiceWindows.cpp +++ b/netwerk/base/NetworkInfoServiceWindows.cpp @@ -12,12 +12,18 @@
#include "NetworkInfoServiceImpl.h"
+#include "nsContentUtils.h" + namespace mozilla { namespace net {
nsresult DoListAddresses(AddrMapType& aAddrMap) { + if (nsContentUtils::ShouldResistFingerprinting()) { + return NS_ERROR_FAILURE; + } + UniquePtr<MIB_IPADDRTABLE> ipAddrTable; DWORD size = sizeof(MIB_IPADDRTABLE);