-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathe_useless.c
More file actions
40 lines (31 loc) · 743 Bytes
/
e_useless.c
File metadata and controls
40 lines (31 loc) · 743 Bytes
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
#include <stdio.h>
#include <string.h>
#include <openssl/engine.h>
static const char *engine_id = "useless";
static const char *engine_name = "A useless engine for demonstration purposes";
static int bind(ENGINE *e, const char *id)
{
static int loaded = 0;
int ret = 0;
if (id && strcmp(id, engine_id)) {
goto end;
}
if (loaded) {
fprintf(stderr, "Useless engine already loaded\n");
goto end;
}
loaded = 1;
if (!ENGINE_set_id(e, engine_id)) {
fprintf(stderr, "ENGINE_set_id failed\n");
goto end;
}
if (!ENGINE_set_name(e, engine_name)) {
printf("ENGINE_set_name failed\n");
goto end;
}
ret = 1;
end:
return ret;
}
IMPLEMENT_DYNAMIC_BIND_FN(bind)
IMPLEMENT_DYNAMIC_CHECK_FN()