1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Cleanup: Simplify OpenSSL context initialisation

Assigning the return value of SSLv23_server_method to a variable is
not necessary here and not doing it can get us rid of a lot of
condition code given that the type of the return value changed
at some point.
This commit is contained in:
Marvin Scholz 2019-04-20 19:39:23 +02:00
parent 07304b5193
commit ed9a4e658c

View File

@ -68,11 +68,6 @@ void tls_shutdown(void)
tls_ctx_t *tls_ctx_new(const char *cert_file, const char *key_file, const char *cipher_list)
{
tls_ctx_t *ctx;
#if OPENSSL_VERSION_NUMBER < 0x1000114fL
SSL_METHOD *method;
#else
const SSL_METHOD *method;
#endif
long ssl_opts;
if (!cert_file || !key_file || !cipher_list)
@ -82,10 +77,8 @@ tls_ctx_t *tls_ctx_new(const char *cert_file, const char *key_file, const char *
if (!ctx)
return NULL;
method = SSLv23_server_method();
ctx->refc = 1;
ctx->ctx = SSL_CTX_new(method);
ctx->ctx = SSL_CTX_new(SSLv23_server_method());
ssl_opts = SSL_CTX_get_options(ctx->ctx);
#ifdef SSL_OP_NO_COMPRESSION