Bug 306730 - Do not include the token name in prompts for the internal key slot. r=keeler
MozReview-Commit-ID: 3TPZrTQxQC5
--- a/browser/extensions/formautofill/test/unit/test_masterPassword.js
+++ b/browser/extensions/formautofill/test/unit/test_masterPassword.js
@@ -33,17 +33,17 @@ let gMockPrompter = {
// where in the context of the arrow function, |this != gMockPrompter| due to
// how objects get wrapped when going across xpcom boundaries.
promptPassword(dialogTitle, text, password, checkMsg, checkValue) {
this.numPrompts++;
if (this.numPrompts > 1) { // don't keep retrying a bad password
return false;
}
equal(text,
- "Please enter the master password for the Software Security Device.",
+ "Please enter your master password.",
"password prompt text should be as expected");
equal(checkMsg, null, "checkMsg should be null");
ok(this.passwordToTry, "passwordToTry should be non-null");
password.value = this.passwordToTry;
return true;
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIPrompt]),
--- a/security/manager/locales/en-US/chrome/pipnss/pipnss.properties
+++ b/security/manager/locales/en-US/chrome/pipnss/pipnss.properties
@@ -1,14 +1,17 @@
#
# 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/.
CertPassPrompt=Please enter the master password for the %S.
+
+CertPassPromptDefault=Please enter your master password.
+
# the following strings have special requirements:
# they must fit in a 32 or 64 byte buffer after being translated
# to UTF8. Note to translator. It's not easy for you to figure
# whether the escaped unicode string you produce will fit in
# the space allocated.
#
# 64 bytes long after conversion to UTF8
RootCertModuleName=Builtin Roots Module
--- a/security/manager/locales/en-US/chrome/pippki/pippki.properties
+++ b/security/manager/locales/en-US/chrome/pippki/pippki.properties
@@ -1,14 +1,12 @@
# 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/.
-CertPassPrompt=Please enter the Personal Security Password for the PSM Private Keys security device.
-
# LOCALIZATION NOTE(certWithSerial): Used for semi-uniquely representing a cert.
# %1$S is the serial number of the cert in AA:BB:CC hex format.
certWithSerial=Certificate with serial number: %1$S
# Download Cert dialog
# LOCALIZATION NOTE(newCAMessage1):
# %S is a string representative of the certificate being downloaded/imported.
newCAMessage1=Do you want to trust ā%Sā for the following purposes?
--- a/security/manager/ssl/nsNSSCallbacks.cpp
+++ b/security/manager/ssl/nsNSSCallbacks.cpp
@@ -783,25 +783,30 @@ PK11PasswordPromptRunnable::RunOnTargetT
return;
}
nsCOMPtr<nsINSSComponent> nssComponent(do_GetService(kNSSComponentCID));
if (!nssComponent) {
return;
}
- NS_ConvertUTF8toUTF16 tokenName(PK11_GetTokenName(mSlot));
- const char16_t* formatStrings[] = {
- tokenName.get(),
- };
nsAutoString promptString;
- rv = nssComponent->PIPBundleFormatStringFromName("CertPassPrompt",
- formatStrings,
- ArrayLength(formatStrings),
- promptString);
+ if (PK11_IsInternal(mSlot)) {
+ rv = nssComponent->GetPIPNSSBundleString("CertPassPromptDefault",
+ promptString);
+ } else {
+ NS_ConvertUTF8toUTF16 tokenName(PK11_GetTokenName(mSlot));
+ const char16_t* formatStrings[] = {
+ tokenName.get(),
+ };
+ rv = nssComponent->PIPBundleFormatStringFromName("CertPassPrompt",
+ formatStrings,
+ ArrayLength(formatStrings),
+ promptString);
+ }
if (NS_FAILED(rv)) {
return;
}
nsString password;
// |checkState| is unused because |checkMsg| (the argument just before it) is
// null, but XPConnect requires it to point to a valid bool nonetheless.
bool checkState = false;
--- a/security/manager/ssl/tests/unit/test_certDB_import_with_master_password.js
+++ b/security/manager/ssl/tests/unit/test_certDB_import_with_master_password.js
@@ -48,17 +48,17 @@ var gMockPrompter = {
// where in the context of the arrow function, |this != gMockPrompter| due to
// how objects get wrapped when going across xpcom boundaries.
promptPassword(dialogTitle, text, password, checkMsg, checkValue) {
this.numPrompts++;
if (this.numPrompts > 1) { // don't keep retrying a bad password
return false;
}
equal(text,
- "Please enter the master password for the Software Security Device.",
+ "Please enter your master password.",
"password prompt text should be as expected");
equal(checkMsg, null, "checkMsg should be null");
ok(this.passwordToTry, "passwordToTry should be non-null");
password.value = this.passwordToTry;
return true;
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIPrompt]),
--- a/security/manager/ssl/tests/unit/test_password_prompt.js
+++ b/security/manager/ssl/tests/unit/test_password_prompt.js
@@ -17,17 +17,17 @@ var gMockPrompter = {
// where in the context of the arrow function, |this != gMockPrompter| due to
// how objects get wrapped when going across xpcom boundaries.
promptPassword(dialogTitle, text, password, checkMsg, checkValue) {
this.numPrompts++;
if (this.numPrompts > 1) { // don't keep retrying a bad password
return false;
}
equal(text,
- "Please enter the master password for the Software Security Device.",
+ "Please enter your master password.",
"password prompt text should be as expected");
equal(checkMsg, null, "checkMsg should be null");
ok(this.passwordToTry, "passwordToTry should be non-null");
password.value = this.passwordToTry;
return true;
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIPrompt]),