Module: kamailio Branch: master Commit: 00eb71da83347c9d2ea74feacec9c955f7b2a2e6 URL: https://github.com/kamailio/kamailio/commit/00eb71da83347c9d2ea74feacec9c955...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2017-08-02T09:54:18+02:00
tls: explicit libssl v1.1+ cleanup when module is destroyed
- OPENSSL_cleanup() explicitely executed for libssl v1.1+ when tls module is destroyed, to avoid being executed again on final exit (due to atexit() callback), because at that moment shared memory is already destroyed and attempts to access the locals will result in cored dump - retported by Victor Seva, GH #1189
---
Modified: src/modules/tls/tls_init.c
---
Diff: https://github.com/kamailio/kamailio/commit/00eb71da83347c9d2ea74feacec9c955... Patch: https://github.com/kamailio/kamailio/commit/00eb71da83347c9d2ea74feacec9c955...
---
diff --git a/src/modules/tls/tls_init.c b/src/modules/tls/tls_init.c index 6d78c37551..054d687e9c 100644 --- a/src/modules/tls/tls_init.c +++ b/src/modules/tls/tls_init.c @@ -847,4 +847,10 @@ void destroy_tls_h(void) tls_destroy_cfg(); tls_destroy_locks(); tls_ct_wq_destroy(); +#if OPENSSL_VERSION_NUMBER >= 0x010100000L + /* explicit execution of libssl cleanup to avoid being executed again + * by atexit(), when shm is gone */ + DBG("executing openssl v1.1+ cleanup\n"); + OPENSSL_cleanup(); +#endif }