From e0f8670a58d707ba240a884b40637b2293b44ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Wed, 21 Jan 2015 18:56:50 +0100 Subject: [PATCH] Add var before local variables --- firefox_addon/lib/main.js | 40 ++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/firefox_addon/lib/main.js b/firefox_addon/lib/main.js index e9027e8..c569dca 100644 --- a/firefox_addon/lib/main.js +++ b/firefox_addon/lib/main.js @@ -41,7 +41,7 @@ function a2hex(str) { var hex = ''; for (var i = 0; i < str.length; i++) { - c = str.charCodeAt(i).toString(16); + var c = str.charCodeAt(i).toString(16); if (c.length == 1) c = "0" + c; hex += c; } @@ -65,18 +65,20 @@ function notify(text, data) function generate_request(domain, login, mkey) { - v = "@@" + domain + ";" + login; + var v = "@@" + domain + ";" + login; debug("will encrypt " + v); debug("with " + a2hex(mkey)); - enc = aes.encryptLongString(v, aes.init(mkey)); + var enc = aes.encryptLongString(v, aes.init(mkey)); aes.finish(); - debug("res " + enc); + debug("res " + a2hex(enc)); return enc; } function ask_server(form, field, logins, domain, wdomain, mkey, salt, submit) { + var a, b; + mkey = pkdbf2.pkdbf2(mkey, salt, pkdbf2_level, 256/8); keys = ""; @@ -104,14 +106,14 @@ function ask_server(form, field, logins, domain, wdomain, mkey, salt, submit) // gPassRequest.addEventListener("progress", function(evt) { ; }, false); gPassRequest.addEventListener("load", function(evt) { - ciphered_password = ""; - server_pkdbf2_level = 0; - server_version = 0; + var ciphered_password = ""; + var server_pkdbf2_level = 0; + var server_version = 0; - r = this.responseText.split("\n"); + var r = this.responseText.split("\n"); debug("resp " + r); - for(a=0; a= 3) { @@ -262,20 +264,20 @@ function on_sumbit(e) var form = this; var fields = form.getElementsByTagName("input"); - domain = parseURI.parseUri(form.ownerDocument.baseURI); + var domain = parseURI.parseUri(form.ownerDocument.baseURI); domain = domain["host"]; - wdomain = wildcard_domain(domain); + var wdomain = wildcard_domain(domain); - salt = parseURI.parseUri(prefSet.prefs.account_url); + var salt = parseURI.parseUri(prefSet.prefs.account_url); salt = salt["host"] + salt["path"]; debug("salt " + salt); - user = null; - all_logins = new Array; + var user = null; + var all_logins = new Array(); // Get all && - for (i=0; i - for (i=0; i