void freeField_SignedCrl ( CssmOwnedData &fieldValue) { CSSM_X509_SIGNED_CRL *cssmCrl = (CSSM_X509_SIGNED_CRL *)fieldValue.data(); if(cssmCrl == NULL) { return; } if(fieldValue.length() != sizeof(CSSM_X509_SIGNED_CRL)) { CssmError::throwMe(CSSMERR_CL_INVALID_FIELD_POINTER); } Allocator &alloc = fieldValue.allocator; CSSM_X509_TBS_CERTLIST_PTR cssmTbs = &cssmCrl->tbsCertList; if(cssmTbs == NULL) { CssmError::throwMe(CSSMERR_CL_INVALID_FIELD_POINTER); } /* run down the fields */ if(cssmTbs->version.Data) { alloc.free(cssmTbs->version.Data); } /* CSSM_X509_ALGORITHM_IDENTIFIER signature - in TBS and CRL */ CL_freeCssmAlgId(&cssmTbs->signature, alloc); CL_freeCssmAlgId(&cssmCrl->signature.algorithmIdentifier, alloc); /* issuer, thisUpdate, nextUpdate */ CL_freeX509Name(&cssmTbs->issuer, alloc); CL_freeCssmTime(&cssmTbs->thisUpdate, alloc); CL_freeCssmTime(&cssmTbs->nextUpdate, alloc); /* CSSM_X509_REVOKED_CERT_LIST_PTR revokedCertificates */ freeCssmRevokedList(cssmTbs->revokedCertificates, alloc); alloc.free(cssmTbs->revokedCertificates); /* CSSM_X509_EXTENSIONS extensions */ CL_freeCssmExtensions(cssmTbs->extensions, alloc); /* raw signature - note signature.algId freed above */ alloc.free(cssmCrl->signature.encrypted.Data); memset(cssmCrl, 0, sizeof(CSSM_X509_SIGNED_CRL)); }
static void freeField_PublicKeyInfo ( CssmOwnedData &fieldValue) { CSSM_X509_SUBJECT_PUBLIC_KEY_INFO *cssmKeyInfo = (CSSM_X509_SUBJECT_PUBLIC_KEY_INFO *)fieldValue.data(); if(cssmKeyInfo == NULL) { return; } Allocator &alloc = fieldValue.allocator; CL_freeCssmAlgId(&cssmKeyInfo->algorithm, alloc); alloc.free(cssmKeyInfo->subjectPublicKey.Data); memset(cssmKeyInfo, 0, sizeof(CSSM_X509_SUBJECT_PUBLIC_KEY_INFO));}