Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
NAME
CRYPTO_get_ex_new_index, CRYPTO_EX_new, CRYPTO_EX_free, CRYPTO_EX_dup, CRYPTO_new_ex_data, CRYPTO_set_ex_data, CRYPTO_get_ex_data, CRYPTO_free_ex_data — low-level functions for application specific dataSYNOPSIS
#include <openssl/crypto.h>CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
CRYPTO_EX_new(void *parent, void *data, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp);
CRYPTO_EX_free(void *parent, void *data, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp);
CRYPTO_EX_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, void *datap, int idx, long argl, void *argp);
CRYPTO_new_ex_data(int class_index, void *parent, CRYPTO_EX_DATA *ad);
CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *data);
CRYPTO_get_ex_data(CRYPTO_EX_DATA *ad, int idx);
CRYPTO_free_ex_data(int class_index, void *parent, CRYPTO_EX_DATA *ad);
DESCRIPTION
The library implements the functions documented in the RSA_get_ex_new_index(3) manual page and similar functions for other parent object types using the functions documented in the present manual page. Application programs almost never need to call the functions documented here directly.- parent
- the parent object that contains the data
- data
- the data previously set by CRYPTO_set_ex_data() at idx in parent
- ad
- the CRYPTO_EX_DATA subobject of the parent object
- idx
- return value of CRYPTO_get_ex_new_index() that set this callback
- argl
- the argl passed to CRYPTO_get_ex_new_index() for this idx
- argp
- the argp passed to CRYPTO_get_ex_new_index() for this idx
- to
- the CRYPTO_EX_DATA subobject of the new parent object
- from
- the CRYPTO_EX_DATA subobject of the original parent object
- datap
- a pointer to a copy of the pointer to the original ex_data
- idx
- return value of CRYPTO_get_ex_new_index() that set this callback
- argl
- the argl passed to CRYPTO_get_ex_new_index() for this idx
- argp
- the argp passed to CRYPTO_get_ex_new_index() for this idx
char *orig_data = *(char **)datap;
char *new_data; if ((new_data = strdup(orig_data)) == NULL) return 0;
*(char **)datap = new_data; return 1;
RETURN VALUES
CRYPTO_get_ex_new_index() returns a new index equal to or greater than 1 or -1 if memory allocation fails.ERRORS
After failure of CRYPTO_get_ex_new_index(), CRYPTO_new_ex_data(), or CRYPTO_set_ex_data(), the following diagnostic can be retrieved with ERR_get_error(3), ERR_GET_REASON(3), and ERR_reason_error_string(3):- ERR_R_MALLOC_FAILURE “malloc failure”
- Memory allocation failed.