OpenSSL: Avoid never-used analyzer warning
Use #ifdef blocks more cleanly to avoid unnecessary never-used assignment of a variable. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
7b6e81575f
commit
a5802c0620
1 changed files with 5 additions and 3 deletions
|
@ -785,12 +785,13 @@ void * tls_init(const struct tls_config *conf)
|
||||||
PKCS12_PBE_add();
|
PKCS12_PBE_add();
|
||||||
#endif /* PKCS12_FUNCS */
|
#endif /* PKCS12_FUNCS */
|
||||||
} else {
|
} else {
|
||||||
context = tls_global;
|
|
||||||
#ifdef OPENSSL_SUPPORTS_CTX_APP_DATA
|
#ifdef OPENSSL_SUPPORTS_CTX_APP_DATA
|
||||||
/* Newer OpenSSL can store app-data per-SSL */
|
/* Newer OpenSSL can store app-data per-SSL */
|
||||||
context = tls_context_new(conf);
|
context = tls_context_new(conf);
|
||||||
if (context == NULL)
|
if (context == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
#else /* OPENSSL_SUPPORTS_CTX_APP_DATA */
|
||||||
|
context = tls_global;
|
||||||
#endif /* OPENSSL_SUPPORTS_CTX_APP_DATA */
|
#endif /* OPENSSL_SUPPORTS_CTX_APP_DATA */
|
||||||
}
|
}
|
||||||
tls_openssl_ref_count++;
|
tls_openssl_ref_count++;
|
||||||
|
@ -988,9 +989,10 @@ struct tls_connection * tls_connection_init(void *ssl_ctx)
|
||||||
SSL_CTX *ssl = ssl_ctx;
|
SSL_CTX *ssl = ssl_ctx;
|
||||||
struct tls_connection *conn;
|
struct tls_connection *conn;
|
||||||
long options;
|
long options;
|
||||||
struct tls_context *context = tls_global;
|
|
||||||
#ifdef OPENSSL_SUPPORTS_CTX_APP_DATA
|
#ifdef OPENSSL_SUPPORTS_CTX_APP_DATA
|
||||||
context = SSL_CTX_get_app_data(ssl);
|
struct tls_context *context = SSL_CTX_get_app_data(ssl);
|
||||||
|
#else /* OPENSSL_SUPPORTS_CTX_APP_DATA */
|
||||||
|
struct tls_context *context = tls_global;
|
||||||
#endif /* OPENSSL_SUPPORTS_CTX_APP_DATA */
|
#endif /* OPENSSL_SUPPORTS_CTX_APP_DATA */
|
||||||
|
|
||||||
conn = os_zalloc(sizeof(*conn));
|
conn = os_zalloc(sizeof(*conn));
|
||||||
|
|
Loading…
Reference in a new issue