diff --git a/ssl/d1_srtp.c b/ssl/d1_srtp.c index 0f2b7632..ce15ee21 100644 --- a/ssl/d1_srtp.c +++ b/ssl/d1_srtp.c @@ -211,7 +211,7 @@ STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl) { return ssl->srtp_profiles; } - if (ssl->ctx != NULL && ssl->ctx->srtp_profiles != NULL) { + if (ssl->ctx->srtp_profiles != NULL) { return ssl->ctx->srtp_profiles; } diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 119990e7..620e1ca9 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -447,17 +447,15 @@ struct ssl_cipher_preference_list_st *ssl_get_cipher_preferences(SSL *ssl) { return ssl->cipher_list; } - if (ssl->version >= TLS1_1_VERSION && ssl->ctx != NULL && - ssl->ctx->cipher_list_tls11 != NULL) { + if (ssl->version >= TLS1_1_VERSION && ssl->ctx->cipher_list_tls11 != NULL) { return ssl->ctx->cipher_list_tls11; } - if (ssl->version >= TLS1_VERSION && ssl->ctx != NULL && - ssl->ctx->cipher_list_tls10 != NULL) { + if (ssl->version >= TLS1_VERSION && ssl->ctx->cipher_list_tls10 != NULL) { return ssl->ctx->cipher_list_tls10; } - if (ssl->ctx != NULL && ssl->ctx->cipher_list != NULL) { + if (ssl->ctx->cipher_list != NULL) { return ssl->ctx->cipher_list; } diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 174e9ae3..826b3006 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1259,17 +1259,15 @@ STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *ssl) { return ssl->cipher_list->ciphers; } - if (ssl->version >= TLS1_1_VERSION && ssl->ctx != NULL && - ssl->ctx->cipher_list_tls11 != NULL) { + if (ssl->version >= TLS1_1_VERSION && ssl->ctx->cipher_list_tls11 != NULL) { return ssl->ctx->cipher_list_tls11->ciphers; } - if (ssl->version >= TLS1_VERSION && ssl->ctx != NULL && - ssl->ctx->cipher_list_tls10 != NULL) { + if (ssl->version >= TLS1_VERSION && ssl->ctx->cipher_list_tls10 != NULL) { return ssl->ctx->cipher_list_tls10->ciphers; } - if (ssl->ctx != NULL && ssl->ctx->cipher_list != NULL) { + if (ssl->ctx->cipher_list != NULL) { return ssl->ctx->cipher_list->ciphers; } @@ -1287,7 +1285,7 @@ STACK_OF(SSL_CIPHER) *ssl_get_ciphers_by_id(SSL *ssl) { return ssl->cipher_list_by_id; } - if (ssl->ctx != NULL && ssl->ctx->cipher_list_by_id != NULL) { + if (ssl->ctx->cipher_list_by_id != NULL) { return ssl->ctx->cipher_list_by_id; } diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 2c9a0b2a..8facdd38 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -2367,11 +2367,10 @@ static int ssl_check_clienthello_tlsext(SSL *ssl) { int ret = SSL_TLSEXT_ERR_NOACK; int al = SSL_AD_UNRECOGNIZED_NAME; - if (ssl->ctx != NULL && ssl->ctx->tlsext_servername_callback != 0) { + if (ssl->ctx->tlsext_servername_callback != 0) { ret = ssl->ctx->tlsext_servername_callback(ssl, &al, - ssl->ctx->tlsext_servername_arg); - } else if (ssl->initial_ctx != NULL && - ssl->initial_ctx->tlsext_servername_callback != 0) { + ssl->ctx->tlsext_servername_arg); + } else if (ssl->initial_ctx->tlsext_servername_callback != 0) { ret = ssl->initial_ctx->tlsext_servername_callback( ssl, &al, ssl->initial_ctx->tlsext_servername_arg); } @@ -2398,11 +2397,10 @@ static int ssl_check_serverhello_tlsext(SSL *ssl) { int ret = SSL_TLSEXT_ERR_OK; int al = SSL_AD_UNRECOGNIZED_NAME; - if (ssl->ctx != NULL && ssl->ctx->tlsext_servername_callback != 0) { + if (ssl->ctx->tlsext_servername_callback != 0) { ret = ssl->ctx->tlsext_servername_callback(ssl, &al, - ssl->ctx->tlsext_servername_arg); - } else if (ssl->initial_ctx != NULL && - ssl->initial_ctx->tlsext_servername_callback != 0) { + ssl->ctx->tlsext_servername_arg); + } else if (ssl->initial_ctx->tlsext_servername_callback != 0) { ret = ssl->initial_ctx->tlsext_servername_callback( ssl, &al, ssl->initial_ctx->tlsext_servername_arg); }