Skip to content
Snippets Groups Projects
Commit 53121e55 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern: Committed by Richard Pospesel
Browse files

Bug 41599: Always return an empty string as network ID

Firefox computes an internal network ID used to detect network changes
and act consequently (e.g., to improve WebSocket UX).
However, there are a few ways to get this internal network ID, so we
patch them out, to be sure any new code will not be able to use them and
possibly link users.

We also sent a patch to Mozilla to seed the internal network ID, to
prevent any accidental leak in the future.
Upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=1817756
parent 67e52297
Branches
Tags base-browser-102.9.0esr-12.5-1-build1
1 merge request!580Rebase Tor Browser Alpha to 102.9.0esr
......@@ -123,11 +123,15 @@ nsAndroidNetworkLinkService::GetLinkType(uint32_t* aLinkType) {
NS_IMETHODIMP
nsAndroidNetworkLinkService::GetNetworkID(nsACString& aNetworkID) {
#ifdef BASE_BROWSER
aNetworkID.Truncate();
#else
if (!mNetlinkSvc) {
return NS_ERROR_NOT_AVAILABLE;
}
mNetlinkSvc->GetNetworkID(aNetworkID);
#endif
return NS_OK;
}
......
......@@ -50,11 +50,15 @@ nsNetworkLinkService::GetLinkType(uint32_t* aLinkType) {
NS_IMETHODIMP
nsNetworkLinkService::GetNetworkID(nsACString& aNetworkID) {
#ifdef BASE_BROWSER
aNetworkID.Truncate();
#else
if (!mNetlinkSvc) {
return NS_ERROR_NOT_AVAILABLE;
}
mNetlinkSvc->GetNetworkID(aNetworkID);
#endif
return NS_OK;
}
......
......@@ -123,8 +123,12 @@ nsNetworkLinkService::GetLinkType(uint32_t* aLinkType) {
NS_IMETHODIMP
nsNetworkLinkService::GetNetworkID(nsACString& aNetworkID) {
#ifdef BASE_BROWSER
aNetworkID.Truncate();
#else
MutexAutoLock lock(mMutex);
aNetworkID = mNetworkId;
#endif
return NS_OK;
}
......
......@@ -1875,8 +1875,12 @@ void NetlinkService::CalculateNetworkID() {
}
void NetlinkService::GetNetworkID(nsACString& aNetworkID) {
#ifdef BASE_BROWSER
aNetworkID.Truncate();
#else
MutexAutoLock lock(mMutex);
aNetworkID = mNetworkId;
#endif
}
nsresult NetlinkService::GetDnsSuffixList(nsTArray<nsCString>& aDnsSuffixList) {
......
......@@ -105,8 +105,12 @@ nsNotifyAddrListener::GetLinkType(uint32_t* aLinkType) {
NS_IMETHODIMP
nsNotifyAddrListener::GetNetworkID(nsACString& aNetworkID) {
#ifdef BASE_BROWSER
aNetworkID.Truncate();
#else
MutexAutoLock lock(mMutex);
aNetworkID = mNetworkId;
#endif
return NS_OK;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment