Skip to content

Commit

Permalink
Bind helper methods in engine_ctrl() only for OpenSSL versions older …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
olszomal authored and mtrojnar committed Nov 13, 2024
1 parent 715695d commit 155455a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/eng_front.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ static int engine_ctrl(ENGINE *engine, int cmd, long i, void *p, void (*f) ())
ctx = get_ctx(engine);
if (!ctx)
return 0;
#if OPENSSL_VERSION_NUMBER < 0x30000000L
bind_helper_methods(engine);
#endif
return ctx_engine_ctrl(ctx, cmd, i, p, f);
}

Expand Down

0 comments on commit 155455a

Please sign in to comment.