Exemplo n.º 1
0
/*
 * SecCmsEncryptedDataDecodeAfterData - finish decrypting this encryptedData's content
 */
OSStatus
SecCmsEncryptedDataDecodeAfterData(SecCmsEncryptedDataRef encd)
{
    if (encd->contentInfo.ciphcx) {
	SecCmsCipherContextDestroy(encd->contentInfo.ciphcx);
	encd->contentInfo.ciphcx = NULL;
    }

    return SECSuccess;
}
Exemplo n.º 2
0
/*
 * SecCmsEnvelopedDataDecodeAfterData - finish decrypting this envelopedData's content
 */
OSStatus
SecCmsEnvelopedDataDecodeAfterData(SecCmsEnvelopedData *envd)
{
    if (envd->contentInfo.ciphcx) {
	SecCmsCipherContextDestroy(envd->contentInfo.ciphcx);
	envd->contentInfo.ciphcx = NULL;
    }

    return SECSuccess;
}
Exemplo n.º 3
0
/*
 * SecCmsEncryptedDataEncodeAfterData - finalize this encryptedData for encoding
 */
OSStatus
SecCmsEncryptedDataEncodeAfterData(SecCmsEncryptedDataRef encd)
{
    if (encd->contentInfo.ciphcx) {
	SecCmsCipherContextDestroy(encd->contentInfo.ciphcx);
	encd->contentInfo.ciphcx = NULL;
    }

    /* nothing to do after data */
    return SECSuccess;
}
Exemplo n.º 4
0
/*
 * SecCmsEnvelopedDataEncodeAfterData - finalize this envelopedData for encoding
 */
OSStatus
SecCmsEnvelopedDataEncodeAfterData(SecCmsEnvelopedData *envd)
{
    if (envd->contentInfo.ciphcx) {
	SecCmsCipherContextDestroy(envd->contentInfo.ciphcx);
	envd->contentInfo.ciphcx = NULL;
    }

    /* nothing else to do after data */
    return SECSuccess;
}
Exemplo n.º 5
0
/*
 * SecCmsContentInfoDestroy - destroy a CMS contentInfo and all of its sub-pieces.
 */
void
SecCmsContentInfoDestroy(SecCmsContentInfoRef cinfo)
{
    SECOidTag kind;

    kind = SecCmsContentInfoGetContentTypeTag(cinfo);
    switch (kind) {
    case SEC_OID_PKCS7_ENVELOPED_DATA:
	SecCmsEnvelopedDataDestroy(cinfo->content.envelopedData);
	break;
      case SEC_OID_PKCS7_SIGNED_DATA:
	SecCmsSignedDataDestroy(cinfo->content.signedData);
	break;
      case SEC_OID_PKCS7_ENCRYPTED_DATA:
	SecCmsEncryptedDataDestroy(cinfo->content.encryptedData);
	break;
      case SEC_OID_PKCS7_DIGESTED_DATA:
	SecCmsDigestedDataDestroy(cinfo->content.digestedData);
	break;
      default:
	/* XXX Anything else that needs to be "manually" freed/destroyed? */
	break;
    }
    if (cinfo->digcx) {
	/* must destroy digest objects */
	SecCmsDigestContextCancel(cinfo->digcx);
	cinfo->digcx = NULL;
    }
    if (cinfo->bulkkey)
	CFRelease(cinfo->bulkkey);
    /* @@@ private key is only here as a workaround for 3401088.  Note this *must* be released after bulkkey */
    if (cinfo->privkey)
	CFRelease(cinfo->privkey);

    if (cinfo->ciphcx) {
	SecCmsCipherContextDestroy(cinfo->ciphcx);
	cinfo->ciphcx = NULL;
    }
    
    /* we live in a pool, so no need to worry about storage */
}