/* * NSS_CMSDigestedData_Destroy - destroy a digestedData object */ void NSS_CMSDigestedData_Destroy(NSSCMSDigestedData *digd) { /* everything's in a pool, so don't worry about the storage */ NSS_CMSContentInfo_Destroy(&(digd->contentInfo)); return; }
/* * NSS_CMSEncryptedData_Destroy - destroy an encryptedData object */ void NSS_CMSEncryptedData_Destroy(NSSCMSEncryptedData *encd) { /* everything's in a pool, so don't worry about the storage */ NSS_CMSContentInfo_Destroy(&(encd->contentInfo)); return; }
/* * NSS_CMSMessage_Destroy - destroy a CMS message and all of its sub-pieces. */ void NSS_CMSMessage_Destroy(NSSCMSMessage *cmsg) { PORT_Assert (cmsg->refCount > 0); if (cmsg->refCount <= 0) /* oops */ return; cmsg->refCount--; /* thread safety? */ if (cmsg->refCount > 0) return; NSS_CMSContentInfo_Destroy(&(cmsg->contentInfo)); /* if poolp is not NULL, cmsg is the owner of its arena */ if (cmsg->poolp_is_ours) PORT_FreeArena (cmsg->poolp, PR_FALSE); /* XXX clear it? */ }
/* * NSS_CMSEnvelopedData_Destroy - destroy an enveloped data message */ void NSS_CMSEnvelopedData_Destroy(NSSCMSEnvelopedData *edp) { NSSCMSRecipientInfo **recipientinfos; NSSCMSRecipientInfo *ri; if (edp == NULL) return; recipientinfos = edp->recipientInfos; if (recipientinfos == NULL) return; while ((ri = *recipientinfos++) != NULL) NSS_CMSRecipientInfo_Destroy(ri); NSS_CMSContentInfo_Destroy(&(edp->contentInfo)); }
void NSS_CMSSignedData_Destroy(NSSCMSSignedData *sigd) { CERTCertificate **certs, **tempCerts, *cert; CERTCertificateList **certlists, *certlist; NSSCMSSignerInfo **signerinfos, *si; if (sigd == NULL) return; certs = sigd->certs; tempCerts = sigd->tempCerts; certlists = sigd->certLists; signerinfos = sigd->signerInfos; if (certs != NULL) { while ((cert = *certs++) != NULL) CERT_DestroyCertificate (cert); } if (tempCerts != NULL) { while ((cert = *tempCerts++) != NULL) CERT_DestroyCertificate (cert); } if (certlists != NULL) { while ((certlist = *certlists++) != NULL) CERT_DestroyCertificateList (certlist); } if (signerinfos != NULL) { while ((si = *signerinfos++) != NULL) NSS_CMSSignerInfo_Destroy(si); } /* everything's in a pool, so don't worry about the storage */ NSS_CMSContentInfo_Destroy(&(sigd->contentInfo)); }