summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2019-04-30 15:15:48 +0100
committerMatt Caswell <matt@openssl.org>2019-05-02 22:42:09 +0100
commitb8fe36fee000970dcb7cd363f31445969cfbf677 (patch)
treefdd5d174ab39717a1634c659a4b41ad05ea5ecf0 /include
parent61783db5b5c4c5edbdb47d6a7d0393782e72685d (diff)
Add support for openssl_ctx_run_once and openssl_ctx_onfree
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8857)
Diffstat (limited to 'include')
-rw-r--r--include/internal/cryptlib.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/internal/cryptlib.h b/include/internal/cryptlib.h
index e791245ada..dae10e2bd2 100644
--- a/include/internal/cryptlib.h
+++ b/include/internal/cryptlib.h
@@ -105,6 +105,8 @@ uint32_t OPENSSL_rdtsc(void);
size_t OPENSSL_instrument_bus(unsigned int *, size_t);
size_t OPENSSL_instrument_bus2(unsigned int *, size_t, size_t);
+# define MAX_OPENSSL_CTX_RUN_ONCE 1
+
typedef struct openssl_ctx_method {
void *(*new_func)(void);
void (*free_func)(void *);
@@ -114,4 +116,10 @@ int openssl_ctx_new_index(const OPENSSL_CTX_METHOD *);
/* Functions to retrieve pointers to data by index */
void *openssl_ctx_get_data(OPENSSL_CTX *, int /* index */);
+typedef int (*openssl_ctx_run_once_fn)(OPENSSL_CTX *ctx);
+typedef void (*openssl_ctx_onfree_fn)(OPENSSL_CTX *ctx);
+
+int openssl_ctx_run_once(OPENSSL_CTX *ctx, unsigned int idx,
+ openssl_ctx_run_once_fn run_once_fn);
+int openssl_ctx_onfree(OPENSSL_CTX *ctx, openssl_ctx_onfree_fn onfreefn);
#endif