BIO *cms_content_bio(CMS_ContentInfo *cms)
{
ASN1_OCTET_STRING **pos = CMS_get0_content(cms);
- if (!pos)
+
+ if (pos == NULL)
return NULL;
/* If content detached data goes nowhere: create NULL BIO */
- if (!*pos)
+ if (*pos == NULL)
return BIO_new(BIO_s_null());
/*
* If content not detached and created return memory BIO
*/
- if (!*pos || ((*pos)->flags == ASN1_STRING_FLAG_CONT))
+ if (*pos == NULL || ((*pos)->flags == ASN1_STRING_FLAG_CONT))
return BIO_new(BIO_s_mem());
/* Else content was read in: return read only BIO for it */
return BIO_new_mem_buf((*pos)->data, (*pos)->length);
int CMS_dataFinal(CMS_ContentInfo *cms, BIO *cmsbio)
{
ASN1_OCTET_STRING **pos = CMS_get0_content(cms);
- if (!pos)
+
+ if (pos == NULL)
return 0;
/* If embedded content find memory BIO and set content */
if (*pos && ((*pos)->flags & ASN1_STRING_FLAG_CONT)) {
int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid)
{
ASN1_OBJECT **petype, *etype;
+
petype = cms_get0_econtent_type(cms);
- if (!petype)
+ if (petype == NULL)
return 0;
- if (!oid)
+ if (oid == NULL)
return 1;
etype = OBJ_dup(oid);
- if (!etype)
+ if (etype == NULL)
return 0;
ASN1_OBJECT_free(*petype);
*petype = etype;
int CMS_is_detached(CMS_ContentInfo *cms)
{
ASN1_OCTET_STRING **pos;
+
pos = CMS_get0_content(cms);
- if (!pos)
+ if (pos == NULL)
return -1;
- if (*pos)
+ if (*pos != NULL)
return 0;
return 1;
}
int CMS_set_detached(CMS_ContentInfo *cms, int detached)
{
ASN1_OCTET_STRING **pos;
+
pos = CMS_get0_content(cms);
- if (!pos)
+ if (pos == NULL)
return 0;
if (detached) {
ASN1_OCTET_STRING_free(*pos);
{
STACK_OF(CMS_CertificateChoices) **pcerts;
CMS_CertificateChoices *cch;
+
pcerts = cms_get0_certificate_choices(cms);
- if (!pcerts)
+ if (pcerts == NULL)
return NULL;
- if (!*pcerts)
+ if (*pcerts == NULL)
*pcerts = sk_CMS_CertificateChoices_new_null();
- if (!*pcerts)
+ if (*pcerts == NULL)
return NULL;
cch = M_ASN1_new_of(CMS_CertificateChoices);
if (!cch)
CMS_CertificateChoices *cch;
STACK_OF(CMS_CertificateChoices) **pcerts;
int i;
+
pcerts = cms_get0_certificate_choices(cms);
- if (!pcerts)
+ if (pcerts == NULL)
return 0;
for (i = 0; i < sk_CMS_CertificateChoices_num(*pcerts); i++) {
cch = sk_CMS_CertificateChoices_value(*pcerts, i);
{
STACK_OF(CMS_RevocationInfoChoice) **pcrls;
CMS_RevocationInfoChoice *rch;
+
pcrls = cms_get0_revocation_choices(cms);
- if (!pcrls)
+ if (pcrls == NULL)
return NULL;
- if (!*pcrls)
+ if (*pcrls == NULL)
*pcrls = sk_CMS_RevocationInfoChoice_new_null();
- if (!*pcrls)
+ if (*pcrls == NULL)
return NULL;
rch = M_ASN1_new_of(CMS_RevocationInfoChoice);
- if (!rch)
+ if (rch == NULL)
return NULL;
if (!sk_CMS_RevocationInfoChoice_push(*pcrls, rch)) {
M_ASN1_free_of(rch, CMS_RevocationInfoChoice);
CMS_CertificateChoices *cch;
STACK_OF(CMS_CertificateChoices) **pcerts;
int i;
+
pcerts = cms_get0_certificate_choices(cms);
- if (!pcerts)
+ if (pcerts == NULL)
return NULL;
for (i = 0; i < sk_CMS_CertificateChoices_num(*pcerts); i++) {
cch = sk_CMS_CertificateChoices_value(*pcerts, i);
STACK_OF(CMS_RevocationInfoChoice) **pcrls;
CMS_RevocationInfoChoice *rch;
int i;
+
pcrls = cms_get0_revocation_choices(cms);
- if (!pcrls)
+ if (pcrls == NULL)
return NULL;
for (i = 0; i < sk_CMS_RevocationInfoChoice_num(*pcrls); i++) {
rch = sk_CMS_RevocationInfoChoice_value(*pcrls, i);