From d4d0bdae4f4c38e10a149b987e416977b5e9c95f Mon Sep 17 00:00:00 2001 From: Dorel Luca Date: Mon, 1 Jun 2020 10:16:32 +0300 Subject: [PATCH] Backed out changeset 29a0b5a4c69f (bug 1642267) for XPCShell in toolkit/modules/tests/xpcshell/test_osKeyStore.js --- .../components/passwordmgr/LoginHelper.jsm | 1 - toolkit/components/telemetry/Events.yaml | 7 +----- toolkit/modules/OSKeyStore.jsm | 25 ++++++++----------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/toolkit/components/passwordmgr/LoginHelper.jsm b/toolkit/components/passwordmgr/LoginHelper.jsm index f223ce82d0f7..784cf7c1cc5c 100644 --- a/toolkit/components/passwordmgr/LoginHelper.jsm +++ b/toolkit/components/passwordmgr/LoginHelper.jsm @@ -1218,7 +1218,6 @@ this.LoginHelper = { object: "os_auth", method: "reauthenticate", value: result.auth_details, - extra: result.auth_details_extra, }; return { isAuthorized, diff --git a/toolkit/components/telemetry/Events.yaml b/toolkit/components/telemetry/Events.yaml index 7b62cd36c980..83b1b6128580 100644 --- a/toolkit/components/telemetry/Events.yaml +++ b/toolkit/components/telemetry/Events.yaml @@ -642,22 +642,17 @@ pwmgr: "success_disabled" is used when the feature is disabled. "success_unsupported_platform" should be set when the user attempts to authenticate on an unsupported platform. "success_no_password" should be used when the user doesn't have an OS password set. + "success_auto_admin_logon" should be used when the user has enabled the "AutoAdminLogon" registry key "fail" should be used when the user cancels the authentication prompt or an unexpected exception is encountered. The user may or may not have provided an incorrect password before cancelling. objects: [ "master_password", "os_auth", ] methods: ["reauthenticate"] - extra_keys: - auto_admin: > - If the AutoAdminLogon Windows feature is enabled. This feature disables password prompt when logging in to Windows. - require_signon: > - If the Power Settings on Windows are configured to prompt for password upon resuming from sleep. bug_numbers: - 1628029 - 1623745 - 1636729 - - 1642267 expiry_version: never notification_emails: ["loines@mozilla.com", "passwords-dev@mozilla.org", "jaws@mozilla.com"] release_channel_collection: opt-out diff --git a/toolkit/modules/OSKeyStore.jsm b/toolkit/modules/OSKeyStore.jsm index 270ef5778b23..4b9eaa71d875 100644 --- a/toolkit/modules/OSKeyStore.jsm +++ b/toolkit/modules/OSKeyStore.jsm @@ -206,27 +206,27 @@ var OSKeyStore = { unlockPromise = osReauthenticator .asyncReauthenticateUser(reauth, dialogCaption, parentWindow) .then(reauthResult => { - let auth_details_extra = {}; - if (reauthResult.length > 3) { - auth_details_extra.auto_admin = "" + !!reauthResult[2]; - auth_details_extra.require_signon = "" + !!reauthResult[3]; - } if (!reauthResult[0]) { throw new Components.Exception( "User canceled OS reauth entry", - Cr.NS_ERROR_FAILURE, - null, - auth_details_extra + Cr.NS_ERROR_FAILURE ); } let result = { authenticated: true, auth_details: "success", - auth_details_extra, }; if (reauthResult.length > 1 && reauthResult[1]) { result.auth_details += "_no_password"; } + if (reauthResult.length > 3) { + if (reauthResult[2]) { + result.auth_details += "_auto_admin_logon"; + } + if (!reauthResult[3]) { + result.auth_details += "_require_signon_disabled"; + } + } return result; }); } else { @@ -274,12 +274,7 @@ var OSKeyStore = { this._pendingUnlockPromise = null; this._isLocked = true; - return { - authenticated: false, - auth_details: "fail", - auth_details_extra: err.data.QueryInterface(Ci.nsISupports) - .wrappedJSObject, - }; + return { authenticated: false, auth_details: "fail" }; } );