summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-02-10 11:14:55 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-10 11:14:55 -0500
commite2ddd038719a70ec4f3ce4b467ce27f148b26373 (patch)
tree672276f51a40efb8f41a6dd67dc75ab16cadbf45 /toolkit/mozapps
parente911e0061503446ecbc3b3d35f45135ab9b999c4 (diff)
downloadUXP-e2ddd038719a70ec4f3ce4b467ce27f148b26373.tar
UXP-e2ddd038719a70ec4f3ce4b467ce27f148b26373.tar.gz
UXP-e2ddd038719a70ec4f3ce4b467ce27f148b26373.tar.lz
UXP-e2ddd038719a70ec4f3ce4b467ce27f148b26373.tar.xz
UXP-e2ddd038719a70ec4f3ce4b467ce27f148b26373.zip
Use the uuid-generator service instead of mangling a random number generator result to generate a syncGUID
Diffstat (limited to 'toolkit/mozapps')
-rw-r--r--toolkit/mozapps/extensions/internal/XPIProvider.jsm12
1 files changed, 4 insertions, 8 deletions
diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
index 613903a44..76b4e653b 100644
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -987,14 +987,10 @@ function loadManifestFromRDF(aUri, aStream) {
// Generate random GUID used for Sync.
// This was lifted from util.js:makeGUID() from services-sync.
- let rng = Cc["@mozilla.org/security/random-generator;1"].
- createInstance(Ci.nsIRandomGenerator);
- let bytes = rng.generateRandomBytes(9);
- let byte_string = [String.fromCharCode(byte) for each (byte in bytes)]
- .join("");
- // Base64 encode
- addon.syncGUID = btoa(byte_string).replace(/\+/g, '-')
- .replace(/\//g, '_');
+ let guid = Cc["@mozilla.org/uuid-generator;1"]
+ .getService(Ci.nsIUUIDGenerator)
+ .generateUUID().toString();
+ addon.syncGUID = guid;
return addon;
}