Bug 401292 - application and addon updates fail when Danish Government browser extension is installed; Second patch v1; r=dveditz

This commit is contained in:
Jesper Kristensen 2008-12-06 18:31:39 +01:00
parent 2ebe85f49f
commit 4393d98b94
2 changed files with 11 additions and 5 deletions

View File

@ -80,7 +80,7 @@ interface nsIX509Cert3 : nsIX509Cert2 {
* Human readable names identifying all hardware or
* software tokens the certificate is stored on.
*
* @param On success, the number of entries in the returned array.
* @param length On success, the number of entries in the returned array.
* @return On success, an array containing the names of all tokens
* the certificate is stored on (may be empty).
* On failure the function throws/returns an error.

View File

@ -84,6 +84,7 @@
#include "nsISSLStatusProvider.h"
#include "nsISSLStatus.h"
#include "nsIX509Cert.h"
#include "nsIX509Cert3.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
@ -1101,11 +1102,16 @@ nsXPInstallManager::CheckCert(nsIChannel* aChannel)
}
if (issuer) {
nsAutoString tokenName;
rv = issuer->GetTokenName(tokenName);
PRUint32 length;
PRUnichar** tokenNames;
nsCOMPtr<nsIX509Cert3> issuer2(do_QueryInterface(issuer));
NS_ENSURE_TRUE(status, NS_ERROR_FAILURE);
rv = issuer2->GetAllTokenNames(&length, &tokenNames);
NS_ENSURE_SUCCESS(rv ,rv);
if (tokenName.Equals(NS_LITERAL_STRING("Builtin Object Token")))
return NS_OK;
for (PRUint32 i = 0; i < length; i++) {
if (nsDependentString(tokenNames[i]).Equals(NS_LITERAL_STRING("Builtin Object Token")))
return NS_OK;
}
}
return NS_ERROR_FAILURE;
}