OSSL_CMP_ITAV_NEW_CACERTS(3ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… OSSL_CMP_ITAV_NEW_CACERTS(3ossl) πŸ’…

okay bestie, so this is the OSSL_CMP_ITAV_NEW_CACERTS page β€” it's the one in the OpenSSL manual set (that's the <openssl> manual name, iykyk) and it's literally all about the CMP utility functions for handling specific genm and genp messages. yes. that's the whole vibe. let's get into it 🫢


✨ NAME ✨

So the icon functions here are:

  • OSSL_CMP_ITAV_new_caCerts
  • OSSL_CMP_ITAV_get0_caCerts
  • OSSL_CMP_ITAV_new_rootCaCert
  • OSSL_CMP_ITAV_get0_rootCaCert
  • OSSL_CMP_ITAV_new_rootCaKeyUpdate
  • OSSL_CMP_ITAV_get0_rootCaKeyUpdate
  • OSSL_CMP_CRLSTATUS_new1
  • OSSL_CMP_CRLSTATUS_create
  • OSSL_CMP_CRLSTATUS_get0
  • OSSL_CMP_ITAV_new0_crlStatusList
  • OSSL_CMP_ITAV_get0_crlStatusList
  • OSSL_CMP_ITAV_new_crls
  • OSSL_CMP_ITAV_get0_crls
  • OSSL_CMP_ITAV_new0_certReqTemplate
  • OSSL_CMP_ITAV_get1_certReqTemplate

…all collected together as CMP utility functions for handling specific genm and genp messages. slay πŸŽ€


🌸 SYNOPSIS 🌸

Like, here's the whole cast, all backticked and exact, no cap:

#include <openssl/cmp.h>

OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_caCerts(const STACK_OF(X509) *caCerts);
int OSSL_CMP_ITAV_get0_caCerts(const OSSL_CMP_ITAV *itav, STACK_OF(X509) **out);

OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_rootCaCert(const X509 *rootCaCert);
int OSSL_CMP_ITAV_get0_rootCaCert(const OSSL_CMP_ITAV *itav, X509 **out);
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_rootCaKeyUpdate(const X509 *newWithNew,
                                                 const X509 *newWithOld,
                                                 const X509 *oldWithNew);
int OSSL_CMP_ITAV_get0_rootCaKeyUpdate(const OSSL_CMP_ITAV *itav,
                                       X509 **newWithNew,
                                       X509 **newWithOld,
                                       X509 **oldWithNew);

OSSL_CMP_CRLSTATUS *OSSL_CMP_CRLSTATUS_new1(const DIST_POINT_NAME *dpn,
                                            const GENERAL_NAMES *issuer,
                                            const ASN1_TIME *thisUpdate);
OSSL_CMP_CRLSTATUS *OSSL_CMP_CRLSTATUS_create(const X509_CRL *crl,
                                              const X509 *cert, int only_DN);
int OSSL_CMP_CRLSTATUS_get0(const OSSL_CMP_CRLSTATUS *crlstatus,
                            DIST_POINT_NAME **dpn, GENERAL_NAMES **issuer,
                            ASN1_TIME **thisUpdate);
OSSL_CMP_ITAV
*OSSL_CMP_ITAV_new0_crlStatusList(STACK_OF(OSSL_CMP_CRLSTATUS) *crlStatusList);
int OSSL_CMP_ITAV_get0_crlStatusList(const OSSL_CMP_ITAV *itav,
                                     STACK_OF(OSSL_CMP_CRLSTATUS) **out);
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_crls(const X509_CRL *crl);
int OSSL_CMP_ITAV_get0_crls(const OSSL_CMP_ITAV *itav, STACK_OF(X509_CRL) **out);
OSSL_CMP_ITAV
*OSSL_CMP_ITAV_new0_certReqTemplate(OSSL_CRMF_CERTTEMPLATE *certTemplate,
                                    OSSL_CMP_ATAVS *keySpec);
int OSSL_CMP_ITAV_get1_certReqTemplate(const OSSL_CMP_ITAV *itav,
                                       OSSL_CRMF_CERTTEMPLATE **certTemplate,
                                       OSSL_CMP_ATAVS **keySpec);

no thoughts, just prototypes ✨


πŸ’– DESCRIPTION πŸ’–

First thing, bestie, vocab check: ITAV is short for InfoTypeAndValue. that's it. that's the acronym. you're welcome πŸ’…

  • OSSL_CMP_ITAV_new_caCerts() β€” makes a brand-new OSSL_CMP_ITAV structure of type caCerts and fills it up with a copy of the certificate list you hand it. Also, the caCerts argument is allowed to be NULL, or to contain literally any number of certificates. zero, one, forty. no judgement. πŸ’€
  • OSSL_CMP_ITAV_get0_caCerts() β€” this one requires that itav has type caCerts, ok? it assigns NULL to *out if there are no CA certificates in itav β€” otherwise it gives you the internal pointer of type STACK_OF(X509) with the certificates that are present. note the "internal" part, that's the whole get0 vibe 🫢
  • OSSL_CMP_ITAV_new_rootCaCert() β€” creates a new OSSL_CMP_ITAV structure of type rootCaCert that includes the optionally given certificate.
  • OSSL_CMP_ITAV_get0_rootCaCert() β€” requires that itav has type rootCaCert. assigns NULL to *out if no certificate is included in itav, otherwise it's the internal pointer to the certificate contained in the infoValue field.
  • OSSL_CMP_ITAV_new_rootCaKeyUpdate() β€” creates a new OSSL_CMP_ITAV structure of type rootCaKeyUpdate, and it includes a RootCaKeyUpdateContent structure with the optional newWithNew, newWithOld, and oldWithNew certificates. heads up though: an RootCaKeyUpdateContent structure is included only if newWithNew is not NULL. like, that's the gate. ✨
  • OSSL_CMP_ITAV_get0_rootCaKeyUpdate() β€” requires that itav has infoType rootCaKeyUpdate. If an update of a root CA certificate is included, it assigns to *newWithNew the internal pointer to the certificate contained in the newWithNew infoValue sub-field of itav. If newWithOld is not NULL, it assigns to *newWithOld the internal pointer to the certificate contained in the newWithOld infoValue sub-field of itav. If oldWithNew is not NULL, it assigns to *oldWithNew the internal pointer to the certificate contained in the oldWithNew infoValue sub-field of itav. Each of these pointers gets set to NULL if no root CA certificate update is present, or if the respective sub-field isn't included. so like, NULL everywhere. it's giving cautious. πŸ™ˆ
  • OSSL_CMP_CRLSTATUS_new1() β€” allocates a new OSSL_CMP_CRLSTATUS structure containing either a copy of the distribution point name dpn or a copy of the certificate issuer issuer. ⚠️ and giving both is an error, bestie, do not. If given, a copy of the CRL issuance time thisUpdate is also included.
  • OSSL_CMP_CRLSTATUS_create() β€” the high-level variant of OSSL_CMP_CRLSTATUS_new1(). icon behaviour:
    • it fills the thisUpdate field with a copy of the thisUpdate field of crl β€” if present.
    • it fills the CRLSource field with a copy of the first data item found using the crl and/or cert parameters, like this: any available distribution point name is preferred over issuer names. data from cert, if present, is preferred over data from crl.
    • if no distribution point names are available, candidate issuer names are taken from the following sources, as far as present:
      1. the list of distribution points in the first cRLDistributionPoints extension of cert,
      2. the issuer field of the authority key identifier of cert,
      3. the issuer DN of cert,
      4. the issuer field of the authority key identifier of crl, and
      5. the issuer DN of crl.

and if only_DN is set, a candidate issuer name of type GENERAL_NAMES is accepted only if it contains exactly one general name of type directoryName. picky, but valid. πŸ’…

  • OSSL_CMP_CRLSTATUS_get0() β€” reads the fields of crlstatus and assigns them to *dpn, *issuer, and *thisUpdate. *thisUpdate is assigned only if the thisUpdate argument is not NULL. depending on the choice present, either *dpn or *issuer will be NULL. *thisUpdate can also be NULL if the field isn't present. it's giving "it depends". 😭
  • OSSL_CMP_ITAV_new0_crlStatusList() β€” creates a new OSSL_CMP_ITAV structure of type crlStatusList that includes the optionally given list of CRL status data, each of which is of type OSSL_CMP_CRLSTATUS.
  • OSSL_CMP_ITAV_get0_crlStatusList() β€” on success, assigns to *out an internal pointer to the list of CRL status data in the infoValue field of itav. that pointer may be NULL if no CRL status data is included. and it is an error if the infoType of itav is not crlStatusList.
  • OSSL_CMP_ITAV_new_crls() β€” creates a new OSSL_CMP_ITAV structure of type crls, including an empty list of CRLs if the crl argument is NULL, or including a singleton list with a copy of the provided CRL otherwise. πŸŽ€
  • OSSL_CMP_ITAV_get0_crls() β€” on success, assigns to *out an internal pointer to the list of CRLs contained in the infoValue field of itav. the pointer may be NULL if no CRL is included. and again, it is an error if the infoType of itav is not crls.
  • OSSL_CMP_ITAV_new0_certReqTemplate() β€” creates an OSSL_CMP_ITAV structure of type certReqTemplate. and here's the tea:
    • if certTemplate is NULL then keySpec must also be NULL, and the resulting ITAV can be used in a genm message to obtain the requirements a PKI has on the certificate template used to request certificates β€” or in a genp message stating that there are no such requirements.
    • otherwise, the resulting ITAV includes a CertReqTemplateValue structure with certTemplate of type OSSL_CRMF_CERTTEMPLATE and an optional list of key specifications keySpec, each being of type OSSL_CMP_ATAV β€” and the resulting ATAV can be used in a genp message to provide requirements. periodt. πŸ‘‘
  • OSSL_CMP_ITAV_get1_certReqTemplate() β€” requires that itav has type certReqTemplate. it assigns NULL to *certTemplate if no OSSL_CRMF_CERTTEMPLATE structure with a certificate template value is in itav, otherwise a copy of the certTemplate field value. If keySpec is not NULL, it's assigned NULL if the structure is not present in itav or the keySpec field is absent. Otherwise, the function checks that all elements of the keySpec field are of type algId or rsaKeyLen, and assigns to *keySpec a copy of the keySpec field. (notice the get1 β€” copies! not internal pointers! iconic of it.) πŸ¦‹

πŸ“ NOTES πŸ“

CMP is defined in RFC 9810. that's the citation, bestie, we love a spec reference 🫢


πŸ”₯ RETURN VALUES πŸ”₯

  • OSSL_CMP_ITAV_new_caCerts(), OSSL_CMP_ITAV_new_rootCaCert(), OSSL_CMP_ITAV_new_rootCaKeyUpdate(), OSSL_CMP_CRLSTATUS_new1(), OSSL_CMP_CRLSTATUS_create(), OSSL_CMP_ITAV_new0_crlStatusList(), OSSL_CMP_ITAV_new_crls() and OSSL_CMP_ITAV_new0_certReqTemplate() β€” return a pointer to the new ITAV structure on success, or NULL on error.
  • OSSL_CMP_ITAV_get0_caCerts(), OSSL_CMP_ITAV_get0_rootCaCert(), OSSL_CMP_ITAV_get0_rootCaKeyUpdate(), OSSL_CMP_CRLSTATUS_get0(), OSSL_CMP_ITAV_get0_crlStatusList(), OSSL_CMP_ITAV_get0_crls() and OSSL_CMP_ITAV_get1_certReqTemplate() β€” return 1 on success, 0 on error.

so like: creators give you a pointer or NULL, getters give you 1 or 0. easy. πŸ’–


πŸ‘€ SEE ALSO πŸ‘€

go read these next, bestie, they're the sibling pages:


⭐ HISTORY ⭐

  • OSSL_CMP_ITAV_new_caCerts(), OSSL_CMP_ITAV_get0_caCerts(), OSSL_CMP_ITAV_new_rootCaCert(), OSSL_CMP_ITAV_get0_rootCaCert(), OSSL_CMP_ITAV_new_rootCaKeyUpdate(), and OSSL_CMP_ITAV_get0_rootCaKeyUpdate() were added in OpenSSL 3.2.
  • OSSL_CMP_CRLSTATUS_new1(), OSSL_CMP_CRLSTATUS_create(), OSSL_CMP_CRLSTATUS_get0(), OSSL_CMP_ITAV_new0_crlStatusList(), OSSL_CMP_ITAV_get0_crlStatusList(), OSSL_CMP_ITAV_new_crls(), OSSL_CMP_ITAV_get0_crls(), OSSL_CMP_ITAV_new0_certReqTemplate() and OSSL_CMP_ITAV_get1_certReqTemplate() were added in OpenSSL 3.4.

glow-up timeline fr fr 🌈


Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.

bestie this is a legal bit, don't skip it, the License does not play πŸ’€

and that's the whole page!! πŸŽ€ mwah πŸ’‹ β€” signed off from the 3.5.6 edition, dated 2026-04-07, right there in the footer as OSSL_CMP_ITAV_NEW_CACERTS(3ossl). go forth and handle your genm and genp messages, queen πŸ‘‘βœ¨

πŸ“¦ where this page comes from