summaryrefslogtreecommitdiffstats
path: root/mobile/android/chrome/content/MasterPassword.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-04-23 15:32:23 -0400
committerMatt A. Tobin <email@mattatobin.com>2019-04-23 15:32:23 -0400
commitabe80cc31d5a40ebed743085011fbcda0c1a9a10 (patch)
treefb3762f06b84745b182af281abb107b95a9fcf01 /mobile/android/chrome/content/MasterPassword.js
parent63295d0087eb58a6eb34cad324c4c53d1b220491 (diff)
downloadUXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.gz
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.lz
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.xz
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.zip
Issue #1053 - Drop support Android and remove Fennec - Part 1a: Remove mobile/android
Diffstat (limited to 'mobile/android/chrome/content/MasterPassword.js')
-rw-r--r--mobile/android/chrome/content/MasterPassword.js67
1 files changed, 0 insertions, 67 deletions
diff --git a/mobile/android/chrome/content/MasterPassword.js b/mobile/android/chrome/content/MasterPassword.js
deleted file mode 100644
index d85fa928d..000000000
--- a/mobile/android/chrome/content/MasterPassword.js
+++ /dev/null
@@ -1,67 +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/. */
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "Snackbars", "resource://gre/modules/Snackbars.jsm");
-
-var MasterPassword = {
- pref: "privacy.masterpassword.enabled",
- _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);
- },
-
- get enabled() {
- 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;
- },
-
- setPassword: function setPassword(aPassword) {
- 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(aPassword);
- else if (status == Ci.nsIPKCS11Slot.SLOT_READY)
- token.changePassword("", aPassword);
-
- return true;
- } catch(e) {
- dump("MasterPassword.setPassword: " + e);
- }
- return false;
- },
-
- removePassword: function removePassword(aOldPassword) {
- try {
- let token = this._pk11DB.getInternalKeyToken();
- if (token.checkPassword(aOldPassword)) {
- token.changePassword(aOldPassword, "");
- return true;
- }
- } catch(e) {
- dump("MasterPassword.removePassword: " + e + "\n");
- }
- Snackbars.show(Strings.browser.GetStringFromName("masterPassword.incorrect"), Snackbars.LENGTH_LONG);
- return false;
- }
-};