Fix salt in client

This commit is contained in:
Gregory Soutade 2013-10-16 08:57:06 +02:00
parent 89d668df76
commit 6099b39329
2 changed files with 6 additions and 2 deletions

View File

@ -65,6 +65,11 @@ function on_sumbit()
domain = parseURI.parseUri(form.ownerDocument.baseURI);
domain = domain["host"];
salt = parseURI.parseUri(prefSet.prefs["account_url"]);
salt = salt["host"] + salt["path"];
console.log("salt " + salt);
// Get all <input type="text">
for (i=0; i<fields.length; i++)
{
@ -89,7 +94,7 @@ function on_sumbit()
continue;
mkey = password.substring(2);
mkey = pkdbf2.pkdbf2(mkey, prefSet.prefs["account_url"], 1000, 256/8);
mkey = pkdbf2.pkdbf2(mkey, salt, 1000, 256/8);
user = null;
// Subset of common user field

View File

@ -85,7 +85,6 @@ function derive_mkey(user, mkey_target)
}
url = url_domain(document.URL) + "/" + user;
mkey = a2hex(pkdbf2(mkey, url, 1000, 256/8));
mkey_target.value = mkey;