mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
dc6bb35407
commit
dc71f62826
@ -376,15 +376,8 @@ nsJAR::GetCertificatePrincipal(const char* aFilename, nsIPrincipal** aPrincipal)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
*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
|
||||
rv = ParseManifest(verifier);
|
||||
nsresult rv = ParseManifest();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (mGlobalStatus == JAR_NO_MANIFEST)
|
||||
return NS_OK;
|
||||
@ -525,7 +518,7 @@ nsJAR::ReadLine(const char** src)
|
||||
#define JAR_SF_HEADER (const char*)"Signature-Version: 1.0"
|
||||
|
||||
nsresult
|
||||
nsJAR::ParseManifest(nsISignatureVerifier* verifier)
|
||||
nsJAR::ParseManifest()
|
||||
{
|
||||
//-- Verification Step 1
|
||||
if (mParsedManifest)
|
||||
@ -612,6 +605,16 @@ nsJAR::ParseManifest(nsISignatureVerifier* verifier)
|
||||
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
|
||||
PRInt32 verifyError;
|
||||
rv = verifier->VerifySignature(sigBuffer, sigLen, manifestBuffer, manifestLen,
|
||||
|
@ -154,7 +154,7 @@ class nsJAR : public nsIZipReader, public nsIJAR
|
||||
//-- Private functions
|
||||
PRFileDesc* OpenFile();
|
||||
|
||||
nsresult ParseManifest(nsISignatureVerifier* verifier);
|
||||
nsresult ParseManifest();
|
||||
void ReportError(const char* aFilename, PRInt16 errorCode);
|
||||
nsresult LoadEntry(const char* aFilename, char** aBuf,
|
||||
PRUint32* aBufLen = nsnull);
|
||||
|
Loading…
Reference in New Issue
Block a user