]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Refactor] Move OpenSSL providers from global to libs_ctx
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 28 Oct 2025 11:30:28 +0000 (11:30 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 28 Oct 2025 11:30:28 +0000 (11:30 +0000)
commitf4a6b3bb6673ed8d56b9db85c97bf4bc0d2c11dd
tree2637517312db7d5fe6ce83ea75d02d8c8b7b82d8
parent2427e652810d45713bcccb3ac388fb710b4bdb2c
[Refactor] Move OpenSSL providers from global to libs_ctx

Previously, OpenSSL 3.0+ providers (legacy and default) were stored in
static global variables. This is not a good architecture as these resources
should be managed alongside other library contexts.

This commit refactors the code to store SSL providers in the
rspamd_external_libs_ctx structure:
- Add ssl_legacy_provider and ssl_default_provider fields to libs_ctx
- Pass libs_ctx to rspamd_openssl_maybe_init() to store providers there
- Remove rspamd_openssl_cleanup() function - cleanup now happens in
  rspamd_deinit_libs() when the libs_ctx is freed
- Remove global variables and manual cleanup calls

This provides better resource management and clearer ownership of
OpenSSL provider lifecycle.
src/libserver/cfg_utils.cxx
src/libserver/ssl_util.c
src/libserver/ssl_util.h
src/rspamd.c
src/rspamd.h