Merge bug 618411. a=blocking-beta8 CLOSED TREE
authorPhilipp von Weitershausen <philipp@weitershausen.de>
Mon, 13 Dec 2010 18:14:20 -0800
changeset 59179 43a54dd56ccd5ef4dad36a69f8f8b7e6465edd46
parent 59177 cd5a2a31cb8e2ed8acbadc5959f4adcd44268eae (current diff)
parent 59178 82fb58046a619664d660045c0ce5d239943499a9 (diff)
child 59180 66036625795f9052b761d9f7f2b1ce1fe69c521b
push id17564
push userpweitershausen@mozilla.com
push dateTue, 14 Dec 2010 02:14:30 +0000
treeherdermozilla-central@43a54dd56ccd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblocking-beta8
bugs618411
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge bug 618411. a=blocking-beta8 CLOSED TREE
services/sync/modules/base_records/crypto.js
--- a/services/sync/modules/base_records/crypto.js
+++ b/services/sync/modules/base_records/crypto.js
@@ -503,17 +503,16 @@ SyncKeyBundle.prototype = {
     return this.password;
   },
 
   set keyStr(value) {
     this.password = value;
     this._hmac    = null;
     this._hmacObj = null;
     this._encrypt = null;
-    this.generateEntry();
   },
   
   /*
    * Can't rely on password being set through any of our setters:
    * Identity does work under the hood.
    * 
    * Consequently, make sure we derive keys if that work hasn't already been
    * done.
--- a/services/sync/tests/unit/test_service_sync_remoteSetup.js
+++ b/services/sync/tests/unit/test_service_sync_remoteSetup.js
@@ -47,17 +47,27 @@ function run_test() {
     Weave.Service.serverURL = "http://localhost:8080/";
     Weave.Service.clusterURL = "http://localhost:8080/";
     
     _("Checking Status.sync with no credentials.");
     Weave.Service.verifyAndFetchSymmetricKeys();
     do_check_eq(Status.sync, CREDENTIALS_CHANGED);
     do_check_eq(Status.login, LOGIN_FAILED_INVALID_PASSPHRASE);
 
-    Weave.Service.login("johndoe", "ilovejane", "abcdeabcdeabcdeabcdeabcdea");
+    _("Log in with an old secret phrase, is upgraded to Sync Key.");
+    Weave.Service.login("johndoe", "ilovejane", "my old secret phrase!!1!");
+    do_check_true(Weave.Service.isLoggedIn);
+    do_check_true(Utils.isPassphrase(Weave.Service.passphrase));
+    do_check_true(Utils.isPassphrase(Weave.Service.syncKeyBundle.keyStr));
+    let syncKey = Weave.Service.passphrase;
+    Weave.Service.startOver();
+
+    Weave.Service.serverURL = "http://localhost:8080/";
+    Weave.Service.clusterURL = "http://localhost:8080/";
+    Weave.Service.login("johndoe", "ilovejane", syncKey);
     do_check_true(Weave.Service.isLoggedIn);
 
     _("Checking that remoteSetup returns true when credentials have changed.");
     Records.get(Weave.Service.metaURL).payload.syncID = "foobar";
     do_check_true(Weave.Service._remoteSetup());
     
     _("Do an initial sync.");
     let beforeSync = Date.now()/1000;