OSSL_CMP_ATAV_SET0(3SSL)
π NAME π
okay bestie, gather round, this is the OSSL_CMP_ATAV squad and their little utility glow-up corner β part of the OpenSSL manual, section 3SSL, no big deal π
The whole crew: 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 β collectively known as the OSSL_CMP_ATAV utility functions β¨
π¦ 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 π
So OSSL_CMP_ATAV is literally just a cute nickname for OSSL_CRMF_ATTRIBUTETYPEANDVALUE, which is defined over in RFC 4211 Appendix B. Where does it show up? Mainly in CertRequest structures, but also in CertReqTemplateContent structures when we're talking key specifications. It's giving "small but booked and busy" β¨
OSSL_CMP_ATAV_create()β makes a brand-newOSSL_CMP_ATAVstructure and fills it all in. It's lowkey justOSSL_CMP_ATAV_new()andOSSL_CMP_ATAV_set0()combined into one iconic move πOSSL_CMP_ATAV_set0()β sets the atav with aninfoTypeof type and aninfoValueof value. The pointers type and value may beNULL, but if they're not, bestie, you must not free them up after the call, because their ownership has been transferred to atav. Ownership transfer, periodt. And heads up: theitavpointer must not beNULL. π¨OSSL_CMP_ATAV_get0_type()β hands you a direct pointer to theinfoTypein the atav, unless it'sNULL, in which case... yeah.OSSL_CMP_ATAV_get0_value()β gives you a direct pointer to theinfoValuein the atav as a genericASN1_TYPEpointer, unless atav isNULL.OSSL_CMP_ATAV_new_algId()β creates a shiny newOSSL_CMP_ATAVstructure of typealgIdand fills it in with a copy of the given alg.OSSL_CMP_ATAV_get0_algId()β returns a direct pointer to thealgIdinfoValuein the atav of typeX509_ALGOR, orNULLif atav isNULLor doesn't contain analgId.OSSL_CMP_ATAV_new_rsaKeyLen()β creates a newOSSL_CMP_ATAVstructure of typersaKeyLenand fills it in with the given len, which must be positive. That's the vibe check, fr fr. β¨OSSL_CMP_ATAV_get_rsaKeyLen()β returns the RSA key length inrsaKeyLeninfoValuein the atav. It returns-1if atav isNULL, or doesn't contain anrsaKeyLen, or it cannot be parsed; or-2if the value is less than 1 or is greater thanINT_MAX. π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. Iconic behaviour honestly.OSSL_CMP_ATAV_free()β deallocates atav. It is defined as a macro, fyi. π«Ά
π NOTES π
CMP is defined in RFC 9810. CRMF is defined in RFC 4211. iykyk π
π RETURN VALUES π
OSSL_CMP_ATAV_create(),OSSL_CMP_ATAV_new_algId(), andOSSL_CMP_ATAV_new_rsaKeyLen()β return a pointer to theATAVstructure on success, orNULLon error. Slay or fail, no in-between.OSSL_CMP_ATAV_set0()andOSSL_CMP_ATAV_free()β do not return a value. They're above returning things, respectfully.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 related functions were added in OpenSSL 3.4. Baby's not even that old, and already this useful π
π 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 π go forth and build your ATAVs, stan OpenSSL, drink water, and don't leak those pointers π«Ά
mwah π β this was the 4.0.3 version of the OSSL_CMP_ATAV_SET0(3SSL) page, dated 2026-09-29, brought to you by the OpenSSL girlies β¨
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms