Lines Matching refs:NULL

25     OSSL_CMP_MSG *msg = NULL;  in OSSL_CMP_MSG_new()
31 msg = NULL; in OSSL_CMP_MSG_new()
49 if (msg != NULL) { in ossl_cmp_msg_set0_libctx()
52 msg->propq = NULL; in ossl_cmp_msg_set0_libctx()
53 if (propq != NULL) { in ossl_cmp_msg_set0_libctx()
55 if (msg->propq == NULL) in ossl_cmp_msg_set0_libctx()
64 if (msg == NULL) { in OSSL_CMP_MSG_get0_header()
66 return NULL; in OSSL_CMP_MSG_get0_header()
88 if (!ossl_assert(msg != NULL && msg->body != NULL)) in ossl_cmp_msg_set_bodytype()
97 if (!ossl_assert(msg != NULL && msg->body != NULL)) in OSSL_CMP_MSG_get_bodytype()
115 if ((crm = sk_OSSL_CRMF_MSG_value(reqs, 0)) == NULL) { in OSSL_CMP_MSG_get0_certreq_publickey()
117 return NULL; in OSSL_CMP_MSG_get0_certreq_publickey()
119 if ((tmpl = OSSL_CRMF_MSG_get0_tmpl(crm)) == NULL in OSSL_CMP_MSG_get0_certreq_publickey()
120 || (pubkey = OSSL_CRMF_CERTTEMPLATE_get0_publicKey(tmpl)) == NULL) { in OSSL_CMP_MSG_get0_certreq_publickey()
122 return NULL; in OSSL_CMP_MSG_get0_certreq_publickey()
127 return NULL; in OSSL_CMP_MSG_get0_certreq_publickey()
137 if (!ossl_assert(pexts != NULL)) /* pointer to var must not be NULL */ in add1_extension()
140 if ((ext = X509V3_EXT_i2d(nid, crit, ex)) == NULL) in add1_extension()
143 res = X509v3_add_ext(pexts, ext, 0) != NULL; in add1_extension()
154 if (val != NULL && ASN1_ENUMERATED_set(val, reason_code)) in add_crl_reason_extension()
162 OSSL_CMP_MSG *msg = NULL; in ossl_cmp_msg_create()
164 if (!ossl_assert(ctx != NULL)) in ossl_cmp_msg_create()
165 return NULL; in ossl_cmp_msg_create()
167 if ((msg = OSSL_CMP_MSG_new(ctx->libctx, ctx->propq)) == NULL) in ossl_cmp_msg_create()
168 return NULL; in ossl_cmp_msg_create()
172 if (ctx->geninfo_ITAVs != NULL in ossl_cmp_msg_create()
181 if ((msg->body->value.ir = OSSL_CRMF_MSGS_new()) == NULL) in ossl_cmp_msg_create()
186 if (ctx->p10CSR == NULL) { in ossl_cmp_msg_create()
190 if ((msg->body->value.p10cr = X509_REQ_dup(ctx->p10CSR)) == NULL) in ossl_cmp_msg_create()
197 if ((msg->body->value.ip = OSSL_CMP_CERTREPMESSAGE_new()) == NULL) in ossl_cmp_msg_create()
202 if ((msg->body->value.rr = sk_OSSL_CMP_REVDETAILS_new_null()) == NULL) in ossl_cmp_msg_create()
206 if ((msg->body->value.rp = OSSL_CMP_REVREPCONTENT_new()) == NULL) in ossl_cmp_msg_create()
212 sk_OSSL_CMP_CERTSTATUS_new_null()) == NULL) in ossl_cmp_msg_create()
216 if ((msg->body->value.pkiconf = ASN1_TYPE_new()) == NULL) in ossl_cmp_msg_create()
218 ASN1_TYPE_set(msg->body->value.pkiconf, V_ASN1_NULL, NULL); in ossl_cmp_msg_create()
222 if ((msg->body->value.pollReq = sk_OSSL_CMP_POLLREQ_new_null()) == NULL) in ossl_cmp_msg_create()
226 if ((msg->body->value.pollRep = sk_OSSL_CMP_POLLREP_new_null()) == NULL) in ossl_cmp_msg_create()
232 if ((msg->body->value.genm = sk_OSSL_CMP_ITAV_new_null()) == NULL) in ossl_cmp_msg_create()
237 if ((msg->body->value.error = OSSL_CMP_ERRORMSGCONTENT_new()) == NULL) in ossl_cmp_msg_create()
248 return NULL; in ossl_cmp_msg_create()
258 if (ctx->subjectName != NULL) in determine_subj()
259 return IS_NULL_DN(ctx->subjectName) ? NULL : ctx->subjectName; in determine_subj()
260 if (ctx->p10CSR != NULL) /* first default is from any given CSR */ in determine_subj()
268 return NULL; in determine_subj()
273 OSSL_CRMF_MSG *crm = NULL; in OSSL_CMP_CTX_setup_CRM()
274 X509 *refcert = ctx->oldCert != NULL ? ctx->oldCert : ctx->cert; in OSSL_CMP_CTX_setup_CRM()
277 STACK_OF(GENERAL_NAME) *default_sans = NULL; in OSSL_CMP_CTX_setup_CRM()
279 refcert != NULL ? X509_get_subject_name(refcert) : NULL; in OSSL_CMP_CTX_setup_CRM()
281 const X509_NAME *issuer = ctx->issuer != NULL || refcert == NULL in OSSL_CMP_CTX_setup_CRM()
282 ? (IS_NULL_DN(ctx->issuer) ? NULL : ctx->issuer) in OSSL_CMP_CTX_setup_CRM()
284 int crit = ctx->setSubjectAltNameCritical || subject == NULL; in OSSL_CMP_CTX_setup_CRM()
286 X509_EXTENSIONS *exts = NULL; in OSSL_CMP_CTX_setup_CRM()
288 if (rkey == NULL) { in OSSL_CMP_CTX_setup_CRM()
291 return NULL; in OSSL_CMP_CTX_setup_CRM()
294 if (for_KUR && refcert == NULL && ctx->p10CSR == NULL) { in OSSL_CMP_CTX_setup_CRM()
296 return NULL; in OSSL_CMP_CTX_setup_CRM()
298 if ((crm = OSSL_CRMF_MSG_new()) == NULL) in OSSL_CMP_CTX_setup_CRM()
299 return NULL; in OSSL_CMP_CTX_setup_CRM()
307 subject, issuer, NULL /* serial */)) in OSSL_CMP_CTX_setup_CRM()
310 time_t now = time(NULL); in OSSL_CMP_CTX_setup_CRM()
311 ASN1_TIME *notBefore = ASN1_TIME_adj(NULL, now, 0, 0); in OSSL_CMP_CTX_setup_CRM()
312 ASN1_TIME *notAfter = ASN1_TIME_adj(NULL, now, ctx->days, 0); in OSSL_CMP_CTX_setup_CRM()
314 if (notBefore == NULL in OSSL_CMP_CTX_setup_CRM()
315 || notAfter == NULL in OSSL_CMP_CTX_setup_CRM()
324 if (ctx->p10CSR != NULL in OSSL_CMP_CTX_setup_CRM()
325 && (exts = X509_REQ_get_extensions(ctx->p10CSR)) == NULL) in OSSL_CMP_CTX_setup_CRM()
327 if (!ctx->SubjectAltName_nodefault && !HAS_SAN(ctx) && refcert != NULL in OSSL_CMP_CTX_setup_CRM()
329 NID_subject_alt_name, NULL, NULL)) in OSSL_CMP_CTX_setup_CRM()
330 != NULL in OSSL_CMP_CTX_setup_CRM()
334 && X509v3_add_extensions(&exts, ctx->reqExtensions) == NULL) in OSSL_CMP_CTX_setup_CRM()
340 if (ctx->policies != NULL in OSSL_CMP_CTX_setup_CRM()
346 exts = NULL; in OSSL_CMP_CTX_setup_CRM()
350 if (for_KUR && refcert != NULL) { in OSSL_CMP_CTX_setup_CRM()
356 if (cid == NULL) in OSSL_CMP_CTX_setup_CRM()
368 crm = NULL; in OSSL_CMP_CTX_setup_CRM()
380 OSSL_CRMF_MSG *local_crm = NULL; in ossl_cmp_certreq_new()
382 if (!ossl_assert(ctx != NULL)) in ossl_cmp_certreq_new()
383 return NULL; in ossl_cmp_certreq_new()
388 return NULL; in ossl_cmp_certreq_new()
390 if (type == OSSL_CMP_PKIBODY_P10CR && crm != NULL) { in ossl_cmp_certreq_new()
392 return NULL; in ossl_cmp_certreq_new()
395 if ((msg = ossl_cmp_msg_create(ctx, type)) == NULL) in ossl_cmp_certreq_new()
408 if (ctx->popoMethod >= OSSL_CRMF_POPO_SIGNATURE && privkey == NULL) { in ossl_cmp_certreq_new()
412 if (crm == NULL) { in ossl_cmp_certreq_new()
416 if (local_crm == NULL in ossl_cmp_certreq_new()
422 if ((local_crm = OSSL_CRMF_MSG_dup(crm)) == NULL) in ossl_cmp_certreq_new()
429 local_crm = NULL; in ossl_cmp_certreq_new()
441 return NULL; in ossl_cmp_certreq_new()
450 OSSL_CMP_MSG *msg = NULL; in ossl_cmp_certrep_new()
451 OSSL_CMP_CERTREPMESSAGE *repMsg = NULL; in ossl_cmp_certrep_new()
452 OSSL_CMP_CERTRESPONSE *resp = NULL; in ossl_cmp_certrep_new()
455 if (!ossl_assert(ctx != NULL && si != NULL)) in ossl_cmp_certrep_new()
456 return NULL; in ossl_cmp_certrep_new()
458 if ((msg = ossl_cmp_msg_create(ctx, bodytype)) == NULL) in ossl_cmp_certrep_new()
467 if ((resp = OSSL_CMP_CERTRESPONSE_new()) == NULL) in ossl_cmp_certrep_new()
470 if ((resp->status = OSSL_CMP_PKISI_dup(si)) == NULL in ossl_cmp_certrep_new()
476 && status != OSSL_CMP_PKISTATUS_waiting && cert != NULL) { in ossl_cmp_certrep_new()
477 if (encryption_recip != NULL) { in ossl_cmp_certrep_new()
483 == NULL) in ossl_cmp_certrep_new()
494 resp = NULL; in ossl_cmp_certrep_new()
496 if (bodytype == OSSL_CMP_PKIBODY_IP && caPubs != NULL in ossl_cmp_certrep_new()
497 && (repMsg->caPubs = X509_chain_up_ref(caPubs)) == NULL) in ossl_cmp_certrep_new()
515 return NULL; in ossl_cmp_certrep_new()
520 OSSL_CMP_MSG *msg = NULL; in ossl_cmp_rr_new()
521 const X509_NAME *issuer = NULL; in ossl_cmp_rr_new()
522 const X509_NAME *subject = NULL; in ossl_cmp_rr_new()
523 const ASN1_INTEGER *serialNumber = NULL; in ossl_cmp_rr_new()
524 EVP_PKEY *pubkey = NULL; in ossl_cmp_rr_new()
528 if (!ossl_assert(ctx != NULL in ossl_cmp_rr_new()
529 && (ctx->oldCert != NULL || ctx->p10CSR != NULL in ossl_cmp_rr_new()
530 || (ctx->serialNumber != NULL && ctx->issuer != NULL)))) in ossl_cmp_rr_new()
531 return NULL; in ossl_cmp_rr_new()
533 if ((rd = OSSL_CMP_REVDETAILS_new()) == NULL) in ossl_cmp_rr_new()
536 if (ctx->serialNumber != NULL && ctx->issuer != NULL) { in ossl_cmp_rr_new()
539 } else if (ctx->oldCert != NULL) { in ossl_cmp_rr_new()
542 } else if (ctx->p10CSR != NULL) { in ossl_cmp_rr_new()
561 if ((msg = ossl_cmp_msg_create(ctx, OSSL_CMP_PKIBODY_RR)) == NULL) in ossl_cmp_rr_new()
566 rd = NULL; in ossl_cmp_rr_new()
578 return NULL; in ossl_cmp_rr_new()
584 OSSL_CMP_REVREPCONTENT *rep = NULL; in ossl_cmp_rp_new()
585 OSSL_CMP_PKISI *si1 = NULL; in ossl_cmp_rp_new()
586 OSSL_CRMF_CERTID *cid_copy = NULL; in ossl_cmp_rp_new()
587 OSSL_CMP_MSG *msg = NULL; in ossl_cmp_rp_new()
589 if (!ossl_assert(ctx != NULL && si != NULL)) in ossl_cmp_rp_new()
590 return NULL; in ossl_cmp_rp_new()
592 if ((msg = ossl_cmp_msg_create(ctx, OSSL_CMP_PKIBODY_RP)) == NULL) in ossl_cmp_rp_new()
596 if ((si1 = OSSL_CMP_PKISI_dup(si)) == NULL) in ossl_cmp_rp_new()
604 if ((rep->revCerts = sk_OSSL_CRMF_CERTID_new_null()) == NULL) in ossl_cmp_rp_new()
606 if (cid != NULL) { in ossl_cmp_rp_new()
607 if ((cid_copy = OSSL_CRMF_CERTID_dup(cid)) == NULL) in ossl_cmp_rp_new()
625 return NULL; in ossl_cmp_rp_new()
632 if (!ossl_assert(ctx != NULL)) in ossl_cmp_pkiconf_new()
633 return NULL; in ossl_cmp_pkiconf_new()
635 if ((msg = ossl_cmp_msg_create(ctx, OSSL_CMP_PKIBODY_PKICONF)) == NULL) in ossl_cmp_pkiconf_new()
643 return NULL; in ossl_cmp_pkiconf_new()
650 if (!ossl_assert(msg != NULL && itav != NULL)) in ossl_cmp_msg_gen_push0_ITAV()
668 OSSL_CMP_ITAV *itav = NULL; in ossl_cmp_msg_gen_push1_ITAVs()
670 if (!ossl_assert(msg != NULL)) in ossl_cmp_msg_gen_push1_ITAVs()
675 if (itav == NULL in ossl_cmp_msg_gen_push1_ITAVs()
692 OSSL_CMP_MSG *msg = NULL; in gen_new()
694 if (!ossl_assert(ctx != NULL)) in gen_new()
695 return NULL; in gen_new()
697 if ((msg = ossl_cmp_msg_create(ctx, body_type)) == NULL) in gen_new()
698 return NULL; in gen_new()
700 if (itavs != NULL && !ossl_cmp_msg_gen_push1_ITAVs(msg, itavs)) in gen_new()
711 return NULL; in gen_new()
731 OSSL_CMP_MSG *msg = NULL; in ossl_cmp_error_new()
732 const char *lib = NULL, *reason = NULL; in ossl_cmp_error_new()
735 if (!ossl_assert(ctx != NULL && si != NULL)) in ossl_cmp_error_new()
736 return NULL; in ossl_cmp_error_new()
738 if ((msg = ossl_cmp_msg_create(ctx, OSSL_CMP_PKIBODY_ERROR)) == NULL) in ossl_cmp_error_new()
743 == NULL) in ossl_cmp_error_new()
745 if ((msg->body->value.error->errorCode = ASN1_INTEGER_new()) == NULL) in ossl_cmp_error_new()
754 if (lib != NULL || reason != NULL || details != NULL) { in ossl_cmp_error_new()
755 if ((ft = sk_ASN1_UTF8STRING_new_null()) == NULL) in ossl_cmp_error_new()
758 if (lib != NULL && *lib != '\0' in ossl_cmp_error_new()
761 if (reason != NULL && *reason != '\0' in ossl_cmp_error_new()
764 if (details != NULL in ossl_cmp_error_new()
776 return NULL; in ossl_cmp_error_new()
787 if (!ossl_assert(certStatus != NULL)) in ossl_cmp_certstatus_set0_certHash()
797 OSSL_CMP_MSG *msg = NULL; in ossl_cmp_certConf_new()
798 OSSL_CMP_CERTSTATUS *certStatus = NULL; in ossl_cmp_certConf_new()
801 ASN1_OCTET_STRING *certHash = NULL; in ossl_cmp_certConf_new()
804 if (!ossl_assert(ctx != NULL && ctx->newCert != NULL in ossl_cmp_certConf_new()
807 return NULL; in ossl_cmp_certConf_new()
811 return NULL; in ossl_cmp_certConf_new()
814 if ((msg = ossl_cmp_msg_create(ctx, OSSL_CMP_PKIBODY_CERTCONF)) == NULL) in ossl_cmp_certConf_new()
817 if ((certStatus = OSSL_CMP_CERTSTATUS_new()) == NULL) in ossl_cmp_certConf_new()
829 certStatus->hashAlg = NULL; in ossl_cmp_certConf_new()
835 if ((certHash = X509_digest_sig(ctx->newCert, &md, &is_fallback)) == NULL) in ossl_cmp_certConf_new()
840 if ((certStatus->hashAlg = X509_ALGOR_new()) == NULL) in ossl_cmp_certConf_new()
848 certHash = NULL; in ossl_cmp_certConf_new()
859 if (sinfo == NULL) in ossl_cmp_certConf_new()
872 return NULL; in ossl_cmp_certConf_new()
877 OSSL_CMP_MSG *msg = NULL; in ossl_cmp_pollReq_new()
878 OSSL_CMP_POLLREQ *preq = NULL; in ossl_cmp_pollReq_new()
880 if (!ossl_assert(ctx != NULL)) in ossl_cmp_pollReq_new()
881 return NULL; in ossl_cmp_pollReq_new()
883 if ((msg = ossl_cmp_msg_create(ctx, OSSL_CMP_PKIBODY_POLLREQ)) == NULL) in ossl_cmp_pollReq_new()
886 if ((preq = OSSL_CMP_POLLREQ_new()) == NULL in ossl_cmp_pollReq_new()
891 preq = NULL; in ossl_cmp_pollReq_new()
901 return NULL; in ossl_cmp_pollReq_new()
910 if (!ossl_assert(ctx != NULL)) in ossl_cmp_pollRep_new()
911 return NULL; in ossl_cmp_pollRep_new()
913 if ((msg = ossl_cmp_msg_create(ctx, OSSL_CMP_PKIBODY_POLLREP)) == NULL) in ossl_cmp_pollRep_new()
915 if ((prep = OSSL_CMP_POLLREP_new()) == NULL) in ossl_cmp_pollRep_new()
931 return NULL; in ossl_cmp_pollRep_new()
946 if (!ossl_assert(rrep != NULL)) in ossl_cmp_revrepcontent_get_pkisi()
947 return NULL; in ossl_cmp_revrepcontent_get_pkisi()
949 if ((status = sk_OSSL_CMP_PKISI_value(rrep->status, rsid)) != NULL) in ossl_cmp_revrepcontent_get_pkisi()
953 return NULL; in ossl_cmp_revrepcontent_get_pkisi()
966 OSSL_CRMF_CERTID *cid = NULL; in ossl_cmp_revrepcontent_get_CertId()
968 if (!ossl_assert(rrep != NULL)) in ossl_cmp_revrepcontent_get_CertId()
969 return NULL; in ossl_cmp_revrepcontent_get_CertId()
971 if ((cid = sk_OSSL_CRMF_CERTID_value(rrep->revCerts, rsid)) != NULL) in ossl_cmp_revrepcontent_get_CertId()
975 return NULL; in ossl_cmp_revrepcontent_get_CertId()
1002 OSSL_CMP_POLLREP *pollRep = NULL; in ossl_cmp_pollrepcontent_get0_pollrep()
1005 if (!ossl_assert(prc != NULL)) in ossl_cmp_pollrepcontent_get0_pollrep()
1006 return NULL; in ossl_cmp_pollrepcontent_get0_pollrep()
1016 return NULL; in ossl_cmp_pollrepcontent_get0_pollrep()
1028 OSSL_CMP_CERTRESPONSE *crep = NULL; in ossl_cmp_certrepmessage_get0_certresponse()
1031 if (!ossl_assert(crm != NULL && crm->response != NULL)) in ossl_cmp_certrepmessage_get0_certresponse()
1032 return NULL; in ossl_cmp_certrepmessage_get0_certresponse()
1042 return NULL; in ossl_cmp_certrepmessage_get0_certresponse()
1054 X509 *crt = NULL; in ossl_cmp_certresponse_get1_cert()
1057 if (!ossl_assert(crep != NULL && ctx != NULL)) in ossl_cmp_certresponse_get1_cert()
1058 return NULL; in ossl_cmp_certresponse_get1_cert()
1061 && (coec = crep->certifiedKeyPair->certOrEncCert) != NULL) { in ossl_cmp_certresponse_get1_cert()
1070 if (pkey == NULL) { in ossl_cmp_certresponse_get1_cert()
1072 return NULL; in ossl_cmp_certresponse_get1_cert()
1081 return NULL; in ossl_cmp_certresponse_get1_cert()
1084 if (crt == NULL) in ossl_cmp_certresponse_get1_cert()
1093 if (ctx == NULL || msg == NULL) { in OSSL_CMP_MSG_update_transactionID()
1099 return msg->header->protectionAlg == NULL in OSSL_CMP_MSG_update_transactionID()
1105 if (ctx == NULL || msg == NULL || msg->header == NULL) { in OSSL_CMP_MSG_update_recipNonce()
1109 if (ctx->recipNonce == NULL) /* nothing to do for 1st msg in transaction */ in OSSL_CMP_MSG_update_recipNonce()
1114 return msg->header->protectionAlg == NULL || ossl_cmp_msg_protect(ctx, msg); in OSSL_CMP_MSG_update_recipNonce()
1121 BIO *bio = NULL; in OSSL_CMP_MSG_read()
1123 if (file == NULL) { in OSSL_CMP_MSG_read()
1125 return NULL; in OSSL_CMP_MSG_read()
1129 if (msg == NULL) { in OSSL_CMP_MSG_read()
1131 return NULL; in OSSL_CMP_MSG_read()
1134 if ((bio = BIO_new_file(file, "rb")) == NULL in OSSL_CMP_MSG_read()
1135 || d2i_OSSL_CMP_MSG_bio(bio, &msg) == NULL) { in OSSL_CMP_MSG_read()
1137 msg = NULL; in OSSL_CMP_MSG_read()
1148 if (file == NULL || msg == NULL) { in OSSL_CMP_MSG_write()
1154 if (bio == NULL) in OSSL_CMP_MSG_write()
1164 OSSL_LIB_CTX *libctx = NULL; in d2i_OSSL_CMP_MSG()
1165 const char *propq = NULL; in d2i_OSSL_CMP_MSG()
1167 if (msg != NULL && *msg != NULL) { in d2i_OSSL_CMP_MSG()
1185 OSSL_LIB_CTX *libctx = NULL; in d2i_OSSL_CMP_MSG_bio()
1186 const char *propq = NULL; in d2i_OSSL_CMP_MSG_bio()
1188 if (msg != NULL && *msg != NULL) { in d2i_OSSL_CMP_MSG_bio()
1204 if (!ossl_assert(msg != NULL)) in ossl_cmp_is_error_with_waiting()