Bug 95531. Correct ref count for certificate in CMS (SMIME) recipient NSS_3_3_BRANCH
authorthayes%netscape.com
Fri, 17 Aug 2001 16:52:48 +0000
branchNSS_3_3_BRANCH
changeset 1846 86605263d7db75a3e1b36d6a2a489f4b1c0f34e9
parent 1844 18e1bfea288286fc5089dcc2c7a138cd17e8c3fb
child 1847 b381a0d83c0861ef4e570a84e9451dc99194080e
push idunknown
push userunknown
push dateunknown
bugs95531
Bug 95531. Correct ref count for certificate in CMS (SMIME) recipient handling.
security/nss/lib/smime/cmsrecinfo.c
--- a/security/nss/lib/smime/cmsrecinfo.c
+++ b/security/nss/lib/smime/cmsrecinfo.c
@@ -356,17 +356,18 @@ NSS_CMSRecipientInfo_UnwrapBulkKey(NSSCM
 	CERTCertificate *cert, SECKEYPrivateKey *privkey, SECOidTag bulkalgtag)
 {
     PK11SymKey *bulkkey = NULL;
     SECAlgorithmID *encalg;
     SECOidTag encalgtag;
     SECItem *enckey;
     int error;
 
-    ri->cert = cert;	/* mark the recipientInfo so we can find it later */
+    ri->cert = CERT_DupCertificate(cert);
+        	/* mark the recipientInfo so we can find it later */
 
     switch (ri->recipientInfoType) {
     case NSSCMSRecipientInfoID_KeyTrans:
 	encalg = &(ri->ri.keyTransRecipientInfo.keyEncAlg);
 	encalgtag = SECOID_GetAlgorithmTag(&(ri->ri.keyTransRecipientInfo.keyEncAlg));
 	enckey = &(ri->ri.keyTransRecipientInfo.encKey); /* ignore subIndex */
 	switch (encalgtag) {
 	case SEC_OID_PKCS1_RSA_ENCRYPTION: