Skip to content

Commit 5a589e0

Browse files
authored
Merge pull request #106 from haydenroche5/stunnel_tests
Add script to run stunnel tests with wolfEngine.
2 parents ff1ca0d + 13300c2 commit 5a589e0

File tree

8 files changed

+701
-14
lines changed

8 files changed

+701
-14
lines changed

bench.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ int main(int argc, char *argv[])
11641164
const char *name = wolfengine_id;
11651165
#else
11661166
int staticBench = 0;
1167-
const char *name = wolfengine_lib;
1167+
const char *name = wolfengine_id;
11681168
#endif /* WE_NO_DYNAMIC_ENGINE */
11691169
const char *dir = ".libs";
11701170
int i;

include/wolfengine/we_wolfengine.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
#define WOLFENGINE_FAILURE 0
3030
#define WOLFENGINE_FATAL_ERROR -1
3131

32-
/* This is the ID expected by OpenSSL when loading wolfEngine dynamically. */
33-
extern const char *wolfengine_lib;
3432
/* Engine id - implementation uses wolfSSL */
3533
extern const char *wolfengine_id;
3634
/* Engine name ... or description. */
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff --git a/./src/options_new.c b/./src/options.c
2+
index 15c82bb..1281298 100644
3+
--- a/./src/options_new.c
4+
+++ b/./src/options.c
5+
@@ -4585,6 +4585,15 @@ NOEXPORT char *engine_auto(void) {
6+
return NULL; /* OK */
7+
}
8+
9+
+static void stunnel_wolfengine_log(const int logLevel, const int component,
10+
+ const char *const logMessage)
11+
+{
12+
+ (void)logLevel;
13+
+ (void)component;
14+
+
15+
+ s_log(LOG_INFO, "%s", logMessage);
16+
+}
17+
+
18+
NOEXPORT char *engine_open(const char *name) {
19+
engine_init(); /* initialize the previous engine (if any) */
20+
if(++current_engine>=MAX_ENGINES)
21+
@@ -4605,6 +4614,19 @@ NOEXPORT char *engine_open(const char *name) {
22+
s_log(LOG_INFO, "UI not supported by engine #%d (%s)",
23+
current_engine+1, ENGINE_get_id(engines[current_engine]));
24+
}
25+
+
26+
+ if (ENGINE_ctrl_cmd(engines[current_engine], "set_logging_cb", 0, NULL,
27+
+ (void(*)(void))stunnel_wolfengine_log, 0)) {
28+
+ s_log(LOG_NOTICE, "wolfEngine logging callback set for engine #%d (%s)",
29+
+ current_engine+1, ENGINE_get_id(engines[current_engine]));
30+
+ }
31+
+ else {
32+
+ ERR_clear_error();
33+
+ s_log(LOG_INFO, "wolfEngine logging callback not supported by engine "
34+
+ "#%d (%s)", current_engine+1,
35+
+ ENGINE_get_id(engines[current_engine]));
36+
+ }
37+
+
38+
return NULL; /* OK */

0 commit comments

Comments
 (0)