forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestsetengine.cc
44 lines (34 loc) · 941 Bytes
/
testsetengine.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <openssl/engine.h>
#ifndef ENGINE_CMD_BASE
# error did not get engine.h
#endif
#define TEST_ENGINE_ID "testsetengine"
#define TEST_ENGINE_NAME "dummy test engine"
#ifdef _WIN32
# define DEFAULT_VISIBILITY __declspec(dllexport)
#else
# define DEFAULT_VISIBILITY __attribute__((visibility("default")))
#endif
namespace {
int EngineInit(ENGINE* engine) {
return 1;
}
int EngineFinish(ENGINE* engine) {
return 1;
}
int EngineDestroy(ENGINE* engine) {
return 1;
}
int bind_fn(ENGINE* engine, const char* id) {
ENGINE_set_id(engine, TEST_ENGINE_ID);
ENGINE_set_name(engine, TEST_ENGINE_NAME);
ENGINE_set_init_function(engine, EngineInit);
ENGINE_set_finish_function(engine, EngineFinish);
ENGINE_set_destroy_function(engine, EngineDestroy);
return 1;
}
extern "C" {
DEFAULT_VISIBILITY IMPLEMENT_DYNAMIC_CHECK_FN();
DEFAULT_VISIBILITY IMPLEMENT_DYNAMIC_BIND_FN(bind_fn);
}
} // anonymous namespace