eap-tls-common: Validate successful loading of keys/certs

This commit is contained in:
Tim Kourt 2018-12-04 16:31:04 -08:00 committed by Denis Kenzior
parent f1f826ee81
commit 645b72be06
1 changed files with 6 additions and 6 deletions

View File

@ -507,16 +507,16 @@ static bool eap_tls_tunnel_init(struct eap_state *eap)
NULL);
if (!l_tls_set_auth_data(eap_tls->tunnel, eap_tls->client_cert,
eap_tls->client_key,
eap_tls->passphrase)) {
l_error("%s: Failed to set authentication data.",
eap_tls->client_key,
eap_tls->passphrase) ||
(eap_tls->ca_cert &&
!l_tls_set_cacert(eap_tls->tunnel,
eap_tls->ca_cert))) {
l_error("%s: Error loading TLS keys or certificates.",
eap_get_method_name(eap));
return false;
}
if (eap_tls->ca_cert)
l_tls_set_cacert(eap_tls->tunnel, eap_tls->ca_cert);
return true;
}