Closed Bug 619567 Opened 14 years ago Closed 14 years ago

Passphrase/sync key entry should allow leading and trailing whitespace

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

Attachments

(1 file)

Easy to do when copying and pasting from a text file.

Putting in Backend rather than UI, because this comes down to normalizePassphrase.
Tested by clearing CollectionKeys and stomping on SyncKeyBundle, going through the post-error Update dialog and adding whitespace.

Tests pass, too.

Method for the above (in privileged Error Console):

// First: copy sync key!
Components.utils.import("resource://services-sync/service.js").Weave.Service.syncKeyBundle.keyStr = "a-abcde-abcde-abcde-abcde-abcde";
Components.utils.import("resource://services-sync/base_records/crypto.js").CollectionKeys.clear();
// Kick off sync
Attachment #497962 - Flags: review?(mconnor)
Comment on attachment 497962 [details] [diff] [review]
Strip leading and trailing whitespace. v1

Taking over from mconnor who's out.

Probably good idea to put on the 1.6.x branch as well. Thanks!
Attachment #497962 - Flags: review?(mconnor) → review+
Pushed:

1.6.x: http://hg.mozilla.org/services/fx-sync/rev/6d5db9467f9b
default: http://hg.mozilla.org/services/fx-sync/rev/b4d631a9b144
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
tested this against Minefield nightly of 2011-01-04.  pasted correct sync key in dialog for adding device, not using easy setup, added a space to the beginning and/or end of the key.  Also tested ensuring there was whitespace present in CnP

I get Wrong key error message in the UI. However, if I removed the spaces, setup accepts the key as expected.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Well, that's weird. Will take a look later.
Hmmm, it just worked on 1.6.1
... it's in m-c:

http://hg.mozilla.org/mozilla-central/rev/dbed066cf3fb

which suggests that perhaps the UI isn't calling normalizePassphrase, or a subsequent commit screwed things up.
(In reply to comment #6)
> Hmmm, it just worked on 1.6.1

=> the built-in Fx4 UI is misbehaving. That's a good lead.
(In reply to comment #7)
> which suggests that perhaps the UI isn't calling normalizePassphrase, or a
> subsequent commit screwed things up.

The built-in UI sure calls normalizePassphrase.
so this doesn't work on m-c nightly of 2010-12-21.  So, unless another check-in between when the fix here was pushed (see comment #3) and when the tested nightly was created broke this, this was never working on trunk.
Does fact that 1.6.1 has a user/pwd dialog, then a sync key dialog, but trunk has all three fields combined in one dialog have anything to do with this?
I just failed to reproduce this with a 2011-01-05 Minefield build from this morning.

Used a profile that I know is syncing with another profile. Clicked "Stop using this account", made sure no Sync add on was installed, restarted Minefield.

Set up > Don't have device > entered credentials. Put three spaces at start and end of key. No error.

Verified that Sync completed without error. Nothing in error console.

Looking in Password Manager shows my entered 26-char sync key with no hyphens or whitespace.

Tracy, would you please test with tomorrow morning's nightly, and re-close if you can't repro?
Hmmm, I was using a crufty profile when I reopened this.  Try with the MF build of 2011-01-06 with a fresh profile, this works.
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
verified on both 1.6.1 and trunk
Status: RESOLVED → VERIFIED
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: