BIO_GET_EX_NEW_INDEX(3ossl)
π BIO_GET_EX_NEW_INDEX π
okay so bestie, we're in BIO_GET_EX_NEW_INDEX(3ossl) territory, and this is the OpenSSL manual page for application-specific data β aka the little secret pocket you get to stuff your own stuff into when OpenSSL objects aren't giving you enough room. π
β¨ NAME β¨
BIO_get_ex_new_index, BIO_set_ex_data, BIO_get_ex_data, BIO_set_app_data, BIO_get_app_data, DH_get_ex_new_index, DH_set_ex_data, DH_get_ex_data, DSA_get_ex_new_index, DSA_set_ex_data, DSA_get_ex_data, EC_KEY_get_ex_new_index, EC_KEY_set_ex_data, EC_KEY_get_ex_data, ENGINE_get_ex_new_index, ENGINE_set_ex_data, ENGINE_get_ex_data, EVP_PKEY_get_ex_new_index, EVP_PKEY_set_ex_data, EVP_PKEY_get_ex_data, RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data, RSA_set_app_data, RSA_get_app_data, SSL_get_ex_new_index, SSL_set_ex_data, SSL_get_ex_data, SSL_set_app_data, SSL_get_app_data, SSL_CTX_get_ex_new_index, SSL_CTX_set_ex_data, SSL_CTX_get_ex_data, SSL_CTX_set_app_data, SSL_CTX_get_app_data, SSL_SESSION_get_ex_new_index, SSL_SESSION_set_ex_data, SSL_SESSION_get_ex_data, SSL_SESSION_set_app_data, SSL_SESSION_get_app_data, UI_get_ex_new_index, UI_set_ex_data, UI_get_ex_data, UI_set_app_data, UI_get_app_data, X509_STORE_CTX_get_ex_new_index, X509_STORE_CTX_set_ex_data, X509_STORE_CTX_get_ex_data, X509_STORE_CTX_set_app_data, X509_STORE_CTX_get_app_data, X509_STORE_get_ex_new_index, X509_STORE_set_ex_data, X509_STORE_get_ex_data, X509_get_ex_new_index, X509_set_ex_data, X509_get_ex_data β application-specific data π«Ά
likeβ¦ that's a LOT of names. it's giving "the whole group chat got invited." π
π SYNOPSIS π
#include <openssl/x509.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(const TYPE *d, int idx);
#define TYPE_set_app_data(TYPE *d, void *arg)
#define TYPE_get_app_data(TYPE *d)
now the messy part. the following functions have been deprecated since OpenSSL 3.0, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value β see openssl_user_macros(7):
int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int DH_set_ex_data(DH *type, int idx, void *arg);
void *DH_get_ex_data(DH *type, int idx);
int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int DSA_set_ex_data(DSA *type, int idx, void *arg);
void *DSA_get_ex_data(DSA *type, int idx);
int EC_KEY_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int EC_KEY_set_ex_data(EC_KEY *type, int idx, void *arg);
void *EC_KEY_get_ex_data(EC_KEY *type, int idx);
int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int RSA_set_ex_data(RSA *type, int idx, void *arg);
void *RSA_get_ex_data(RSA *type, int idx);
int RSA_set_app_data(RSA *type, void *arg);
void *RSA_get_app_data(RSA *type);
int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int ENGINE_set_ex_data(ENGINE *type, int idx, void *arg);
void *ENGINE_get_ex_data(ENGINE *type, int idx);
π¦ DESCRIPTION π¦
so in all of this description, TYPE is just a placeholder standing in for any of the OpenSSL datatypes listed over in CRYPTO_get_ex_new_index(3). it's the "insert your fave here" of the manpage. π
okay, the sad part first:
- all functions with a
TYPEofDH,DSA,RSAandEC_KEYare deprecated. applications should instead useEVP_PKEY_set_ex_data(),EVP_PKEY_get_ex_data()andEVP_PKEY_get_ex_new_index(). π - all functions with a
TYPEofENGINEare deprecated. applications using engines should be replaced by providers. π«
now the actual vibe: these functions handle application-specific data for OpenSSL data structures. it's your lil VIP section. ποΈ
TYPE_get_ex_new_index()β this is a macro that callsCRYPTO_get_ex_new_index()with the correct index value. β¨TYPE_set_ex_data()β a function that callsCRYPTO_set_ex_data()with an offset into the opaque exdata part of theTYPEobject.dMUST NOT beNULL. no cap.TYPE_get_ex_data()β a function that callsCRYPTO_get_ex_data()with an offset into the opaque exdata part of theTYPEobject.dMUST NOT beNULL. again. don't do it. π
fun lore moment: for compatibility with previous releases, the exdata index of zero is reserved for "application data."
there are two convenience functions for that:
TYPE_set_app_data()β a macro that invokesTYPE_set_ex_data()withidxset to zero. πTYPE_get_app_data()β a macro that invokesTYPE_get_ex_data()withidxset to zero. π
π RETURN VALUES π
TYPE_get_ex_new_index()returns a new index on success or-1on error. πTYPE_set_ex_data()returns1on success or0on error.TYPE_get_ex_data()returns the application data orNULLif an error occurred. π
πΈ SEE ALSO πΈ
β HISTORY β
the following functions were deprecated in OpenSSL 3.0: DH_get_ex_new_index(), DH_set_ex_data(), DH_get_ex_data(), DSA_get_ex_new_index(), DSA_set_ex_data(), DSA_get_ex_data(), EC_KEY_get_ex_new_index(), EC_KEY_set_ex_data(), EC_KEY_get_ex_data(), ENGINE_get_ex_new_index(), ENGINE_set_ex_data(), ENGINE_get_ex_data(), RSA_get_ex_new_index(), RSA_set_ex_data(), RSA_get_ex_data(), RSA_set_app_data() and RSA_get_app_data().
likeβ¦ rest in peace besties, y'all served your time. πͺ¦β¨
π COPYRIGHT π
Copyright 2015-2021 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 thing, bestie!! π this page is from OpenSSL 3.5.9, dated 2026-09-29, and the manual page name is BIO_GET_EX_NEW_INDEX(3ossl) β go forth and store your little secrets responsibly. mwah. π
π«Άπ
π¦ 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