xref: /third_party/node/test/addons/openssl-test-engine/testsetengine.cc (revision 1cb0ef41)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/addons/openssl-test-engine/
1#include <openssl/engine.h>
2
3#ifndef ENGINE_CMD_BASE
4# error did not get engine.h
5#endif
6
7#define TEST_ENGINE_ID      "testsetengine"
8#define TEST_ENGINE_NAME    "dummy test engine"
9
10#ifdef _WIN32
11# define DEFAULT_VISIBILITY __declspec(dllexport)
12#else
13# define DEFAULT_VISIBILITY __attribute__((visibility("default")))
14#endif
15
16namespace {
17
18int EngineInit(ENGINE* engine) {
19  return 1;
20}
21
22int EngineFinish(ENGINE* engine) {
23  return 1;
24}
25
26int EngineDestroy(ENGINE* engine) {
27  return 1;
28}
29
30int bind_fn(ENGINE* engine, const char* id) {
31  ENGINE_set_id(engine, TEST_ENGINE_ID);
32  ENGINE_set_name(engine, TEST_ENGINE_NAME);
33  ENGINE_set_init_function(engine, EngineInit);
34  ENGINE_set_finish_function(engine, EngineFinish);
35  ENGINE_set_destroy_function(engine, EngineDestroy);
36  return 1;
37}
38
39extern "C" {
40  DEFAULT_VISIBILITY IMPLEMENT_DYNAMIC_CHECK_FN();
41  DEFAULT_VISIBILITY IMPLEMENT_DYNAMIC_BIND_FN(bind_fn);
42}
43
44}  // anonymous namespace
45

Indexes created Thu Nov 07 10:32:03 CST 2024