LIBRESSL-SSL_SESSION_GET_EX_NEW_INDEX(3)
π¦ SSL_SESSION_GET_EX_NEW_INDEX(3) β Library Functions Manual π¦
okay bestie, pull up a chair π
this one lives in the Library Functions Manual and it's all about the little secret pocket of app-specific data you can stash inside an SSL_SESSION β the internal application specific data functions, as the suits would say β¨
πΈ NAME πΈ
SSL_SESSION_get_ex_new_index, SSL_SESSION_set_ex_data, SSL_SESSION_get_ex_data β the internal application specific data functions, aka the β¨custom-extra-dataβ¨ squad π«Ά
heads up bestie: the page header at the top is actually truncated toSSL_SESSION_GET_EX_NEW_I(3)(ikr, somebody ran out of room π). The real full name isSSL_SESSION_GET_EX_NEW_INDEX(3). Same icon, different wig π
β¨ SYNOPSIS β¨
first, the vibes check β you're linking against library "libssl" and libcrypto, and you'd better have this up top:
#include <openssl/ssl.h>
then the functions themselves, no cap:
int
SSL_SESSION_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_SESSION_set_ex_data(SSL_SESSION *session, int idx, void *arg);
void *
SSL_SESSION_get_ex_data(const SSL_SESSION *session, int idx);
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 here's the tea β β several OpenSSL structures can have application specific data attached to them. Like, you can glue your own little data blob onto a struct and it justβ¦ lives there π
These three functions are used internally by OpenSSL to manipulate that application-specific data attached to a specific structure. Internal bestie behavior, iykyk π
SSL_SESSION_get_ex_new_index()β registers a brand new index for application-specific data. Think of it as claiming your own lil locker number πβ¨SSL_SESSION_set_ex_data()β stores application data atargforidxinto the session object. Your stuff, your slot, slotted in π«ΆSSL_SESSION_get_ex_data()β retrieves the information foridxfromsession. The reunion moment ππ
and if you want the full deep-dive lore: 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 your lore, bestie π
β οΈ WARNINGS β οΈ
π¨ okay this part matters, do NOT skip it π¨
The application data is only maintained for sessions held in memory. That's it. That's the whole vibe. π
The application data is not included when dumping the session with i2d_SSL_SESSION(3) (and all functions indirectly calling the dump functions like PEM_write_SSL_SESSION(3) and PEM_write_bio_SSL_SESSION(3)) β and can therefore not be restored.
so likeβ¦ you dump the session, your data ghosts you. gone. β¨poofβ¨ no cap, it does not come back π
π₯ SEE ALSO π₯
π HISTORY π
SSL_SESSION_get_ex_new_index(), SSL_SESSION_set_ex_data(), and SSL_SESSION_get_ex_data() first appeared in SSLeay 0.9.0 and have been available since OpenBSD 2.4. literal elders of the game, we stan π«Άβ¨
and that's the whole page bestie! π this little number is from the Debian edition, dated June 8, 2025, and the manual tag on the door says SSL_SESSION_GET_EX_NEW_INDEX(3) β slay, go forth and register your indexes responsibly π π
π¦ 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