LIBRESSL-SSL_CTX_GET_EX_NEW_INDEX(3)
π SSL_CTX_GET_EX_NEW_INDEX(3) β like, the manual page, bestie
okay so this is a page from the Library Functions Manual (yes, that manual, the libssl one, we're in the big leagues now) and it's about the internal application-specific data functions. ngl the name is a whole mouthful but stay with me, it's actually slay once you get it π
β¨ NAME β¨
SSL_CTX_get_ex_new_index, SSL_CTX_set_ex_data, SSL_CTX_get_ex_data β the internal application specific data functions. basically the little secret pockets where you stash your own stuff inside OpenSSL structs π«Ά
πΈ SYNOPSIS πΈ
library βlibsslβ libcrypto #include <openssl/ssl.h>
int
SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int
SSL_CTX_set_ex_data(SSL_CTX *ctx, int idx, void *arg);
void *
SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx);
aaand the typedefs, which you should copy exactly because they are literally the whole vibe of how the callbacks look π:
typedef int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
typedef void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
typedef int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
int idx, long argl, void *argp);
π¦ DESCRIPTION π¦
so like, several OpenSSL structures can have application specific data attached to them. cute, right? these functions are used internally by OpenSSL to manipulate that application specific data attached to a specific structure β think of them as the backstage crew, not the main character energy, but the show does not go on without them π
SSL_CTX_get_ex_new_index()β used to register a new index for application specific data. like reserving your seat in the struct, periodt β¨SSL_CTX_set_ex_data()β used to store application data atargforidxinto thectxobject. your stuff, your index, your pocket πSSL_CTX_get_ex_data()β used to retrieve the information foridxfromctx. grabbing it back out, iconic behaviour π§
a detailed description for the *_get_ex_new_index() functionality can be found in RSA_get_ex_new_index(3). the *_get_ex_data() and *_set_ex_data() functionality is described in CRYPTO_set_ex_data(3). go read those if you want the deep lore, i'm not gatekeeping the references, iykyk π
π₯ SEE ALSO π₯
π HISTORY π
SSL_CTX_get_ex_new_index(), SSL_CTX_set_ex_data(), and SSL_CTX_get_ex_data() first appeared in SSLeay 0.9.0 and have been available since OpenBSD 2.4. so they're like, vintage vintage β older than most of us and still serving πβ
π«Ά friendly little reminder: nothing here is dangerous, it's just internal machinery. keep the details exactly as written and you're golden π
and that's the page! brought to you by the Debian crew, dated June 8, 2025, filed under SSL_CTX_GET_EX_NEW_INDEX(3). mwah, go forth and attach your data responsibly, bestie π
πΈ
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2001, 2005 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