OSSL_CMP_ITAV_NEW_CACERTS(3ossl)
π 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_caCertsOSSL_CMP_ITAV_get0_caCertsOSSL_CMP_ITAV_new_rootCaCertOSSL_CMP_ITAV_get0_rootCaCertOSSL_CMP_ITAV_new_rootCaKeyUpdateOSSL_CMP_ITAV_get0_rootCaKeyUpdateOSSL_CMP_CRLSTATUS_new1OSSL_CMP_CRLSTATUS_createOSSL_CMP_CRLSTATUS_get0OSSL_CMP_ITAV_new0_crlStatusListOSSL_CMP_ITAV_get0_crlStatusListOSSL_CMP_ITAV_new_crlsOSSL_CMP_ITAV_get0_crlsOSSL_CMP_ITAV_new0_certReqTemplateOSSL_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-newOSSL_CMP_ITAVstructure of typecaCertsand fills it up with a copy of the certificate list you hand it. Also, thecaCertsargument is allowed to beNULL, or to contain literally any number of certificates. zero, one, forty. no judgement. πOSSL_CMP_ITAV_get0_caCerts()β this one requires thatitavhas typecaCerts, ok? it assignsNULLto*outif there are no CA certificates initavβ otherwise it gives you the internal pointer of typeSTACK_OF(X509)with the certificates that are present. note the "internal" part, that's the wholeget0vibe π«ΆOSSL_CMP_ITAV_new_rootCaCert()β creates a newOSSL_CMP_ITAVstructure of typerootCaCertthat includes the optionally given certificate.OSSL_CMP_ITAV_get0_rootCaCert()β requires thatitavhas typerootCaCert. assignsNULLto*outif no certificate is included initav, otherwise it's the internal pointer to the certificate contained in theinfoValuefield.OSSL_CMP_ITAV_new_rootCaKeyUpdate()β creates a newOSSL_CMP_ITAVstructure of typerootCaKeyUpdate, and it includes aRootCaKeyUpdateContentstructure with the optionalnewWithNew,newWithOld, andoldWithNewcertificates. heads up though: anRootCaKeyUpdateContentstructure is included only ifnewWithNewis notNULL. like, that's the gate. β¨OSSL_CMP_ITAV_get0_rootCaKeyUpdate()β requires thatitavhas infoTyperootCaKeyUpdate. If an update of a root CA certificate is included, it assigns to*newWithNewthe internal pointer to the certificate contained in thenewWithNewinfoValuesub-field ofitav. IfnewWithOldis notNULL, it assigns to*newWithOldthe internal pointer to the certificate contained in thenewWithOldinfoValuesub-field ofitav. IfoldWithNewis notNULL, it assigns to*oldWithNewthe internal pointer to the certificate contained in theoldWithNewinfoValuesub-field ofitav. Each of these pointers gets set toNULLif no root CA certificate update is present, or if the respective sub-field isn't included. so like,NULLeverywhere. it's giving cautious. πOSSL_CMP_CRLSTATUS_new1()β allocates a newOSSL_CMP_CRLSTATUSstructure containing either a copy of the distribution point namedpnor a copy of the certificate issuerissuer. β οΈ and giving both is an error, bestie, do not. If given, a copy of the CRL issuance timethisUpdateis also included.OSSL_CMP_CRLSTATUS_create()β the high-level variant ofOSSL_CMP_CRLSTATUS_new1(). icon behaviour:- it fills the
thisUpdatefield with a copy of thethisUpdatefield ofcrlβ if present. - it fills the
CRLSourcefield with a copy of the first data item found using thecrland/orcertparameters, like this: any available distribution point name is preferred over issuer names. data fromcert, if present, is preferred over data fromcrl. - if no distribution point names are available, candidate issuer names are taken from the following sources, as far as present:
- the list of distribution points in the first
cRLDistributionPointsextension ofcert, - the issuer field of the authority key identifier of
cert, - the issuer DN of
cert, - the issuer field of the authority key identifier of
crl, and - the issuer DN of
crl.
- the list of distribution points in the first
- it fills the
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 ofcrlstatusand assigns them to*dpn,*issuer, and*thisUpdate.*thisUpdateis assigned only if thethisUpdateargument is notNULL. depending on the choice present, either*dpnor*issuerwill beNULL.*thisUpdatecan also beNULLif the field isn't present. it's giving "it depends". πOSSL_CMP_ITAV_new0_crlStatusList()β creates a newOSSL_CMP_ITAVstructure of typecrlStatusListthat includes the optionally given list of CRL status data, each of which is of typeOSSL_CMP_CRLSTATUS.OSSL_CMP_ITAV_get0_crlStatusList()β on success, assigns to*outan internal pointer to the list of CRL status data in theinfoValuefield ofitav. that pointer may beNULLif no CRL status data is included. and it is an error if theinfoTypeofitavis notcrlStatusList.OSSL_CMP_ITAV_new_crls()β creates a newOSSL_CMP_ITAVstructure of typecrls, including an empty list of CRLs if thecrlargument isNULL, or including a singleton list with a copy of the provided CRL otherwise. πOSSL_CMP_ITAV_get0_crls()β on success, assigns to*outan internal pointer to the list of CRLs contained in theinfoValuefield ofitav. the pointer may beNULLif no CRL is included. and again, it is an error if theinfoTypeofitavis notcrls.OSSL_CMP_ITAV_new0_certReqTemplate()β creates anOSSL_CMP_ITAVstructure of typecertReqTemplate. and here's the tea:- if
certTemplateisNULLthenkeySpecmust also beNULL, and the resulting ITAV can be used in agenmmessage to obtain the requirements a PKI has on the certificate template used to request certificates β or in agenpmessage stating that there are no such requirements. - otherwise, the resulting ITAV includes a
CertReqTemplateValuestructure withcertTemplateof typeOSSL_CRMF_CERTTEMPLATEand an optional list of key specificationskeySpec, each being of typeOSSL_CMP_ATAVβ and the resulting ATAV can be used in agenpmessage to provide requirements. periodt. π
- if
OSSL_CMP_ITAV_get1_certReqTemplate()β requires thatitavhas typecertReqTemplate. it assignsNULLto*certTemplateif noOSSL_CRMF_CERTTEMPLATEstructure with a certificate template value is initav, otherwise a copy of thecertTemplatefield value. IfkeySpecis notNULL, it's assignedNULLif the structure is not present initavor thekeySpecfield is absent. Otherwise, the function checks that all elements of thekeySpecfield are of typealgIdorrsaKeyLen, and assigns to*keySpeca copy of thekeySpecfield. (notice theget1β 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()andOSSL_CMP_ITAV_new0_certReqTemplate()β return a pointer to the new ITAV structure on success, orNULLon 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()andOSSL_CMP_ITAV_get1_certReqTemplate()β return1on success,0on 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(), andOSSL_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()andOSSL_CMP_ITAV_get1_certReqTemplate()were added in OpenSSL 3.4.
glow-up timeline fr fr π
Β©οΈ COPYRIGHT Β©οΈ
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
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms