BIO_GET_EX_NEW_INDEX(3)
π BIO_GET_EX_NEW_INDEX(3) π
hey bestie π«Ά welcome to BIO_GET_EX_NEW_INDEX(3) β this one lives in the Library Functions Manual, and it's the whole application-specific-data situation. no cap, it's giving βone page, lots of aliasesβ energy π
π NAME π
okay so the name section is basically a group chat roll call for all the functions that handle application-specific data:
BIO_get_ex_new_indexBIO_set_ex_dataBIO_get_ex_dataBIO_set_app_dataBIO_get_app_dataUI_get_ex_new_indexUI_set_ex_dataUI_get_ex_dataX509_get_ex_new_indexX509_set_ex_dataX509_get_ex_dataEC_KEY_get_ex_new_indexEC_KEY_get_ex_dataEC_KEY_set_ex_data
β and yes, that final dash is literally application-specific data. iconic β¨
πΈ SYNOPSIS πΈ
bestie, grab these includes exactly as written β no freestyling the headers, okay? π
#include <openssl/bio.h>
#include <openssl/ui.h>
#include <openssl/x509.h>
#include <openssl/ec.h>
int
TYPE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int
TYPE_set_ex_data(TYPE *d, int idx, void *arg);
void *
TYPE_get_ex_data(TYPE *d, int idx);
int
TYPE_set_app_data(TYPE *d, void *arg);
void *
TYPE_get_app_data(TYPE *d);
π¦ DESCRIPTION π¦
okay so in this description, TYPE is used as a placeholder for any of the OpenSSL datatypes listed in CRYPTO_get_ex_new_index(3). it's not one specific type, it's the βinsert your fave datatype hereβ vibe π
these functions handle application-specific data in OpenSSL data structures. their usage is identical to that of RSA_get_ex_new_index(3), RSA_set_ex_data(3), and RSA_get_ex_data(3). literally the same energy, different type π«
TYPE_get_ex_new_index()β this is a macro that callsCRYPTO_get_ex_new_index(3)with the correct index value. macro slay πTYPE_set_ex_data()β this is a function that callsCRYPTO_set_ex_data(3)with an offset into the opaqueex_datapart of theTYPEobject.TYPE_get_ex_data()β this is a function that callsCRYPTO_get_ex_data(3)with an offset into the opaqueex_datapart of theTYPEobject.
π¨ deprecated alert, bestie:TYPE_set_app_data()andTYPE_get_app_data()are deprecated wrapper macros that callTYPE_set_ex_data()andTYPE_get_ex_data()withidxset to0. so cute, so legacy, so βwe don't really do that anymoreβ π
β RETURN VALUES β
TYPE_get_new_ex_index()β returns a new index on success or-1on error. (yep, that's the spelling on the page β I'm not editing the icon π)TYPE_set_ex_data()andTYPE_set_app_data()β return1on success or0on error.TYPE_get_ex_data()andTYPE_get_app_data()β return the application data orNULLif an error occurred.
π₯ SEE ALSO π₯
the βgo read these nextβ lineup, periodt:
π HISTORY π
history lesson, but make it lore π§:
BIO_set_app_data()andBIO_get_app_data()first appeared in SSLeay 0.8.1.BIO_get_ex_new_index(),BIO_set_ex_data(), andBIO_get_ex_data()first appeared in SSLeay 0.9.0. these functions have been available since OpenBSD 2.4.X509_get_ex_new_index(),X509_set_ex_data(), andX509_get_ex_data()first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7.UI_get_ex_new_index(),UI_set_ex_data(), andUI_get_ex_data()first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.EC_KEY_get_ex_new_index(),EC_KEY_set_ex_data(), andEC_KEY_get_ex_data()first appeared in OpenSSL 1.1.0 and have been available since OpenBSD 6.5.
okay that's the whole page, mwah π this cutie came from Debian, dated November 19, 2023, and the page tag is BIO_GET_EX_NEW_INDEX(3) π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: libressl-devel-doc 4.1.0-bp160.1.1 Β· OpenSSL
- Copyright (c) 2015, 2016 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms