OSSL_CMP_ITAV_SET0(3ossl)
hiii bestie π welcome to OSSL_CMP_ITAV_SET0(3ossl), aka the 3ossl manual page for all the OpenSSL OSSL_CMP_ITAV utility functions. no cap, weβre gonna make ITAVs make sense together π«Άβ¨
π NAME π
the whole squad on this page is OSSL_CMP_ITAV_create, OSSL_CMP_ITAV_set0, OSSL_CMP_ITAV_get0_type, OSSL_CMP_ITAV_get0_value, OSSL_CMP_ITAV_push0_stack_item, OSSL_CMP_ITAV_new0_certProfile, and OSSL_CMP_ITAV_get0_certProfile β all of them are OSSL_CMP_ITAV utility functions π
π§ SYNOPSIS π§
include this header first, bestie:
#include <openssl/cmp.h>
OSSL_CMP_ITAV *OSSL_CMP_ITAV_create(ASN1_OBJECT *type, ASN1_TYPE *value);
void OSSL_CMP_ITAV_set0(OSSL_CMP_ITAV *itav, ASN1_OBJECT *type,
ASN1_TYPE *value);
ASN1_OBJECT *OSSL_CMP_ITAV_get0_type(const OSSL_CMP_ITAV *itav);
ASN1_TYPE *OSSL_CMP_ITAV_get0_value(const OSSL_CMP_ITAV *itav);
int OSSL_CMP_ITAV_push0_stack_item(STACK_OF(OSSL_CMP_ITAV) **itav_sk_p,
OSSL_CMP_ITAV *itav);
OSSL_CMP_ITAV
*OSSL_CMP_ITAV_new0_certProfile(STACK_OF(ASN1_UTF8STRING) *certProfile);
int OSSL_CMP_ITAV_get0_certProfile(const OSSL_CMP_ITAV *itav,
STACK_OF(ASN1_UTF8STRING) **out);
πΈ DESCRIPTION πΈ
okay so ITAV is short for InfoTypeAndValue. this type is defined in RFC 4210 section 5.3.19 and Appendix F. it gets used at various places in CMP messages, e.g. in the generalInfo PKIHeader field, to hold a key-value pair π
OSSL_CMP_ITAV_create()β creates a newOSSL_CMP_ITAVstructure and fills it in. it combinesOSSL_CMP_ITAV_new()andOSSL_CMP_ITAV_set0()β¨OSSL_CMP_ITAV_set0()β sets the itav with aninfoTypeof type and aninfoValueof value. this function uses the pointers type and value internally, so they must not be freed up after the call π¨OSSL_CMP_ITAV_get0_type()β returns a direct pointer to theinfoTypein the itav.OSSL_CMP_ITAV_get0_value()β returns a direct pointer to theinfoValuein the itav as a genericASN1_TYPEpointer.OSSL_CMP_ITAV_push0_stack_item()β pushes itav to the stack pointed to by*itav_sk_p. it creates a new stack if*itav_sk_ppoints toNULL.OSSL_CMP_ITAV_new0_certProfile()β creates a newOSSL_CMP_ITAVstructure of typecertProfilethat includes the optionally given list of profile names. on success, ownership of the list is with the newOSSL_CMP_ITAVstructure π«OSSL_CMP_ITAV_get0_certProfile()β on success assigns to*outan internal pointer to the list of certificate profile names contained in theinfoValuefield of itav. the pointer may beNULLif no profile name is included. it is an error if theinfoTypeof itav is notcertProfileπ€
π¦ NOTES π¦
CMP is defined in RFC 4210 and RFC 9480 (and CRMF in RFC 4211) π«Ά
OIDs to use as types in OSSL_CMP_ITAV can be found at <https://datatracker.ietf.org/doc/html/rfc9480#section-4.2.2>. the respective OpenSSL NIDs, such as NID_id_it_certProfile, are defined in the <openssl/obj_mac.h> header file π
π RETURN VALUES π
OSSL_CMP_ITAV_create()andOSSL_CMP_ITAV_new0_certProfile()return a pointer to an ITAV structure on success, orNULLon error.OSSL_CMP_ITAV_set0()does not return a value.OSSL_CMP_ITAV_get0_type()andOSSL_CMP_ITAV_get0_value()return the respective pointer orNULLif their input isNULL.OSSL_CMP_ITAV_push0_stack_item()andOSSL_CMP_ITAV_get0_certProfile()return1on success,0on error.
π₯ EXAMPLES π₯
the following code creates and sets a structure representing a generic InfoTypeAndValue sequence, using an OID created from text as type, and an integer as value. afterwards, it is pushed to the OSSL_CMP_CTX to be later included in the requests' PKIHeader's genInfo field π
ASN1_OBJECT *type = OBJ_txt2obj("1.2.3.4.5", 1);
if (type == NULL) ...
ASN1_INTEGER *asn1int = ASN1_INTEGER_new();
if (asn1int == NULL || !ASN1_INTEGER_set(asn1int, 12345)) ...
ASN1_TYPE *val = ASN1_TYPE_new();
if (val == NULL) ...
ASN1_TYPE_set(val, V_ASN1_INTEGER, asn1int);
OSSL_CMP_ITAV *itav = OSSL_CMP_ITAV_create(type, val);
if (itav == NULL) ...
if (!OSSL_CMP_CTX_push0_geninfo_ITAV(ctx, itav)) {
OSSL_CMP_ITAV_free(itav); /* also frees type and val */
...
}
...
OSSL_CMP_CTX_free(ctx); /* also frees itav */
π SEE ALSO π
go peek at these too, bestie:
β HISTORY β
the OpenSSL CMP support was added in OpenSSL 3.0 π±
OSSL_CMP_ITAV_new0_certProfile() and OSSL_CMP_ITAV_get0_certProfile() were added in OpenSSL 3.3 β¨
π COPYRIGHT π
Copyright 2007-2021 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>.
mwah π thatβs the whole vibe: OpenSSL version 3.5.0, dated 2026-09-25, page OSSL_CMP_ITAV_SET0(3ossl). go slay your ITAVs, bestie π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms