/*
 * SecCmsEncryptedDataDestroy - destroy an encryptedData object
 */
void
SecCmsEncryptedDataDestroy(SecCmsEncryptedDataRef encd)
{
    if (encd == NULL) {
        return;
    }
    /* everything's in a pool, so don't worry about the storage */
    SecCmsContentInfoDestroy(&(encd->contentInfo));
    return;
}
/*
 * SecCmsDigestedDataDestroy - destroy a digestedData object
 */
void
SecCmsDigestedDataDestroy(SecCmsDigestedDataRef digd)
{
    if (digd == NULL) {
        return;
    }
    /* everything's in a pool, so don't worry about the storage */
    SecCmsContentInfoDestroy(&(digd->contentInfo));
    return;
}
/*
 * SecCmsMessageDestroy - destroy a CMS message and all of its sub-pieces.
 */
void
SecCmsMessageDestroy(SecCmsMessageRef cmsg)
{
    PORT_Assert (cmsg->refCount > 0);
    if (cmsg->refCount <= 0)	/* oops */
	return;

    cmsg->refCount--;		/* thread safety? */
    if (cmsg->refCount > 0)
	return;

    SecCmsContentInfoDestroy(&(cmsg->contentInfo));

    if (cmsg->poolp) {
        PORT_FreeArena (cmsg->poolp, PR_TRUE);
    }
}
Exemple #4
0
/*
 * SecCmsEnvelopedDataDestroy - destroy an enveloped data message
 */
void
SecCmsEnvelopedDataDestroy(SecCmsEnvelopedData *edp)
{
    SecCmsRecipientInfo **recipientinfos;
    SecCmsRecipientInfo *ri;

    if (edp == NULL)
	return;

    recipientinfos = edp->recipientInfos;
    if (recipientinfos == NULL)
	return;

    while ((ri = *recipientinfos++) != NULL)
	SecCmsRecipientInfoDestroy(ri);

   SecCmsContentInfoDestroy(&(edp->contentInfo));

}
void
SecCmsSignedDataDestroy(SecCmsSignedDataRef sigd)
{
    SecCmsSignerInfoRef *signerinfos, si;

    if (sigd == NULL)
	return;

    if (sigd->certs != NULL)
	CFRelease(sigd->certs);

    signerinfos = sigd->signerInfos;
    if (signerinfos != NULL) {
	while ((si = *signerinfos++) != NULL)
	    SecCmsSignerInfoDestroy(si);
    }

    /* everything's in a pool, so don't worry about the storage */
   SecCmsContentInfoDestroy(&(sigd->contentInfo));
}