Fix for Bug 90641 Checking in for Rangan Sen

r=ddrinan, sr=hewitt

Fix the title for certificate expired/certificate not yet valid dialog
This commit is contained in:
javi%netscape.com 2001-08-02 00:12:14 +00:00
parent e1abe2c919
commit 70eb7611bd
5 changed files with 13 additions and 2 deletions

View File

@ -35,6 +35,8 @@ function onLoad()
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock); pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock); dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var title = dialogParams.GetString(2);
window.title = title;
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties"); var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var message1 = dialogParams.GetString(1); var message1 = dialogParams.GetString(1);

View File

@ -21,7 +21,7 @@
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd"> <!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window <window
id="serverCertExpired" title="&serverCertExpired.title;" id="serverCertExpired"
xmlns:html="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
debug="false" debug="false"

View File

@ -68,7 +68,6 @@
<!ENTITY examineCert.label "View Certificate"> <!ENTITY examineCert.label "View Certificate">
<!-- Strings for the Server cert expired dialog --> <!-- Strings for the Server cert expired dialog -->
<!ENTITY serverCertExpired.title "Security Error: Security Certificate Expired">
<!ENTITY serverCertExpired.continue "Would you like to continue anyway?"> <!ENTITY serverCertExpired.continue "Would you like to continue anyway?">
<!-- Strings for the SSL client auth ask dialog --> <!-- Strings for the SSL client auth ask dialog -->

View File

@ -42,7 +42,9 @@ mismatchDomainMsg2=If you suspect the certificate shown does not belong to "%S",
#Server Cert expired #Server Cert expired
serverCertExpiredMsg1="%S" is a site that uses a security certificate to encrypt data during transmission, but its certificate expired on %S. serverCertExpiredMsg1="%S" is a site that uses a security certificate to encrypt data during transmission, but its certificate expired on %S.
serverCertExpiredTitle=Server Certificate Expired
serverCertNotYetValedMsg1="%S" is a site that uses a security certificate to encrypt data during transmission, but its certificate will not be valid until %S. serverCertNotYetValedMsg1="%S" is a site that uses a security certificate to encrypt data during transmission, but its certificate will not be valid until %S.
serverCertNotYetValidTitle=Server Certificate Not Yet Valid
serverCertExpiredMsg2=You should check to make sure that your computer's time (currently set to %S) is correct. serverCertExpiredMsg2=You should check to make sure that your computer's time (currently set to %S) is correct.
#Preferences #Preferences

View File

@ -322,6 +322,7 @@ nsNSSDialogs::CertExpired(nsITransportSecurityInfo *socketInfo,
PRTime notAfter, notBefore, timeToUse; PRTime notAfter, notBefore, timeToUse;
nsCOMPtr<nsIX509CertValidity> validity; nsCOMPtr<nsIX509CertValidity> validity;
const char *key; const char *key;
const char *titleKey;
*_retval = PR_FALSE; *_retval = PR_FALSE;
@ -343,13 +344,16 @@ nsNSSDialogs::CertExpired(nsITransportSecurityInfo *socketInfo,
if (LL_CMP(now, >, notAfter)) { if (LL_CMP(now, >, notAfter)) {
key = "serverCertExpiredMsg1"; key = "serverCertExpiredMsg1";
titleKey = "serverCertExpiredTitle";
timeToUse = notAfter; timeToUse = notAfter;
} else { } else {
key = "serverCertNotYetValedMsg1"; key = "serverCertNotYetValedMsg1";
titleKey = "serverCertNotYetValidTitle";
timeToUse = notBefore; timeToUse = notBefore;
} }
nsXPIDLString message1; nsXPIDLString message1;
nsXPIDLString title;
PRUnichar *commonName=nsnull; PRUnichar *commonName=nsnull;
nsString formattedDate; nsString formattedDate;
@ -366,14 +370,18 @@ nsNSSDialogs::CertExpired(nsITransportSecurityInfo *socketInfo,
PRUnichar *formattedDatePR = formattedDate.ToNewUnicode(); PRUnichar *formattedDatePR = formattedDate.ToNewUnicode();
const PRUnichar *formatStrings[2] = { commonName, formattedDatePR }; const PRUnichar *formatStrings[2] = { commonName, formattedDatePR };
nsString keyString = NS_ConvertASCIItoUCS2(key); nsString keyString = NS_ConvertASCIItoUCS2(key);
nsString titleKeyString = NS_ConvertASCIItoUCS2(titleKey);
mPIPStringBundle->FormatStringFromName(keyString.get(), formatStrings, mPIPStringBundle->FormatStringFromName(keyString.get(), formatStrings,
2, getter_Copies(message1)); 2, getter_Copies(message1));
mPIPStringBundle->FormatStringFromName(titleKeyString.get(), formatStrings,
2, getter_Copies(title));
Recycle(commonName); Recycle(commonName);
Recycle(formattedDatePR); Recycle(formattedDatePR);
nsCOMPtr<nsIDialogParamBlock> dialogBlock = do_QueryInterface(block); nsCOMPtr<nsIDialogParamBlock> dialogBlock = do_QueryInterface(block);
rv = dialogBlock->SetString(1,message1); rv = dialogBlock->SetString(1,message1);
rv = dialogBlock->SetString(2,title);
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;