Skip to content

Commit 155455a

Browse files
olszomalmtrojnar
authored andcommitted
Bind helper methods in engine_ctrl() only for OpenSSL versions older than 3.0.
With OpenSSL 3.x, an engine might be used if defined in `openssl.cnf`. This causes memory leaks when engine control commands are set in the config file. For OpenSSL 3.0 and newer, add engine routines only after loading keys.
1 parent 715695d commit 155455a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/eng_front.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ static int engine_ctrl(ENGINE *engine, int cmd, long i, void *p, void (*f) ())
202202
ctx = get_ctx(engine);
203203
if (!ctx)
204204
return 0;
205+
#if OPENSSL_VERSION_NUMBER < 0x30000000L
205206
bind_helper_methods(engine);
207+
#endif
206208
return ctx_engine_ctrl(ctx, cmd, i, p, f);
207209
}
208210

0 commit comments

Comments
 (0)