Skip to content

Commit

Permalink
fixup! fix sending error when no root CA cert update available
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeev-0 committed Apr 17, 2024
1 parent 68209d0 commit f3f3a51
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions crypto/cmp/cmp_asn.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,24 +289,23 @@ OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_rootCaKeyUpdate(const X509 *newWithNew,
OSSL_CMP_ITAV *itav;
OSSL_CMP_ROOTCAKEYUPDATE *upd = NULL;

if (newWithNew == NULL)
goto null_value;
if (newWithNew != NULL) {
upd = OSSL_CMP_ROOTCAKEYUPDATE_new();
if (upd == NULL)
return NULL;

upd = OSSL_CMP_ROOTCAKEYUPDATE_new();
if (upd == NULL)
return NULL;

if ((upd->newWithNew = X509_dup(newWithNew)) == NULL)
goto err;
if (newWithOld != NULL && (upd->newWithOld = X509_dup(newWithOld)) == NULL)
goto err;
if (oldWithNew != NULL && (upd->oldWithNew = X509_dup(oldWithNew)) == NULL)
goto err;
if ((upd->newWithNew = X509_dup(newWithNew)) == NULL)
goto err;
if (newWithOld != NULL
&& (upd->newWithOld = X509_dup(newWithOld)) == NULL)
goto err;
if (oldWithNew != NULL
&& (upd->oldWithNew = X509_dup(oldWithNew)) == NULL)
goto err;
}

null_value:
if ((itav = OSSL_CMP_ITAV_new()) == NULL)
goto err;

itav->infoType = OBJ_nid2obj(NID_id_it_rootCaKeyUpdate);
itav->infoValue.rootCaKeyUpdate = upd;
return itav;
Expand Down

0 comments on commit f3f3a51

Please sign in to comment.