| 149 | #endif /* USE_CRYPTO_LOCKS */ |
| 150 | |
| 151 | void tlsInit(void) { |
| 152 | /* Enable configuring OpenSSL using the standard openssl.cnf |
| 153 | * OPENSSL_config()/OPENSSL_init_crypto() should be the first |
| 154 | * call to the OpenSSL* library. |
| 155 | * - OPENSSL_config() should be used for OpenSSL versions < 1.1.0 |
| 156 | * - OPENSSL_init_crypto() should be used for OpenSSL versions >= 1.1.0 |
| 157 | */ |
| 158 | #if OPENSSL_VERSION_NUMBER < 0x10100000L |
| 159 | OPENSSL_config(NULL); |
| 160 | SSL_load_error_strings(); |
| 161 | SSL_library_init(); |
| 162 | #elif OPENSSL_VERSION_NUMBER < 0x10101000L |
| 163 | OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL); |
| 164 | #else |
| 165 | OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG|OPENSSL_INIT_ATFORK, NULL); |
| 166 | #endif |
| 167 | |
| 168 | #ifdef USE_CRYPTO_LOCKS |
| 169 | initCryptoLocks(); |
| 170 | #endif |
| 171 | |
| 172 | if (!RAND_poll()) { |
| 173 | serverLog(LL_WARNING, "OpenSSL: Failed to seed random number generator."); |
| 174 | } |
| 175 | |
| 176 | tlsInitThread(); |
| 177 | } |
| 178 | |
| 179 | void tlsInitThread(void) |
| 180 | { |
no test coverage detected