remove 0 assignments.
After openssl_zalloc, cleanup more "set to 0/NULL" assignments. Many are from github feedback. Reviewed-by: Tim Hudson <tjh@openssl.org>
This commit is contained in:
@@ -1688,41 +1688,16 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth)
|
||||
goto err;
|
||||
|
||||
ret->method = meth;
|
||||
ret->cert_store = NULL;
|
||||
ret->session_cache_mode = SSL_SESS_CACHE_SERVER;
|
||||
ret->session_cache_size = SSL_SESSION_CACHE_MAX_SIZE_DEFAULT;
|
||||
ret->session_cache_head = NULL;
|
||||
ret->session_cache_tail = NULL;
|
||||
|
||||
/* We take the system default */
|
||||
/* We take the system default. */
|
||||
ret->session_timeout = meth->get_timeout();
|
||||
|
||||
ret->new_session_cb = 0;
|
||||
ret->remove_session_cb = 0;
|
||||
ret->get_session_cb = 0;
|
||||
ret->generate_session_id = 0;
|
||||
|
||||
ret->references = 1;
|
||||
ret->quiet_shutdown = 0;
|
||||
ret->info_callback = NULL;
|
||||
ret->app_verify_callback = 0;
|
||||
ret->app_verify_arg = NULL;
|
||||
ret->max_cert_list = SSL_MAX_CERT_LIST_DEFAULT;
|
||||
ret->read_ahead = 0;
|
||||
ret->msg_callback = 0;
|
||||
ret->msg_callback_arg = NULL;
|
||||
ret->verify_mode = SSL_VERIFY_NONE;
|
||||
ret->sid_ctx_length = 0;
|
||||
ret->default_verify_callback = NULL;
|
||||
if ((ret->cert = ssl_cert_new()) == NULL)
|
||||
goto err;
|
||||
|
||||
ret->default_passwd_callback = 0;
|
||||
ret->default_passwd_callback_userdata = NULL;
|
||||
ret->client_cert_cb = 0;
|
||||
ret->app_gen_cookie_cb = 0;
|
||||
ret->app_verify_cookie_cb = 0;
|
||||
|
||||
ret->sessions = lh_SSL_SESSION_new();
|
||||
if (ret->sessions == NULL)
|
||||
goto err;
|
||||
@@ -1756,39 +1731,23 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth)
|
||||
|
||||
CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL_CTX, ret, &ret->ex_data);
|
||||
|
||||
ret->extra_certs = NULL;
|
||||
/* No compression for DTLS */
|
||||
if (!(meth->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS))
|
||||
ret->comp_methods = SSL_COMP_get_compression_methods();
|
||||
|
||||
ret->max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH;
|
||||
|
||||
ret->tlsext_servername_callback = 0;
|
||||
ret->tlsext_servername_arg = NULL;
|
||||
/* Setup RFC4507 ticket keys */
|
||||
if ((RAND_bytes(ret->tlsext_tick_key_name, 16) <= 0)
|
||||
|| (RAND_bytes(ret->tlsext_tick_hmac_key, 16) <= 0)
|
||||
|| (RAND_bytes(ret->tlsext_tick_aes_key, 16) <= 0))
|
||||
ret->options |= SSL_OP_NO_TICKET;
|
||||
|
||||
ret->tlsext_status_cb = 0;
|
||||
ret->tlsext_status_arg = NULL;
|
||||
|
||||
#ifndef OPENSSL_NO_NEXTPROTONEG
|
||||
ret->next_protos_advertised_cb = 0;
|
||||
ret->next_proto_select_cb = 0;
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
ret->psk_identity_hint = NULL;
|
||||
ret->psk_client_callback = NULL;
|
||||
ret->psk_server_callback = NULL;
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
if (!SSL_CTX_SRP_CTX_init(ret))
|
||||
goto err;
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ret->client_cert_engine = NULL;
|
||||
# ifdef OPENSSL_SSL_CLIENT_ENGINE_AUTO
|
||||
# define eng_strx(x) #x
|
||||
# define eng_str(x) eng_strx(x)
|
||||
|
Reference in New Issue
Block a user