Backed out changeset ca27bcfe3e5b (bug 1060179)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 09 Oct 2014 12:48:13 +0200
changeset 209555 1466856e52088d665a11e5a05af3e382bce38f81
parent 209554 9117adde6ff40918b285b9c41dd6cbb6f45edf18
child 209556 354abc9c4565587eb8a61a82051f7064a9fc7495
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs1060179
milestone35.0a1
backs outca27bcfe3e5bacdc5161b5f5dda77944be627bd1
Backed out changeset ca27bcfe3e5b (bug 1060179)
content/media/gmp/GMPChild.cpp
--- a/content/media/gmp/GMPChild.cpp
+++ b/content/media/gmp/GMPChild.cpp
@@ -20,31 +20,16 @@
 using mozilla::dom::CrashReporterChild;
 
 #ifdef XP_WIN
 #include <stdlib.h> // for _exit()
 #else
 #include <unistd.h> // for _exit()
 #endif
 
-#if defined(XP_WIN)
-// In order to provide EME plugins with a "device binding" capability,
-// in the parent we generate and store some random bytes as salt for every
-// (origin, urlBarOrigin) pair that uses EME. We store these bytes so
-// that every time we revisit the same origin we get the same salt.
-// We send this salt to the child on startup. The child collects some
-// device specific data and munges that with the salt to create the
-// "node id" that we expose to EME plugins. It then overwrites the device
-// specific data, and activates the sandbox.
-#define HASH_NODE_ID_WITH_DEVICE_ID 1
-#include "rlz/lib/machine_id.h"
-#include "rlz/lib/string_utils.h"
-#include "mozilla/SHA1.h"
-#endif
-
 #if defined(MOZ_SANDBOX) && defined(XP_WIN)
 #define TARGET_SANDBOX_EXPORTS
 #include "mozilla/sandboxTarget.h"
 #elif defined (MOZ_GMP_SANDBOX)
 #if defined(XP_LINUX) || defined(XP_MACOSX)
 #include "mozilla/Sandbox.h"
 #endif
 #endif
@@ -249,46 +234,18 @@ GMPChild::Init(const std::string& aPlugi
 
   mPluginPath = aPluginPath;
   return true;
 }
 
 bool
 GMPChild::RecvSetNodeId(const nsCString& aNodeId)
 {
-#ifdef HASH_NODE_ID_WITH_DEVICE_ID
-  if (!aNodeId.IsEmpty() && !aNodeId.EqualsLiteral("null")) {
-    string16 deviceId;
-    int volumeId;
-    if (!rlz_lib::GetRawMachineId(&deviceId, &volumeId)) {
-      return false;
-    }
-
-    // TODO: Switch to SHA256.
-    mozilla::SHA1Sum hash;
-    hash.update(deviceId.c_str(), deviceId.size() * sizeof(string16::value_type));
-    hash.update(aNodeId.get(), aNodeId.Length());
-    hash.update(&volumeId, sizeof(int));
-    uint8_t digest[mozilla::SHA1Sum::kHashSize];
-    hash.finish(digest);
-    if (!rlz_lib::BytesToString(digest, mozilla::SHA1Sum::kHashSize, &mNodeId)) {
-      return false;
-    }
-
-    // Overwrite device id as it could potentially identify the user, so
-    // there's no chance a GMP can read it and use it for identity tracking.
-    volumeId = 0;
-    memset(&deviceId.front(), '*', sizeof(string16::size_type) * deviceId.size());
-    deviceId = L"";
-  } else {
-    mNodeId = "null";
-  }
-#else
+  // TODO: hash mNodeId with machine specific data.
   mNodeId = std::string(aNodeId.BeginReading(), aNodeId.EndReading());
-#endif
   return true;
 }
 
 bool
 GMPChild::RecvStartPlugin()
 {
 #if defined(MOZ_SANDBOX) && defined(XP_WIN)
   mozilla::SandboxTarget::Instance()->StartSandbox();