From b0ea92b71b66e0030ddbc5d440cd1f28b4560994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Tue, 10 Jun 2014 19:04:56 +0200 Subject: [PATCH 1/2] Add "@_" prefix support to replace password without submit --- firefox_addon/lib/main.js | 19 +++++++++++-------- firefox_addon/package.json | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/firefox_addon/lib/main.js b/firefox_addon/lib/main.js index a99e8a2..4d51f33 100644 --- a/firefox_addon/lib/main.js +++ b/firefox_addon/lib/main.js @@ -66,7 +66,7 @@ function generate_request(domain, login, mkey) return enc; } -function ask_server(form, field, logins, domain, wdomain, mkey, salt) +function ask_server(form, field, logins, domain, wdomain, mkey, salt, submit) { mkey = pkdbf2.pkdbf2(mkey, salt, pkdbf2_level, 256/8); @@ -204,8 +204,11 @@ function ask_server(form, field, logins, domain, wdomain, mkey, salt) debug("Clear password " + clear_password); field.value = clear_password; // Remove gPass event listener and submit again with clear password - form.removeEventListener("submit", on_sumbit, true); - form.submit(); + if (submit) + { + form.removeEventListener("submit", on_sumbit, true); + form.submit(); + } } else { @@ -311,26 +314,26 @@ function on_sumbit(e) { debug(field.value); password = field.value; - if (password.indexOf("@@") != 0) + if (password.indexOf("@@") != 0 && password.indexOf("@_") != 0) continue; mkey = password.substring(2); - var ret = ask_server(form, field, logins, domain, wdomain, mkey, salt); + e.preventDefault(); + + var ret = ask_server(form, field, logins, domain, wdomain, mkey, salt, (password.indexOf("@@") == 0)); switch(ret) { case SERVER.OK: - e.preventDefault(); break; case SERVER.FAILED: if (logins !== all_logins) { - ret = ask_server(form, field, all_logins, domain, wdomain, mkey, salt); + ret = ask_server(form, field, all_logins, domain, wdomain, mkey, salt, (password.indexOf("@@") == 0)); if (ret == SERVER.OK) break; } - e.preventDefault(); break; case SERVER.RESTART_REQUEST: i = -1; // Restart loop diff --git a/firefox_addon/package.json b/firefox_addon/package.json index d19189d..b289c75 100644 --- a/firefox_addon/package.json +++ b/firefox_addon/package.json @@ -5,7 +5,7 @@ "description": "gPass : global password manager", "author": "Grégory Soutadé", "license": "GNU GPL v3", - "version": "0.4", + "version": "0.5", "preferences": [ { "name": "account_url", From 53db16b8328c934864d96062128ca063a16c0d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Tue, 10 Jun 2014 19:19:48 +0200 Subject: [PATCH 2/2] Update README.md --- firefox_addon/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firefox_addon/README.md b/firefox_addon/README.md index 381ff56..aea9d1e 100644 --- a/firefox_addon/README.md +++ b/firefox_addon/README.md @@ -23,6 +23,8 @@ The first thing to do is to populate your database (from your/a password server) When you're in a login form and you want to use gPass, type your login and fill "@@masterkey" in password field. Then submit and password will automatically be replaced by the one in the database (after addon decrypt it). +You can also type "@_masterkey" to only replace your password without submiting and manually submit. This allows to support more websites. + Technical details -----------------