~ubuntu-branches/ubuntu/trusty/enigmail/trusty-security

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2011-08-12 12:25:06 UTC
  • mfrom: (0.12.4 upstream)
  • Revision ID: package-import@ubuntu.com-20110812122506-zko6c7zfexvyg71q
Tags: 2:1.2.1-0ubuntu1
* New upstream release
* Drop fix_install_rdf_xml_errors.diff - fixed upstream
* Refresh port_to_latest_thunderbird.diff
* Add a proper get-orig-source target which pulls the build system from
  lp:~mozillateam/mozilla-build-system/beta, now that we don't have the old
  build-system.tar.gz from xulrunner

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Evil.
2
 
let btoa = Cu.import("resource://services-sync/util.js").btoa;
3
 
 
4
 
function run_test() {
5
 
  let symmKey16 = Utils.pbkdf2Generate("secret phrase", "DNXPzPpiwn", 4096, 16);
6
 
  do_check_eq(symmKey16.length, 16);
7
 
  do_check_eq(btoa(symmKey16), "d2zG0d2cBfXnRwMUGyMwyg==");
8
 
  do_check_eq(Utils.encodeBase32(symmKey16), "O5WMNUO5TQC7LZ2HAMKBWIZQZI======");
9
 
  let symmKey32 = Utils.pbkdf2Generate("passphrase", "salt", 4096, 32);
10
 
  do_check_eq(symmKey32.length, 32);
11
 
}