Bug 564584 @mozilla.org/security/certoverride;1 overrides crashes the application [@ nsNSSComponent::LogoutAuthenticatedPK11]; r=kaie a=bsmedberg

This commit is contained in:
timeless@mozdev.org 2010-05-25 17:34:13 +03:00
parent 44a8bb8f8a
commit 8ae3094574
3 changed files with 13 additions and 8 deletions

View File

@ -133,8 +133,10 @@ interface nsICertOverrideService : nsISupports {
* Remove a override for the given hostname:port.
*
* @param aHostName The host (punycode) whose entry should be cleared.
* @param aPort The port whose entry should be cleared, if it is -1 then it
* is internaly treated as 443
* @param aPort The port whose entry should be cleared.
* If it is -1, then it is internaly treated as 443.
* If it is 0 and aHostName is "all:temporary-certificates",
* then all temporary certificates should be cleared.
*/
void clearValidityOverride(in ACString aHostName,
in PRInt32 aPort);

View File

@ -696,6 +696,11 @@ nsCertOverrideService::AddEntryToList(const nsACString &aHostName, PRInt32 aPort
NS_IMETHODIMP
nsCertOverrideService::ClearValidityOverride(const nsACString & aHostName, PRInt32 aPort)
{
if (aPort == 0 &&
aHostName.EqualsLiteral("all:temporary-certificates")) {
RemoveAllTemporaryOverrides();
return NS_OK;
}
nsCAutoString hostPort;
GetHostWithPort(aHostName, aPort, hostPort);
{

View File

@ -2363,12 +2363,10 @@ nsresult nsNSSComponent::LogoutAuthenticatedPK11()
{
nsCOMPtr<nsICertOverrideService> icos =
do_GetService("@mozilla.org/security/certoverride;1");
nsCertOverrideService *cos =
reinterpret_cast<nsCertOverrideService*>(icos.get());
if (cos) {
cos->RemoveAllTemporaryOverrides();
if (icos) {
icos->ClearValidityOverride(
NS_LITERAL_CSTRING("all:temporary-certificates"),
0);
}
if (mClientAuthRememberService) {