blob: e1a4a948ac8b7502d5c0024e60097f5db2de6292 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001--- a/src/main.c
2+++ b/src/main.c
3@@ -1155,10 +1155,12 @@ main(int argc, char **argv)
4 sigprocmask(SIG_BLOCK, &set, NULL);
5 trap_init(argv[0]);
6
7+#if OPENSSL_VERSION_NUMBER < 0x10100000L
8 /* SSL library init */
9 OPENSSL_config(NULL);
10 SSL_load_error_strings();
11 SSL_library_init();
12+#endif
13 /* Rand seed */
14 randseed.thread_id = (void *)main_tid;
15 gettimeofday(&randseed.tv, NULL);
16@@ -1346,8 +1348,11 @@ main(int argc, char **argv)
17 if(opt_fork)
18 unlink(opt_pidpath);
19
20+#if OPENSSL_VERSION_NUMBER < 0x10100000L
21 /* OpenSSL - welcome to the "cleanup" hell */
22+#ifndef OPENSSL_NO_ENGINE
23 ENGINE_cleanup();
24+#endif
25 RAND_cleanup();
26 CRYPTO_cleanup_all_ex_data();
27 EVP_cleanup();
28@@ -1355,12 +1360,13 @@ main(int argc, char **argv)
29 #if !defined(OPENSSL_NO_COMP)
30 COMP_zlib_cleanup();
31 #endif
32- ERR_remove_state(0);
33+ ERR_remove_thread_state(NULL);
34 ERR_free_strings();
35 #if !defined(OPENSSL_NO_COMP) && OPENSSL_VERSION_NUMBER < 0x1010006f
36 sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
37 #endif
38 /* end of OpenSSL cleanup code */
39+#endif
40
41 #if ENABLE_DBUS_1
42 extern void dbus_shutdown(void);