summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-11-11 18:38:57 +0100
committerRichard Levitte <levitte@openssl.org>2019-11-14 08:22:29 +0100
commit10e7216e502916f8e7917ac4f21411fffd1fb882 (patch)
tree1c5727e7b62607857842f329c51daaae7518b745 /include
parentc31950b964a2f3f7b9e6ad98076954178ee1e77d (diff)
CORE: Add a generic callback function type
This offers a very generic way to define a callback as well as calling it. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10412)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/core.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/openssl/core.h b/include/openssl/core.h
index 74a3bfb91e..bed580c811 100644
--- a/include/openssl/core.h
+++ b/include/openssl/core.h
@@ -187,6 +187,21 @@ extern OSSL_provider_init_fn OSSL_provider_init;
# pragma names restore
# endif
+/*
+ * Generic callback function signature.
+ *
+ * The expectation is that any provider function that wants to offer
+ * a callback / hook can do so by taking an argument with this type,
+ * as well as a pointer to caller-specific data. When calling the
+ * callback, the provider function can populate an OSSL_PARAM array
+ * with data of its choice and pass that in the callback call, along
+ * with the caller data argument.
+ *
+ * libcrypto may use the OSSL_PARAM array to create arguments for an
+ * application callback it knows about.
+ */
+typedef int (OSSL_CALLBACK)(const OSSL_PARAM params[], void *arg);
+
# ifdef __cplusplus
}
# endif