OSSL_CMP_ATAV_SET0(3ossl)
π
OSSL_CMP_ATAV β like, the whole ATAV situation (from openssl/cmp.h, manual page OSSL_CMP_ATAV_SET0(3ossl))
okay so bestie, welcome to the ATAV corner of OpenSSL's CMP world. this page is the whole glow-up: OSSL_CMP_ATAV, OSSL_CMP_ATAV_create, OSSL_CMP_ATAV_set0, OSSL_CMP_ATAV_get0_type, OSSL_CMP_ATAV_get0_value, OSSL_CMP_ATAV_new_algId, OSSL_CMP_ATAV_get0_algId, OSSL_CMP_ATAV_new_rsaKeyLen, OSSL_CMP_ATAV_get_rsaKeyLen, OSSL_CMP_ATAVS, OSSL_CMP_ATAV_push1, and OSSL_CMP_ATAV_free β all the ATAV utility functions, together, in one group chat. π
β¨ SYNOPSIS β¨
#include <openssl/cmp.h>
typedef OSSL_CRMF_ATTRIBUTETYPEANDVALUE OSSL_CMP_ATAV;
OSSL_CMP_ATAV *OSSL_CMP_ATAV_create(ASN1_OBJECT *type, ASN1_TYPE *value);
void OSSL_CMP_ATAV_set0(OSSL_CMP_ATAV *atav, ASN1_OBJECT *type,
ASN1_TYPE *value);
ASN1_OBJECT *OSSL_CMP_ATAV_get0_type(const OSSL_CMP_ATAV *atav);
ASN1_TYPE *OSSL_CMP_ATAV_get0_value(const OSSL_CMP_ATAV *atav);
OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_algId(const X509_ALGOR *alg);
X509_ALGOR *OSSL_CMP_ATAV_get0_algId(const OSSL_CMP_ATAV *atav);
OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_rsaKeyLen(int len);
int OSSL_CMP_ATAV_get_rsaKeyLen(const OSSL_CMP_ATAV *atav);
typedef STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) OSSL_CMP_ATAVS;
int OSSL_CMP_ATAV_push1(OSSL_CMP_ATAVS **sk_p, const OSSL_CMP_ATAV *atav);
void OSSL_CMP_ATAV_free(OSSL_CMP_ATAV *atav);
π¦ DESCRIPTION π¦
OSSL_CMP_ATAV is literally just shorthand for OSSL_CRMF_ATTRIBUTETYPEANDVALUE, which is defined in RFC 4211 Appendix B. it usually shows up in CertRequest structures, but it also pops up in CertReqTemplateContent structures for key specs. main character energy in two different structs, honestly. π
πΈ the constructor / setter girlies πΈ
OSSL_CMP_ATAV_create()β makes a shiny newOSSL_CMP_ATAVstructure and fills it in. it's basicallyOSSL_CMP_ATAV_new()andOSSL_CMP_ATAV_set0()combined, like a two-in-one. slay.OSSL_CMP_ATAV_set0()β sets the atav with an infoType of type and an infoValue of value. the type and value pointers may beNULL; if they're not, do not free them after the call, because ownership gets transferred to atav. also theitavpointer must not beNULL. π«Ά
ngl the ownership transfer is the whole vibe check here β you hand over the pointer, it's not yours anymore. periodt.
π the getters π
OSSL_CMP_ATAV_get0_type()β hands you a direct pointer to the infoType in the atav, unless it'sNULL.OSSL_CMP_ATAV_get0_value()β hands you a direct pointer to the infoValue in the atav as a genericASN1_TYPEpointer, unless atav isNULL.
π the algId girlies π
OSSL_CMP_ATAV_new_algId()β creates a newOSSL_CMP_ATAVstructure of typealgIdand fills it with a copy of the given alg. (a copy, bestie. we're not sharing.)OSSL_CMP_ATAV_get0_algId()β returns a direct pointer to thealgIdinfoValue in the atav, of typeX509_ALGOR, orNULLif atav isNULLor doesn't contain analgId.
π₯ the rsaKeyLen girlies π₯
OSSL_CMP_ATAV_new_rsaKeyLen()β creates a newOSSL_CMP_ATAVstructure of typersaKeyLenand fills it with the given len, which must be positive.OSSL_CMP_ATAV_get_rsaKeyLen()β returns the RSA key length from thersaKeyLeninfoValue in the atav. and now the lil exception menu, memorize it:-1if atav isNULL, or doesn't contain anrsaKeyLen, or it can't be parsed-2if the value is less than1or greater thanINT_MAXπ
π stack stuff π
OSSL_CMP_ATAV_push1()β pushes a copy of atav onto the stack ofOSSL_CMP_ATAVpointed to by*sk_p. if*sk_ppoints toNULL, it creates a new stack for you. generous queen.OSSL_CMP_ATAV_free()β deallocates atav. it's defined as a macro, iykyk.
π NOTES π
CMP is defined in RFC 4210. CRMF is defined in RFC 4211. that's the lore. π
β RETURN VALUES β
OSSL_CMP_ATAV_create(),OSSL_CMP_ATAV_new_algId(), andOSSL_CMP_ATAV_new_rsaKeyLen()β return a pointer to the ATAV structure on success, orNULLon error.OSSL_CMP_ATAV_set0()andOSSL_CMP_ATAV_free()β do not return a value. they simply do not participate in the return-value economy.OSSL_CMP_ATAV_get0_type(),OSSL_CMP_ATAV_get0_value(), andOSSL_CMP_ATAV_get0_algId()β return the respective pointer, orNULLif their input isNULL.OSSL_CMP_ATAV_get_rsaKeyLen()β returns a key length in bits, or< 0on error.OSSL_CMP_ATAV_push1()β returns1on success,0on error.
π SEE ALSO π
OSSL_CMP_ITAV_new0_certReqTemplate(3), ASN1_TYPE_set(3)
π§ HISTORY π§
the OSSL_CMP_ATAV type and its related functions were added in OpenSSL 3.4. so they're new-new, but not that new-new. β¨
π COPYRIGHT π
Copyright 2022-2024 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>.
and that's the whole page, bestie π«Ά β brought to you by OpenSSL 3.5.0, dated 2026-09-25, filed under OSSL_CMP_ATAV_SET0(3ossl). go forth and set your ATAVs responsibly. π
π
π¦ 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