aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src/engine.h
diff options
context:
space:
mode:
authorDoug Hogan <[email protected]>2018-12-20 01:58:21 -0800
committerDoug Hogan <[email protected]>2018-12-20 02:30:24 -0800
commitfe281a6554a32d654fca40bd65cdafe77140aa9f (patch)
tree32463439c1021ce7032472dfb1f674c6e3a31170 /lib/crypto/c_src/engine.h
parentaef4b2076a33aaebf9e555eca10ead1b89a70d60 (diff)
downloadotp-fe281a6554a32d654fca40bd65cdafe77140aa9f.tar.gz
otp-fe281a6554a32d654fca40bd65cdafe77140aa9f.tar.bz2
otp-fe281a6554a32d654fca40bd65cdafe77140aa9f.zip
Move most engine code to a separate file
Diffstat (limited to 'lib/crypto/c_src/engine.h')
-rw-r--r--lib/crypto/c_src/engine.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/crypto/c_src/engine.h b/lib/crypto/c_src/engine.h
new file mode 100644
index 0000000000..4260368f4f
--- /dev/null
+++ b/lib/crypto/c_src/engine.h
@@ -0,0 +1,35 @@
+#ifndef E_ENGINE_H__
+#define E_ENGINE_H__ 1
+
+#include "common.h"
+
+#ifdef HAS_ENGINE_SUPPORT
+struct engine_ctx {
+ ENGINE *engine;
+ char *id;
+};
+
+extern ErlNifResourceType* engine_ctx_rtype;
+
+int get_engine_and_key_id(ErlNifEnv *env, ERL_NIF_TERM key, char ** id, ENGINE **e);
+char *get_key_password(ErlNifEnv *env, ERL_NIF_TERM key);
+void engine_ctx_dtor(ErlNifEnv* env, struct engine_ctx* ctx);
+#endif /* HAS_ENGINE_SUPPORT */
+
+ERL_NIF_TERM engine_by_id_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_finish_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_free_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_load_dynamic_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_ctrl_cmd_strings_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_register_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_unregister_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_add_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_remove_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_get_first_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_get_next_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_get_id_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_get_name_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM engine_get_all_methods_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+
+#endif /* E_ENGINE_H__ */