summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/preferences/changemp.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-04-18 14:05:21 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-04-18 14:05:21 +0200
commit1ef526f0f0ea664518789c5ab73ed9de140714ad (patch)
treea9a54cd23d9a4465e0181dd212809c17745c5af6 /toolkit/mozapps/preferences/changemp.js
parent8058e08926afc5ec6528d233cf8cc5f7404dad38 (diff)
downloadUXP-1ef526f0f0ea664518789c5ab73ed9de140714ad.tar
UXP-1ef526f0f0ea664518789c5ab73ed9de140714ad.tar.gz
UXP-1ef526f0f0ea664518789c5ab73ed9de140714ad.tar.lz
UXP-1ef526f0f0ea664518789c5ab73ed9de140714ad.tar.xz
UXP-1ef526f0f0ea664518789c5ab73ed9de140714ad.zip
Strengthen the use of the Master Password.
- Use 30k iterations instead of 1. - Enforce minimum password length of 8 characters. - Adjust strength meter accordingly. This resolves #82.
Diffstat (limited to 'toolkit/mozapps/preferences/changemp.js')
-rw-r--r--toolkit/mozapps/preferences/changemp.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/toolkit/mozapps/preferences/changemp.js b/toolkit/mozapps/preferences/changemp.js
index 82dd20128..71664b3e1 100644
--- a/toolkit/mozapps/preferences/changemp.js
+++ b/toolkit/mozapps/preferences/changemp.js
@@ -167,8 +167,8 @@ function setPasswordStrength()
// length of the password
var pwlength=(pw.length);
- if (pwlength>5)
- pwlength=5;
+ if (pwlength>10)
+ pwlength=10;
// use of numbers in the password
@@ -190,7 +190,7 @@ function setPasswordStrength()
upper=3;
- var pwstrength=((pwlength*10)-20) + (numeric*10) + (numsymbols*15) + (upper*10);
+ var pwstrength=((pwlength*5)-20) + (numeric*10) + (numsymbols*15) + (upper*10);
// make sure we're give a value between 0 and 100
if ( pwstrength < 0 ) {
@@ -227,6 +227,12 @@ function checkPasswords()
}
}
+ // Never accept short passwords < 8 chars
+ if (pw1.length < 8) {
+ ok.setAttribute("disabled", "true");
+ return;
+ }
+
if (pw1 == pw2) {
ok.setAttribute("disabled", "false");
} else