b=142147 Viewing signed message crashes Mozilla, if I did not log-in into the FIPS module

r=javi sr=bryner
This commit is contained in:
kaie%netscape.com 2002-08-23 10:10:17 +00:00
parent 07bda86df6
commit a6e10ab759
2 changed files with 8 additions and 2 deletions

View File

@ -578,8 +578,12 @@ NS_IMETHODIMP nsCMSDecoder::Finish(nsICMSMessage ** aCMSMsg)
NSSCMSMessage *cmsMsg;
cmsMsg = NSS_CMSDecoder_Finish(m_dcx);
if (cmsMsg) {
nsCOMPtr<nsICMSMessage> msg = new nsCMSMessage(cmsMsg);
*aCMSMsg = msg;
nsCMSMessage *obj = new nsCMSMessage(cmsMsg);
// The NSS object cmsMsg still carries a reference to the context
// we gave it on construction.
// Make sure the context will live long enough.
obj->referenceContext(m_ctx);
*aCMSMsg = obj;
NS_ADDREF(*aCMSMsg);
}
return NS_OK;

View File

@ -76,8 +76,10 @@ public:
nsCMSMessage(NSSCMSMessage* aCMSMsg);
virtual ~nsCMSMessage();
void referenceContext(nsIInterfaceRequestor* aContext) {m_ctx = aContext;}
NSSCMSMessage* getCMS() {return m_cmsMsg;};
private:
nsCOMPtr<nsIInterfaceRequestor> m_ctx;
NSSCMSMessage * m_cmsMsg;
NSSCMSSignerInfo* GetTopLevelSignerInfo();
nsresult CommonVerifySignature(unsigned char* aDigestData, PRUint32 aDigestDataLen);