~ubuntu-branches/ubuntu/trusty/enigmail/trusty-updates

« back to all changes in this revision

Viewing changes to services/sync/tests/unit/test_records_crypto_generateEntry.js

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2011-06-07 14:35:53 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: package-import@ubuntu.com-20110607143553-fbgqhhvh8g8h6j1y
Tags: 2:1.2~a2~cvs20110606t2200-0ubuntu1
* Update to latest trunk snapshot for Thunderbird beta compat

* Remove build/pgo/profileserver.py from debian/clean. The new build
  system has a target depending on this
  - update debian/clean
* Drop debian/patches/autoconf.diff, just generate this at build time
* Refresh debian/patches/build_system_dont_link_libxul.diff
* libipc seems to be renamed to libipc-pipe. Fix genxpi and chrome.manifest
  to fix this 
  - add debian/patches/ipc-pipe_rename.diff
  - update debian/patches/series
* The makefiles in extensions/enigmail/ipc have an incorrect DEPTH
  attribute. Fix this so that they can find the rest of the build system
  - add debian/patches/makefile_depth.diff
  - update debian/patches/series
* Drop debian/patches/makefile-in-empty-xpcom-fix.diff - fixed in the
  current version
* Don't register a class ID multiple times, as this breaks enigmail entirely
  - add debian/patches/dont_register_cids_multiple_times.diff
  - update debian/patches/series
* Look for the Thunderbird 5 SDK
  - update debian/rules
  - update debian/control
* Run autoconf2.13 at build time
  - update debian/rules
  - update debian/control
* Add useless mesa-common-dev build-dep, just to satisfy the build system.
  We should just patch this out entirely really, but that's for another upload
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
let atob = Cu.import("resource://services-sync/util.js").atob;
 
2
Cu.import("resource://services-sync/constants.js");
 
3
Cu.import("resource://services-sync/record.js");
 
4
 
 
5
/**
 
6
 * Testing the SHA256-HMAC key derivation process against test vectors
 
7
 * verified with the Firefox Home implementation.
 
8
 */
 
9
function run_test() {
 
10
  
 
11
  // Test the production of keys from a sync key.
 
12
  let bundle = new SyncKeyBundle(PWDMGR_PASSPHRASE_REALM, "st3fan", "q7ynpwq7vsc9m34hankbyi3s3i");
 
13
  
 
14
  // These should be compared to the results from Home, as they once were.
 
15
  let e = "14b8c09fa84e92729ee695160af6e0385f8f6215a25d14906e1747bdaa2de426";
 
16
  let h = "370e3566245d79fe602a3adb5137e42439cd2a571235197e0469d7d541b07875";
 
17
  
 
18
  // The encryption key is stored as base64 for handing off to WeaveCrypto.
 
19
  let realE = Utils.bytesAsHex(atob(bundle.encryptionKey));
 
20
  let realH = Utils.bytesAsHex(bundle.hmacKey);
 
21
  
 
22
  _("Real E: " + realE);
 
23
  _("Real H: " + realH);
 
24
  do_check_eq(realH, h);
 
25
  do_check_eq(realE, e);
 
26
}