OSSL_CMP_ATAV_SET0(3ossl)
π OSSL_CMP_ATAV_SET0(3ossl) π
okay bestie, sit down, hydrate, and let me tell you about the OSSL_CMP_ATAV squad β that's the OpenSSL CMP utility function family, from the OSSL_CMP_ATAV_SET0(3ossl) manual page, and yes it's giving "niche but iconic" π
β¨ NAME β¨
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, OSSL_CMP_ATAV_free β 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 π¦
OSSL_CMP_ATAV is basically the short-hand bestie of OSSL_CRMF_ATTRIBUTETYPEANDVALUE, which is defined in RFC 4211 Appendix B. You'll usually see it chillin' inside CertRequest structures, but it also pops up in CertReqTemplateContent structures for key specifications. versatile queen π
OSSL_CMP_ATAV_create()β makes a brand-newOSSL_CMP_ATAVstructure and fills it in. It's literallyOSSL_CMP_ATAV_new()andOSSL_CMP_ATAV_set0()combined into one slay move. β¨OSSL_CMP_ATAV_set0()β sets the atav with an infoType of type and an infoValue of value. The pointers type and value can beNULL, but otherwise you must not free them up after the call, because their ownership gets transferred to atav. and the itav pointer? that one must not beNULL. no cap.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.OSSL_CMP_ATAV_new_algId()β creates a newOSSL_CMP_ATAVstructure of type algId and fills it in with a copy of the given alg.OSSL_CMP_ATAV_get0_algId()β returns a direct pointer to the algId infoValue in the atav of typeX509_ALGOR, orNULLif atav isNULLor just doesn't contain an algId.OSSL_CMP_ATAV_new_rsaKeyLen()β creates a newOSSL_CMP_ATAVstructure of type rsaKeyLen and fills it in with the given len, which must be positive. periodt.OSSL_CMP_ATAV_get_rsaKeyLen()β returns the RSA key length in the rsaKeyLen infoValue in the atav. It gives you-1if atav isNULL, or doesn't contain an rsaKeyLen, or it can't be parsed β or-2if the value is less than1or 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 whole new stack for you. queen behavior πOSSL_CMP_ATAV_free()β deallocates atav. fun fact: it's defined as a macro. π
π NOTES π
CMP is defined in RFC 9810. CRMF is defined in RFC 4211. π
π 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're above returning things, honestly)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 of the family fr fr πΌβ¨
π 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!! π«Ά this was OSSL_CMP_ATAV_SET0(3ossl) from OpenSSL 3.5.9, dated 2026-09-29 β mwah, go forth and handle your attribute type-and-values responsibly πππ¦
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms