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
Родитель d215b4c802
Коммит 267a324474
2 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -80,7 +80,7 @@ interface nsIX509Cert3 : nsIX509Cert2 {
* Human readable names identifying all hardware or * Human readable names identifying all hardware or
* software tokens the certificate is stored on. * 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 * @return On success, an array containing the names of all tokens
* the certificate is stored on (may be empty). * the certificate is stored on (may be empty).
* On failure the function throws/returns an error. * On failure the function throws/returns an error.

Просмотреть файл

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