Module: kamailio
Branch: master
Commit: 191efd6485989de64713d0644368c2f58d984f5e
URL:
https://github.com/kamailio/kamailio/commit/191efd6485989de64713d0644368c2f…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-02-25T20:43:55+08:00
tls: fix OpenSSL 1.1.1 compatibility
---
Modified: src/modules/tls/tls_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/191efd6485989de64713d0644368c2f…
Patch:
https://github.com/kamailio/kamailio/commit/191efd6485989de64713d0644368c2f…
---
diff --git a/src/modules/tls/tls_mod.c b/src/modules/tls/tls_mod.c
index 136f0e2deb2..550a1bcc2b5 100644
--- a/src/modules/tls/tls_mod.c
+++ b/src/modules/tls/tls_mod.c
@@ -688,6 +688,14 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2)
* GH #3695: OpenSSL 1.1.1 historical note: it is no longer
* needed to replace RAND with cryptorand
*/
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L \
+ && OPENSSL_VERSION_NUMBER < 0x030000000L
+ if(ksr_tls_threads_mode == 0) {
+ LM_WARN("OpenSSL 1.1.1 setting cryptorand random engine\n");
+ RAND_set_rand_method(RAND_ksr_cryptorand_method());
+ }
+#endif
+
sr_kemi_modules_add(sr_kemi_tls_exports);
return 0;