зеркало из https://github.com/mozilla/gecko-dev.git
Bug 462806. Don't init PSM to deal with random JARs. Save that for signed JARs. r=dveditz, sr=vlad, a=beltzner
This commit is contained in:
Родитель
92ce3b9365
Коммит
984229a6b0
|
@ -376,15 +376,8 @@ nsJAR::GetCertificatePrincipal(const char* aFilename, nsIPrincipal** aPrincipal)
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
*aPrincipal = nsnull;
|
*aPrincipal = nsnull;
|
||||||
|
|
||||||
//-- Get the signature verifier service
|
|
||||||
nsresult rv;
|
|
||||||
nsCOMPtr<nsISignatureVerifier> verifier =
|
|
||||||
do_GetService(SIGNATURE_VERIFIER_CONTRACTID, &rv);
|
|
||||||
if (NS_FAILED(rv)) // No signature verifier available
|
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
//-- Parse the manifest
|
//-- Parse the manifest
|
||||||
rv = ParseManifest(verifier);
|
nsresult rv = ParseManifest();
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
if (mGlobalStatus == JAR_NO_MANIFEST)
|
if (mGlobalStatus == JAR_NO_MANIFEST)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -525,7 +518,7 @@ nsJAR::ReadLine(const char** src)
|
||||||
#define JAR_SF_HEADER (const char*)"Signature-Version: 1.0"
|
#define JAR_SF_HEADER (const char*)"Signature-Version: 1.0"
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsJAR::ParseManifest(nsISignatureVerifier* verifier)
|
nsJAR::ParseManifest()
|
||||||
{
|
{
|
||||||
//-- Verification Step 1
|
//-- Verification Step 1
|
||||||
if (mParsedManifest)
|
if (mParsedManifest)
|
||||||
|
@ -612,6 +605,16 @@ nsJAR::ParseManifest(nsISignatureVerifier* verifier)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-- Get the signature verifier service
|
||||||
|
nsCOMPtr<nsISignatureVerifier> verifier =
|
||||||
|
do_GetService(SIGNATURE_VERIFIER_CONTRACTID, &rv);
|
||||||
|
if (NS_FAILED(rv)) // No signature verifier available
|
||||||
|
{
|
||||||
|
mGlobalStatus = JAR_NO_MANIFEST;
|
||||||
|
mParsedManifest = PR_TRUE;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
//-- Verify that the signature file is a valid signature of the SF file
|
//-- Verify that the signature file is a valid signature of the SF file
|
||||||
PRInt32 verifyError;
|
PRInt32 verifyError;
|
||||||
rv = verifier->VerifySignature(sigBuffer, sigLen, manifestBuffer, manifestLen,
|
rv = verifier->VerifySignature(sigBuffer, sigLen, manifestBuffer, manifestLen,
|
||||||
|
|
|
@ -154,7 +154,7 @@ class nsJAR : public nsIZipReader, public nsIJAR
|
||||||
//-- Private functions
|
//-- Private functions
|
||||||
PRFileDesc* OpenFile();
|
PRFileDesc* OpenFile();
|
||||||
|
|
||||||
nsresult ParseManifest(nsISignatureVerifier* verifier);
|
nsresult ParseManifest();
|
||||||
void ReportError(const char* aFilename, PRInt16 errorCode);
|
void ReportError(const char* aFilename, PRInt16 errorCode);
|
||||||
nsresult LoadEntry(const char* aFilename, char** aBuf,
|
nsresult LoadEntry(const char* aFilename, char** aBuf,
|
||||||
PRUint32* aBufLen = nsnull);
|
PRUint32* aBufLen = nsnull);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче