OpenSSL: Merge error returns

These similar error cases can use a single return statement.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-06-30 21:48:22 +03:00
parent 84d6a17a27
commit f24b97972b

View file

@ -3585,19 +3585,12 @@ int tls_global_set_params(void *tls_ctx,
__func__, ERR_error_string(err, NULL));
}
if (tls_global_ca_cert(ssl_ctx, params->ca_cert))
return -1;
if (tls_global_client_cert(ssl_ctx, params->client_cert))
return -1;
if (tls_global_private_key(ssl_ctx, params->private_key,
params->private_key_passwd))
return -1;
if (tls_global_dh(ssl_ctx, params->dh_file)) {
wpa_printf(MSG_INFO, "TLS: Failed to load DH file '%s'",
params->dh_file);
if (tls_global_ca_cert(ssl_ctx, params->ca_cert) ||
tls_global_client_cert(ssl_ctx, params->client_cert) ||
tls_global_private_key(ssl_ctx, params->private_key,
params->private_key_passwd) ||
tls_global_dh(ssl_ctx, params->dh_file)) {
wpa_printf(MSG_INFO, "TLS: Failed to set global parameters");
return -1;
}