From 2924bdb35fea1c13ca886b319988c1e8cd4d12f0 Mon Sep 17 00:00:00 2001 From: Sergey Galich Date: Thu, 17 Feb 2022 17:29:57 +0000 Subject: [PATCH] Bug 1653486 - Replace all non-user-facing references to "master" password. r=dimi,tgiles,preferences-reviewers Differential Revision: https://phabricator.services.mozilla.com/D138113 --- browser/base/content/browser-sync.js | 2 +- browser/base/content/nsContextMenu.js | 2 +- browser/components/BrowserGlue.jsm | 2 +- .../aboutlogins/AboutLoginsChild.jsm | 26 ++++++------ .../aboutlogins/AboutLoginsParent.jsm | 20 ++++----- .../aboutlogins/content/aboutLogins.css | 10 ++--- .../aboutlogins/content/aboutLogins.html | 2 +- .../aboutlogins/content/aboutLogins.js | 6 +-- .../aboutlogins/content/aboutLoginsUtils.js | 4 +- .../content/components/login-item.js | 20 ++++----- .../aboutlogins/tests/browser/browser.ini | 2 +- ...Password.js => browser_primaryPassword.js} | 34 +++++++-------- .../aboutlogins/tests/browser/head.js | 6 +-- .../tests/chrome/aboutlogins_common.js | 4 +- .../tests/chrome/test_login_item.html | 6 +-- .../browser_policy_disable_masterpassword.js | 6 +-- .../browser/browser_policy_masterpassword.js | 10 ++--- ...owser_policy_masterpassword_aboutlogins.js | 2 +- .../payments/content/paymentDialogWrapper.js | 6 +-- .../components/preferences/fxaPairDevice.js | 2 +- browser/components/preferences/privacy.js | 8 ++-- .../components/preferences/tests/browser.ini | 2 +- ...password.js => browser_primaryPassword.js} | 42 +++++++++---------- modules/libpref/init/all.js | 2 +- ...DB_export_pkcs12_with_primary_password.js} | 4 +- ...st_certDB_import_with_primary_password.js} | 4 +- security/manager/ssl/tests/unit/xpcshell.ini | 4 +- services/sync/modules/constants.js | 2 +- .../tests/mozmill-restart-example.ini | 2 +- .../tests/browser/browser_auth_tokens.js | 4 +- .../components/passwordmgr/LoginHelper.jsm | 20 ++++----- .../components/passwordmgr/LoginManager.jsm | 6 +-- .../passwordmgr/LoginManagerAuthPrompter.jsm | 4 +- .../passwordmgr/LoginManagerChild.jsm | 42 +++++++++---------- .../passwordmgr/LoginManagerParent.jsm | 20 ++++----- .../passwordmgr/LoginManagerPrompter.jsm | 6 +-- toolkit/components/passwordmgr/crypto-SDR.js | 18 ++++---- .../passwordmgr/nsILoginManager.idl | 12 +++--- .../passwordmgr/nsILoginManagerCrypto.idl | 10 ++--- .../passwordmgr/nsILoginManagerStorage.idl | 12 +++--- .../components/passwordmgr/storage-json.js | 14 +++---- .../passwordmgr/test/LoginTestUtils.jsm | 8 ++-- .../passwordmgr/test/browser/browser.ini | 2 +- ... browser_autocomplete_primary_password.js} | 16 +++---- .../browser_autofill_hidden_document.js | 22 +++++----- ...browser_context_menu_generated_password.js | 8 ++-- .../browser_doorhanger_form_password_edit.js | 4 +- .../browser/browser_doorhanger_toggles.js | 18 ++++---- .../passwordmgr/test/mochitest/mochitest.ini | 4 +- .../test/mochitest/pwmgr_common.js | 16 +++---- .../test/mochitest/pwmgr_common_parent.js | 6 +-- ...ter_pass.html => subtst_primary_pass.html} | 0 ...ssword.html => test_primary_password.html} | 24 +++++------ ...nManagerPrompter_getUsernameSuggestions.js | 4 +- .../test/unit/test_logins_decrypt_failure.js | 12 +++--- 55 files changed, 277 insertions(+), 277 deletions(-) rename browser/components/aboutlogins/tests/browser/{browser_masterPassword.js => browser_primaryPassword.js} (89%) rename browser/components/preferences/tests/{browser_masterpassword.js => browser_primaryPassword.js} (71%) rename security/manager/ssl/tests/unit/{test_certDB_export_pkcs12_with_master_password.js => test_certDB_export_pkcs12_with_primary_password.js} (98%) rename security/manager/ssl/tests/unit/{test_certDB_import_with_master_password.js => test_certDB_import_with_primary_password.js} (98%) rename toolkit/components/passwordmgr/test/browser/{browser_autocomplete_master_password.js => browser_autocomplete_primary_password.js} (88%) rename toolkit/components/passwordmgr/test/mochitest/{subtst_master_pass.html => subtst_primary_pass.html} (100%) rename toolkit/components/passwordmgr/test/mochitest/{test_master_password.html => test_primary_password.html} (94%) diff --git a/browser/base/content/browser-sync.js b/browser/base/content/browser-sync.js index 70163297fe2a..8bd7e0e21d2d 100644 --- a/browser/base/content/browser-sync.js +++ b/browser/base/content/browser-sync.js @@ -1223,7 +1223,7 @@ var gSync = { this.log.error(`Target ${target.id} unsuitable for send tab.`); } } - // If a master-password is enabled then it must be unlocked so FxA can get + // If a primary-password is enabled then it must be unlocked so FxA can get // the encryption keys from the login manager. (If we end up using the "sync" // fallback that would end up prompting by itself, but the FxA command route // will not) - so force that here. diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js index df85af06ef71..40dd0d3c1a95 100644 --- a/browser/base/content/nsContextMenu.js +++ b/browser/base/content/nsContextMenu.js @@ -980,7 +980,7 @@ class nsContextMenu { } showManage = true; - // Disable the fill option if the user hasn't unlocked with their master password + // Disable the fill option if the user hasn't unlocked with their primary password // or if the password field or target field are disabled. // XXX: Bug 1529025 to maybe respect signon.rememberSignons. let loginFillInfo = this.contentData?.loginFillInfo; diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm index 8da668521f86..1a08b59f2370 100644 --- a/browser/components/BrowserGlue.jsm +++ b/browser/components/BrowserGlue.jsm @@ -2828,7 +2828,7 @@ BrowserGlue.prototype = { _scheduleBestEffortUserIdleTasks() { const idleTasks = [ () => { - // Telemetry for master-password - we do this after a delay as it + // Telemetry for primary-password - we do this after a delay as it // can cause IO if NSS/PSM has not already initialized. let tokenDB = Cc["@mozilla.org/security/pk11tokendb;1"].getService( Ci.nsIPK11TokenDB diff --git a/browser/components/aboutlogins/AboutLoginsChild.jsm b/browser/components/aboutlogins/AboutLoginsChild.jsm index f79416a450c0..95e4f24a580a 100644 --- a/browser/components/aboutlogins/AboutLoginsChild.jsm +++ b/browser/components/aboutlogins/AboutLoginsChild.jsm @@ -32,7 +32,7 @@ const TELEMETRY_MIN_MS_BETWEEN_OPEN_MANAGEMENT = 5000; let gLastOpenManagementBrowserId = null; let gLastOpenManagementEventTime = Number.NEGATIVE_INFINITY; -let gMasterPasswordPromise; +let gPrimaryPasswordPromise; function recordTelemetryEvent(event) { try { @@ -144,26 +144,26 @@ class AboutLoginsChild extends JSWindowActorChild { Services.focus.setFocus(element, Services.focus.FLAG_BYKEY); }, /** - * Shows the Master Password prompt if enabled, or the + * Shows the Primary Password prompt if enabled, or the * OS auth dialog otherwise. * @param resolve Callback that is called with result of authentication. * @param messageId The string ID that corresponds to a string stored in aboutLogins.ftl. * This string will be displayed only when the OS auth dialog is used. */ - async promptForMasterPassword(resolve, messageId) { - gMasterPasswordPromise = { + async promptForPrimaryPassword(resolve, messageId) { + gPrimaryPasswordPromise = { resolve, }; that.sendAsyncMessage("AboutLogins:PrimaryPasswordRequest", messageId); - return gMasterPasswordPromise; + return gPrimaryPasswordPromise; }, fileImportEnabled: Services.prefs.getBoolPref( "signon.management.page.fileImport.enabled" ), // Default to enabled just in case a search is attempted before we get a response. - masterPasswordEnabled: true, + primaryPasswordEnabled: true, passwordRevealVisible: true, }; waivedContent.AboutLoginsUtils = Cu.cloneInto( @@ -283,8 +283,8 @@ class AboutLoginsChild extends JSWindowActorChild { case "AboutLogins:ImportReportData": this.onImportReportData(message.data); break; - case "AboutLogins:MasterPasswordResponse": - this.onMasterPasswordResponse(message.data); + case "AboutLogins:PrimaryPasswordResponse": + this.onPrimaryPasswordResponse(message.data); break; case "AboutLogins:RemaskPassword": this.onRemaskPassword(message.data); @@ -301,9 +301,9 @@ class AboutLoginsChild extends JSWindowActorChild { this.sendToContent("ImportReportData", data); } - onMasterPasswordResponse(data) { - if (gMasterPasswordPromise) { - gMasterPasswordPromise.resolve(data.result); + onPrimaryPasswordResponse(data) { + if (gPrimaryPasswordPromise) { + gPrimaryPasswordPromise.resolve(data.result); recordTelemetryEvent(data.telemetryEvent); } } @@ -314,8 +314,8 @@ class AboutLoginsChild extends JSWindowActorChild { onSetup(data) { let waivedContent = Cu.waiveXrays(this.browsingContext.window); - waivedContent.AboutLoginsUtils.masterPasswordEnabled = - data.masterPasswordEnabled; + waivedContent.AboutLoginsUtils.primaryPasswordEnabled = + data.primaryPasswordEnabled; waivedContent.AboutLoginsUtils.passwordRevealVisible = data.passwordRevealVisible; waivedContent.AboutLoginsUtils.importVisible = data.importVisible; diff --git a/browser/components/aboutlogins/AboutLoginsParent.jsm b/browser/components/aboutlogins/AboutLoginsParent.jsm index 1d0c71511e2b..e6fdb454fce4 100644 --- a/browser/components/aboutlogins/AboutLoginsParent.jsm +++ b/browser/components/aboutlogins/AboutLoginsParent.jsm @@ -61,7 +61,7 @@ XPCOMUtils.defineLazyGetter(this, "AboutLoginsL10n", () => { const ABOUT_LOGINS_ORIGIN = "about:logins"; const AUTH_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes -const MASTER_PASSWORD_NOTIFICATION_ID = "master-password-login-required"; +const PRIMARY_PASSWORD_NOTIFICATION_ID = "primary-password-login-required"; // about:logins will always use the privileged content process, // even if it is disabled for other consumers such as about:newtab. @@ -175,13 +175,13 @@ class AboutLoginsParent extends JSWindowActorParent { #createLogin(newLogin) { if (!Services.policies.isAllowed("removeMasterPassword")) { - if (!LoginHelper.isMasterPasswordSet()) { + if (!LoginHelper.isPrimaryPasswordSet()) { this.#ownerGlobal.openDialog( "chrome://mozapps/content/preferences/changemp.xhtml", "", "centerscreen,chrome,modal,titlebar" ); - if (!LoginHelper.isMasterPasswordSet()) { + if (!LoginHelper.isPrimaryPasswordSet()) { return; } } @@ -283,7 +283,7 @@ class AboutLoginsParent extends JSWindowActorParent { messageText.value, captionText.value ); - this.sendAsyncMessage("AboutLogins:MasterPasswordResponse", { + this.sendAsyncMessage("AboutLogins:PrimaryPasswordResponse", { result: isAuthorized, telemetryEvent, }); @@ -324,7 +324,7 @@ class AboutLoginsParent extends JSWindowActorParent { logins, selectedSort, syncState, - masterPasswordEnabled: LoginHelper.isMasterPasswordSet(), + primaryPasswordEnabled: LoginHelper.isPrimaryPasswordSet(), passwordRevealVisible: Services.policies.isAllowed("passwordReveal"), importVisible: Services.policies.isAllowed("profileImport") && @@ -560,13 +560,13 @@ var AboutLogins = { } if (topic == "passwordmgr-crypto-login") { - this.removeNotifications(MASTER_PASSWORD_NOTIFICATION_ID); + this.removeNotifications(PRIMARY_PASSWORD_NOTIFICATION_ID); await this._reloadAllLogins(); return; } if (topic == "passwordmgr-crypto-loginCanceled") { - this.showMasterPasswordLoginNotifications(); + this.showPrimaryPasswordLoginNotifications(); return; } @@ -686,9 +686,9 @@ var AboutLogins = { await this._sendAllLoginRelatedObjects(logins); }, - showMasterPasswordLoginNotifications() { + showPrimaryPasswordLoginNotifications() { this.showNotifications({ - id: MASTER_PASSWORD_NOTIFICATION_ID, + id: PRIMARY_PASSWORD_NOTIFICATION_ID, priority: "PRIORITY_WARNING_MEDIUM", iconURL: "chrome://browser/skin/login.svg", messageId: "about-logins-primary-password-notification-message", @@ -699,7 +699,7 @@ var AboutLogins = { }, ], }); - this.messageSubscribers("AboutLogins:MasterPasswordAuthRequired"); + this.messageSubscribers("AboutLogins:PrimaryPasswordAuthRequired"); }, showNotifications({ diff --git a/browser/components/aboutlogins/content/aboutLogins.css b/browser/components/aboutlogins/content/aboutLogins.css index 9f6df739a06e..0c96440ec996 100644 --- a/browser/components/aboutlogins/content/aboutLogins.css +++ b/browser/components/aboutlogins/content/aboutLogins.css @@ -73,17 +73,17 @@ login-item[data-editing="true"] + login-intro, visibility: hidden; } -:root:not(.master-password-auth-required) #master-password-required-overlay { +:root:not(.primary-password-auth-required) #primary-password-required-overlay { display: none; } -.master-password-auth-required > body > header, -.master-password-auth-required > body > login-list, -.master-password-auth-required > body > section { +.primary-password-auth-required > body > header, +.primary-password-auth-required > body > login-list, +.primary-password-auth-required > body > section { filter: blur(2px) } -#master-password-required-overlay { +#primary-password-required-overlay { z-index: 1; position: fixed; width: 100vw; diff --git a/browser/components/aboutlogins/content/aboutLogins.html b/browser/components/aboutlogins/content/aboutLogins.html index 74c852feba0c..ef0e02c2b0d6 100644 --- a/browser/components/aboutlogins/content/aboutLogins.html +++ b/browser/components/aboutlogins/content/aboutLogins.html @@ -47,7 +47,7 @@ -
+