Bug 854881 - Remove broken Master Password support from /browser/metro [r=mbrubeck]

This commit is contained in:
Rodrigo Silveira 2013-03-27 10:34:29 -07:00
parent 28a52cac18
commit a6712deaa2
9 changed files with 0 additions and 230 deletions

View File

@ -108,7 +108,6 @@ let ScriptContexts = {};
["MenuControlUI", "chrome://browser/content/helperui/MenuUI.js"],
["MenuPopup", "chrome://browser/content/helperui/MenuUI.js"],
["IndexedDB", "chrome://browser/content/helperui/IndexedDB.js"],
["MasterPasswordUI", "chrome://browser/content/helperui/MasterPasswordUI.js"],
["OfflineApps", "chrome://browser/content/helperui/OfflineApps.js"],
["SelectHelperUI", "chrome://browser/content/helperui/SelectHelperUI.js"],
["SelectionHelperUI", "chrome://browser/content/helperui/SelectionHelperUI.js"],

View File

@ -437,8 +437,6 @@
<settings id="prefs-donottrack" label="&optionsHeader.privacy.doNotTrack.title;">
<setting pref="privacy.donottrackheader.enabled" title="&optionsHeader.privacy.doNotTrack.label;" type="bool"/>
</settings>
<setting id="prefs-master-password" title="&optionsHeader.privacy.masterPassword.label;" type="bool" oncommand="MasterPasswordUI.show(this.value);"/>
</flyoutpanel>
<!-- Form Helper form validation helper popup -->

View File

@ -1,133 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var MasterPasswordUI = {
_dialog: null,
_tokenName: "",
get _secModuleDB() {
delete this._secModuleDB;
return this._secModuleDB = Cc["@mozilla.org/security/pkcs11moduledb;1"].getService(Ci.nsIPKCS11ModuleDB);
},
get _pk11DB() {
delete this._pk11DB;
return this._pk11DB = Cc["@mozilla.org/security/pk11tokendb;1"].getService(Ci.nsIPK11TokenDB);
},
_setPassword: function _setPassword(password) {
try {
let status;
let slot = this._secModuleDB.findSlotByName(this._tokenName);
if (slot)
status = slot.status;
else
return false;
let token = this._pk11DB.findTokenByName(this._tokenName);
if (status == Ci.nsIPKCS11Slot.SLOT_UNINITIALIZED) {
token.initPassword(password);
} else if (status == Ci.nsIPKCS11Slot.SLOT_READY) {
token.changePassword("", password);
}
return true;
} catch(e) {
dump("--- MasterPasswordUI._setPassword exception: " + e + "\n");
return false;
}
},
_removePassword: function _removePassword(password) {
try {
let token = this._pk11DB.getInternalKeyToken();
if (token.checkPassword(password)) {
token.changePassword(password, "");
return true;
}
} catch(e) {
dump("--- MasterPasswordUI._removePassword exception: " + e + "\n");
}
return false;
},
show: function mp_show(aSet) {
let dialogId = aSet ? "masterpassword-change" : "masterpassword-remove";
if (document.getElementById(dialogId))
return;
let dialog = aSet ? "chrome://browser/content/prompt/masterPassword.xul"
: "chrome://browser/content/prompt/removeMasterPassword.xul";
this._dialog = DialogUI.importModal(window, dialog, null);
DialogUI.pushPopup(this, this._dialog);
if (aSet) {
this.checkPassword();
document.getElementById("masterpassword-newpassword1").focus();
} else {
document.getElementById("masterpassword-oldpassword").focus();
}
},
hide: function mp_hide(aValue) {
this.updatePreference();
this._dialog.close();
this._dialog = null;
DialogUI.popPopup(this);
},
setPassword: function mp_setPassword() {
if (!this.checkPassword())
return;
let newPasswordValue = document.getElementById("masterpassword-newpassword1").value;
if (this._setPassword(newPasswordValue)) {
this.hide();
}
},
removePassword: function mp_removePassword() {
let oldPassword = document.getElementById("masterpassword-oldpassword").value;
if (this._removePassword(oldPassword)) {
this.hide();
}
},
checkPassword: function mp_checkPassword() {
let newPasswordValue1 = document.getElementById("masterpassword-newpassword1").value;
let newPasswordValue2 = document.getElementById("masterpassword-newpassword2").value;
let buttonOk = this._dialog.getElementsByAttribute("class", "prompt-buttons")[0].firstChild;
let isPasswordValid = this._secModuleDB.isFIPSEnabled ? (newPasswordValue1 != "" && newPasswordValue1 == newPasswordValue2)
: (newPasswordValue1 == newPasswordValue2);
if (isPasswordValid) {
buttonOk.removeAttribute("disabled");
} else {
buttonOk.setAttribute("disabled", true);
}
return isPasswordValid;
},
checkOldPassword: function mp_checkOldPassword() {
let oldPassword = document.getElementById("masterpassword-oldpassword");
let buttonOk = this._dialog.getElementsByAttribute("class", "prompt-buttons")[0].firstChild;
let isPasswordValid = this._pk11DB.getInternalKeyToken().checkPassword(oldPassword.value);
buttonOk.setAttribute("disabled", !isPasswordValid);
},
hasMasterPassword: function mp_hasMasterPassword() {
let slot = this._secModuleDB.findSlotByName(this._tokenName);
if (slot) {
let status = slot.status;
return status != Ci.nsIPKCS11Slot.SLOT_UNINITIALIZED && status != Ci.nsIPKCS11Slot.SLOT_READY;
}
return false;
},
updatePreference: function mp_updatePreference() {
document.getElementById("prefs-master-password").value = this.hasMasterPassword();
}
};

View File

@ -9,7 +9,6 @@ var PreferencesPanelView = {
Elements.prefsFlyout.addEventListener("PopupChanged", function onShow(aEvent) {
if (aEvent.detail && aEvent.popup === Elements.prefsFlyout) {
Elements.prefsFlyout.removeEventListener("PopupChanged", onShow, false);
MasterPasswordUI.updatePreference();
}
}, false);
}

View File

@ -1,45 +0,0 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE dialog [
<!ENTITY % dialog SYSTEM "chrome://browser/locale/prompt.dtd">
<!ENTITY % changempDTD SYSTEM "chrome://mozapps/locale/preferences/changemp.dtd" >
%dialog;
%changempDTD;
]>
<dialog id="masterpassword-change" title="&setPassword.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<keyset>
<key keycode="VK_RETURN" command="cmd_ok"/>
<key keycode="VK_ESCAPE" command="cmd_cancel"/>
</keyset>
<commandset>
<command id="cmd_ok" oncommand="MasterPasswordUI.setPassword();"/>
<command id="cmd_cancel" oncommand="MasterPasswordUI.hide();"/>
</commandset>
<vbox class="prompt-inner">
<vbox class="prompt-header" flex="1">
<description id="masterpassword-title" class="prompt-title" crop="center" flex="1">&setPassword.title;</description>
</vbox>
<scrollbox orient="vertical" class="prompt-message" flex="1">
<label control="masterpassword-newpassword1" value="&setPassword.newPassword.label;"/>
<textbox id="masterpassword-newpassword1" type="password" oninput="MasterPasswordUI.checkPassword();" flex="1"/>
<label control="masterpassword-newpassword2" value="&setPassword.reenterPassword.label;"/>
<textbox id="masterpassword-newpassword2" type="password" oninput="MasterPasswordUI.checkPassword();" flex="1"/>
<separator/>
</scrollbox>
<hbox class="prompt-buttons">
<button class="prompt-button button-default" label="&ok.label;" command="cmd_ok"/>
<button class="prompt-button" label="&cancel.label;" command="cmd_cancel"/>
</hbox>
</vbox>
</dialog>

View File

@ -1,43 +0,0 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE dialog [
<!ENTITY % dialog SYSTEM "chrome://browser/locale/prompt.dtd">
<!ENTITY % removempDTD SYSTEM "chrome://mozapps/locale/preferences/removemp.dtd" >
%dialog;
%removempDTD;
]>
<dialog id="masterpassword-remove" title="&removePassword.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<keyset>
<key keycode="VK_RETURN" command="cmd_ok"/>
<key keycode="VK_ESCAPE" command="cmd_cancel"/>
</keyset>
<commandset>
<command id="cmd_ok" oncommand="MasterPasswordUI.removePassword();"/>
<command id="cmd_cancel" oncommand="MasterPasswordUI.hide();"/>
</commandset>
<vbox class="prompt-inner">
<vbox class="prompt-header" flex="1">
<description id="masterpassword-title" class="prompt-title" crop="center" flex="1">&removePassword.title;</description>
</vbox>
<scrollbox orient="vertical" class="prompt-message" flex="1">
<label control="masterpassword-oldpassword" value="&setPassword.oldPassword.label;"/>
<textbox id="masterpassword-oldpassword" type="password" oninput="MasterPasswordUI.checkOldPassword();" flex="1"/>
<separator/>
</scrollbox>
<hbox class="prompt-buttons">
<button class="prompt-button button-default" label="&ok.label;" disabled="true" command="cmd_ok"/>
<button class="prompt-button" label="&cancel.label;" command="cmd_cancel"/>
</hbox>
</vbox>
</dialog>

View File

@ -36,12 +36,9 @@ chrome.jar:
content/prompt/promptPassword.xul (content/prompt/promptPassword.xul)
content/prompt/select.xul (content/prompt/select.xul)
content/prompt/prompt.js (content/prompt/prompt.js)
content/prompt/masterPassword.xul (content/prompt/masterPassword.xul)
content/prompt/removeMasterPassword.xul (content/prompt/removeMasterPassword.xul)
content/helperui/AlertsHelper.js (content/helperui/AlertsHelper.js)
content/helperui/IndexedDB.js (content/helperui/IndexedDB.js)
content/helperui/MasterPasswordUI.js (content/helperui/MasterPasswordUI.js)
content/helperui/MenuUI.js (content/helperui/MenuUI.js)
content/helperui/OfflineApps.js (content/helperui/OfflineApps.js)
content/helperui/SelectHelperUI.js (content/helperui/SelectHelperUI.js)

View File

@ -24,7 +24,6 @@
<!ENTITY optionsHeader.privacy.passwords.label "Remember Passwords">
<!ENTITY optionsHeader.privacy.doNotTrack.title "Tracking">
<!ENTITY optionsHeader.privacy.doNotTrack.label "Tell websites not to track me">
<!ENTITY optionsHeader.privacy.masterPassword.label "Use Master Password">
<!-- ## Sync Flyout Panel ## -->
<!-- see sync.dtd -->

View File

@ -172,7 +172,6 @@ pref("browser.helperApps.deleteTempFileOnExit", false);
/* password manager */
pref("signon.rememberSignons", true);
pref("signon.expireMasterPassword", false);
pref("signon.SignonFileName", "signons.txt");
/* find helper */