Skip to content
Snippets Groups Projects
Verified Commit c10ca88e authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern: Committed by ma1
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 683e266e
No related branches found
No related tags found
1 merge request!712Bug 41908: Rebased on 102.14
......@@ -123,11 +123,15 @@ nsAndroidNetworkLinkService::GetLinkType(uint32_t* aLinkType) {
NS_IMETHODIMP
nsAndroidNetworkLinkService::GetNetworkID(nsACString& aNetworkID) {
#ifdef BASE_BROWSER_VERSION
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_VERSION
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_VERSION
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_VERSION
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_VERSION
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