Module: kamailio Branch: 5.8 Commit: b98718c28f72b1372a62b17174b43c403fa6b729 URL: https://github.com/kamailio/kamailio/commit/b98718c28f72b1372a62b17174b43c40...
Author: S-P Chan shihping.chan@gmail.com Committer: S-P Chan shihping.chan@gmail.com Date: 2024-02-25T20:42:14+08:00
tls: fix OpenSSL 1.1.1 compatibility
---
Modified: src/modules/tls/tls_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/b98718c28f72b1372a62b17174b43c40... Patch: https://github.com/kamailio/kamailio/commit/b98718c28f72b1372a62b17174b43c40...
---
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;