OSSL_CMP_ATAV_SET0(3ossl)

πŸ“¦ version 15.1, in freebsd 15.1

πŸ’… OSSL_CMP_ATAV_SET0 (3ossl) πŸ’…

okay so this is one of those OpenSSL man pages, bestie β€” it lives in the 3ossl section and it's literally called OSSL_CMP_ATAV_SET0(3ossl). grab a snack, we're doing ATAVs today πŸ“


✨ 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 whole OSSL_CMP_ATAV utility function squad 🫢

🌸 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 lowkey just a short hand for OSSL_CRMF_ATTRIBUTETYPEANDVALUE, which is defined in RFC 4211 Appendix B, iykyk. it's typically used in CertRequest structures β€” but it also shows up in CertReqTemplateContent structures for key specifications. main character in two places fr πŸ’…

  • OSSL_CMP_ATAV_create() β€” creates a shiny new OSSL_CMP_ATAV structure and fills it in. it literally combines OSSL_CMP_ATAV_new() and OSSL_CMP_ATAV_set0(), iconic combo πŸŽ€
  • OSSL_CMP_ATAV_set0() β€” sets the atav with an infoType of type and an infoValue of value. the pointers type and value may be NULL β€” otherwise they must not be freed up after the call, because their ownership is transferred to atav (no take-backsies, the atav owns them now πŸ‘‘). the itav pointer must not be NULL. (yes bestie, the page says itav right there β€” we don't question the manpage, we just vibe with it πŸ™ˆ)
  • OSSL_CMP_ATAV_get0_type() β€” returns a direct pointer to the infoType in the atav β€” unless it's NULL, in which case nope ✨
  • OSSL_CMP_ATAV_get0_value() β€” returns a direct pointer to the infoValue in the atav as a generic ASN1_TYPE pointer β€” unless atav is NULL, then no pointer for you πŸ’€
  • OSSL_CMP_ATAV_new_algId() β€” creates a new OSSL_CMP_ATAV structure of type algId and fills it in with a copy of the given alg. copy, not borrow, we're respectful like that 🫢
  • OSSL_CMP_ATAV_get0_algId() β€” returns a direct pointer to the algId infoValue in the atav of type X509_ALGOR, or NULL if atav is NULL or doesn't contain an algId. no algId, no pointer, periodt 🌈
  • OSSL_CMP_ATAV_new_rsaKeyLen() β€” creates a new OSSL_CMP_ATAV structure of type rsaKeyLen and fills it in with the given len, which must be positive. negative key lengths are not the vibe πŸ”₯
  • OSSL_CMP_ATAV_get_rsaKeyLen() β€” returns the RSA key length in the rsaKeyLen infoValue in the atav. it returns -1 if atav is NULL or doesn't contain an rsaKeyLen or it cannot be parsed, and -2 if the value is less than 1 or is greater than INT_MAX. yes, two whole different negative error codes, she's thorough πŸ’…
  • OSSL_CMP_ATAV_push1() β€” pushes a copy of atav to the stack of OSSL_CMP_ATAV pointed to by *sk_p. it creates a new stack if *sk_p points to NULL. so convenient, we love a self-starting stack 🌸
  • OSSL_CMP_ATAV_free() β€” deallocates atav. it's defined as a macro, just so you know πŸŽ€

⭐ NOTES ⭐

CMP is defined in RFC 9810. CRMF is defined in RFC 4211. cite your sources bestie, it's giving academic excellence πŸ“šβœ¨

πŸ’– RETURN VALUES πŸ’–

  • OSSL_CMP_ATAV_create(), OSSL_CMP_ATAV_new_algId(), and OSSL_CMP_ATAV_new_rsaKeyLen() β€” return a pointer to the ATAV structure on success, or NULL on error. slay or nada 😭
  • OSSL_CMP_ATAV_set0() and OSSL_CMP_ATAV_free() β€” do not return a value. they're above returning things πŸ’…
  • OSSL_CMP_ATAV_get0_type(), OSSL_CMP_ATAV_get0_value(), and OSSL_CMP_ATAV_get0_algId() β€” return the respective pointer, or NULL if their input is NULL. garbage in, NULL out, no cap πŸ™ˆ
  • OSSL_CMP_ATAV_get_rsaKeyLen() β€” returns a key length in bits, or < 0 on error. (and remember, -1 and -2 each mean their own specific thing, see above πŸ‘†)
  • OSSL_CMP_ATAV_push1() β€” returns 1 on success, 0 on error. binary queen πŸ‘‘

🧚 SEE ALSO 🧚

OSSL_CMP_ITAV_new0_certReqTemplate(3), ASN1_TYPE_set(3) β€” go read these next, bestie, they're in the same friend group πŸ¦‹

πŸ”₯ HISTORY πŸ”₯

The OSSL_CMP_ATAV type and related functions were added in OpenSSL 3.4. new-ish, but already iconic ✨

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>.


okay that's the whole page, you ate that πŸ“ one last thing before you close the tab: this was version 3.5.6, dated 2026-04-07, and it's the OSSL_CMP_ATAV_SET0(3ossl) page β€” mwah, bye bestie πŸ’œπŸŽ€

πŸ“¦ where this page comes from