Module: kamailio Branch: master Commit: 04208090638a639cdf03fafb1df161cd71f74c7e URL: https://github.com/kamailio/kamailio/commit/04208090638a639cdf03fafb1df161cd...
Author: Henning Westerholt hw@gilawa.com Committer: Henning Westerholt hw@gilawa.com Date: 2024-09-04T06:23:47Z
tls: extend startup information for OpenSSL library
- output compiled and run-time library version for OpensSL - also output FIPS mode if activated - needs at least OpenSSL version 3.x
---
Modified: src/modules/tls/tls_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/04208090638a639cdf03fafb1df161cd... Patch: https://github.com/kamailio/kamailio/commit/04208090638a639cdf03fafb1df161cd...
---
diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c index cce34148470..3c25eb1cb66 100644 --- a/src/modules/tls/tls_mod.c +++ b/src/modules/tls/tls_mod.c @@ -490,7 +490,20 @@ static int mod_init(void) if(tls_check_sockets(*tls_domains_cfg) < 0) goto error;
- LM_INFO("use OpenSSL version: %08x\n", (uint32_t)(OPENSSL_VERSION_NUMBER)); + +#if OPENSSL_VERSION_NUMBER < 0x030000000L + LM_INFO("compiled with OpenSSL version: %08x\n", (uint32_t)(OPENSSL_VERSION_NUMBER)); +#elif OPENSSL_VERSION_NUMBER >= 0x030000000L + LM_INFO("compiled with OpenSSL: %s\n", OPENSSL_VERSION_TEXT); + LM_INFO("run-time OpenSSL library: %s\n", OpenSSL_version(OPENSSL_VERSION)); + + if(EVP_default_properties_is_fips_enabled(NULL) == 1) { + LM_INFO("FIPS mode enabled in OpenSSL library\n"); + } else { + LM_INFO("FIPS mode not enabled in OpenSSL library\n"); + } +#endif + #ifndef OPENSSL_NO_ECDH LM_INFO("With ECDH-Support!\n"); #endif